Hacker News new | ask | show | jobs
by therealmarv 3430 days ago
Yesterday I've downloaded VSCode and https://github.com/DonJayamanne/pythonVSCode (seriously, look at the GIFs in this repo!) for first time and I had autocompletion (with IntelliSense and documentation lookup), refactoring and code define jumping for Python code out of the box working within 10 minutes in a VirtualEnv. VSCode + one plugin (all opensource) and I had something similar to PyCharm and fast. (nothing against vim, just want to mention how impressed I was)
8 comments

I also have been switching over to VSCode for coding. The vim plugin is pretty decent.

I still keep vim around for huge files though. I work daily with NASTRAN input and output files, routinely multiple 100 mb, sometimes multiple-gb. I edited a 10gb file earlier this week and vim didn't choke up too much. Best editor I've found so far for huge files.

Which VIM plugin are you using? I've tried them all, including the recommended one simply called 'vim', and they are all missing the most basic of features. Go-to-definition (Ctrl-]) was one missing for me just a few hours ago when I last tried it!
I have vscodevim plugin, currently 0.5.2 and it's decent, it's been making progress, yet still it has little things that definitely detract from the experience, like motion keystrokes do not take the key auto-repeat. Actually it works moving by block ({}) and line (+-) but not with character (i,j,k,l) or word motions (wW,bB,eE) or next/previous occurrence of search (nN). Annoying. At least now they've fixed the issue where I had to re-enter a search term when switching buffers. So there's progress, and it will eventually be just as good.
god help me escape pycharm, i only got 4gb of ram
Both VSCode and Atom are memory intensive as well.

That being said I've used PyCharm on a system with 2 GB memory before and that does work okay, you just need to make sure that no other memory-hungry apps run at the same time (browser, email, multimedia) and that the system itself doesn't use too much memory.

> i only got 4gb of ram

Well, for all of their benefits Electron apps in general have some hiccups on resource constrained systems.

Not sure what Electron has to do with pycharm, as with most (all?) other JetBrains software it runs on the jre.

Edit: realized you're probably talking about vscode, which is an electron app

Does it support virtual environments that are within a vagrant machine? That is a use case that I hardly find integrated in IDE's (other than pycharm) and so I usually quickly go back to vim and terminal again.
The maintainer is working on it: https://github.com/DonJayamanne/pythonVSCode/issues/123 maybe somebody can help him ;)
FWIW the "vim" vim-plugin for vscode isn't terrible either, if one wants all that with modal editing. I actually think that vscode with vim plugin is somewhat better on windows than vim is. Depends on how one usually configures vim, of course.
I use vim via ssh and in tmux everyday. I mostly love it.

But sometimes there are merge conflicts. I've settled for xpra and kdiff3 as the mergetool. I just can't handle the problem without a GUI tool.

But isn't it still easier to use a proper IDE in the local machine with Linux/Windows/OSX gui and then just git push the code? What advantages does your setup have?
Most 'proper' IDEs have no or terrible merge tools.
And terminal has better such tools?
my $WORK issued machine is a windows box and the software i work on is 99% Linux.
I work from home and I voluntarily choosed exactly this setup. Windows desktop and IDE tools are more comfortable, but the "real" software runs on Linux VM.
How does this compare to something like sublime + anaconda?
VSCode (+ Python plugin) is much faster (I also have the feeling VSCode is using less resources than sublime+Anaconda!) and inline help is much more "helpful" during coding. I'm using Anaconda and Sublime since 1-2 years now and Anaconda is better than nothing but it pales when comparing it to VSCode (+Python plugin).
VSCode/Atom are great, but for most folks on UNIX they are worthless, since you have to use something else when ssh-d into another machine. So folks build these elaborate Vim and EMACS set-ups so that they could use the same editor and the same config on all of their machines, whether they're local or remote. Vim is an acquired taste, but once acquired, it's pretty awesome.
Well this is your use case. I use Linux every day but I never touch python code directly on remote systems (it's getting automatically or manually deployed). All my python code lives in virtualenv locally here. But I understand when people work for many projects they maybe want to encapsulate it more (vagrant etc.).
Of course, use cases are different. In my case I usually deploy either automatically or manually, but in those rare cases when you can't replicate bug locally there is nothing better than vi. But of course, to each his own.
Debugging directly on the production system?

Yeah, nobody does that. Well, nobody who has any kind of serious operation going on.

If you can't replicate a bug outside a production environment you have a serious deficit in the devops department.

You should be able to stage a machine with a copy of the production DB/data and the same reproducible package(code) that currently runs on your production systems.

Everything else is just an accident waiting to happen.

> Debugging directly on the production system? Yeah, nobody does that.

Uh, what bubble are you living in? Almost everyone does that to some extent. We can all pretend we're code ninjas with super clean deployment pipelines and strict policies, but all of us get lazy occasionally.

Not to mention that, in any successful project, there are going to be systems that need to be looked at by someone else. It's great for the original developer(s) that they can use their IDE to access files directly in containers, but if I'm called to investigate a running system then I'm going to end up in a shell on those hosts.

The only place I can see this never happening is in large enterprises that have huge departments with slow enough turnover that "the accepted workflow" is easily passed on to new hires. Referring to everyone else as "mom & pop shops" makes it sound like the speaker is living in a Silicon Valley enterprise bubble.

I find it amusing to see that term used as an insult on a site largely populated by startups.

dont no
"Almost everyone does that".

No they don't. I am not living in a bubble. You're describing a mom and pop shop.

And by the way you don't have to be a code ninja or have a super devops team for that.

You can have your code locally, point your DB config to a staging server with a copy(you do backups daily, don't you?) of production and boom!

Seriously now... elementary stuff. If you're still changing code directly on live systems you have a long way to go.

Our host, Paul Graham, talks about his first successful startup sometimes. It's ViaWeb, now Yahoo Stores, and it made him the rich investor he is today.

He edited the code live on the production server sometimes. And he did it in the repl, not by editing source files, so he didn't even have a record of what he changed that could go into version control.

When you're nimble and you need every advantage to compete, sometimes you have to be able to do things the hard way.

Not that I would recommend it; every ethical programmer in the galaxy has denounced the practice. And they have good reasons.

>> in those rare cases when you can't replicate bug locally

> directly on the production system?

Why does 'non-local' have to equate to production? Are you able to use an IDE in your container/VM/cloud server?

Yes, PyCharm supports Vagrant, Docker etc.

My host system is Fedora but since our production code is deployed on Ubuntu, I have a Vagrant Ubuntu image. PyCharm reads the Vagrantfile and it has access to the virtualenv(python in our case) of the Vagrant's image.

UPDATE: I am not sure if that's what you were asking. Maybe this response(https://news.ycombinator.com/item?id=13543158) I gave is more relevant ?

My developer machines I have a neovim setup with a bunch of extra config and plugins, but when doing remote work I often have to use vanilla vi or vim.. and I just put up with it.

If I need to do something significant, i'll scp the file around. I know vim can edit over ssh, but I honestly never do.

I've never tried vscode, but I am tempted to try the remote support: https://github.com/DonJayamanne/pythonVSCode/wiki/Debugging-...

+1. I use VIM all the time on my remote servers, but never to dev.
I prefer console in general, for everything. I've been doing this for 20+ years, and you can pry it from my cold, dead hands.
I've only been coding for 11 years professionally, but also as a hobby before that. Only in 2016 did I move most of my work out of VIM into an IDE: the Jetbrains family. That mostly started for better interactive debugging, but with IDEAVim handling 95% of my VIMisms I find that I'm simply coding in PyCharm and PhpStorm by default now.

The base editor is open source but you can get the full PyCharm for $99 per year. Worth every cent.

I've used PyCharm. The editing feature is beyond useless to me, because it does not have vim key bindings. How am I supposed to cut and paste code when commands like "y}" don't work? You actually expect me to use a mouse to select things or move the cursor? Ridiculous.

The only thing I've found PyCharm good for is doing other functions, like linting, not for the actual code editing. No IDE is any good for that. Luckily, PyCharm works just fine when the code it's working with changes on the filesystem below it because of the use of an external editor.

There is VIM plug-in for Intellij family IDEs. It covers the great part of VIM functionality. It even supports some sort of VIM configs. "y}" works fine, as well as "yi{".
This sound you are trapped in vim keybindings. There is no need to use a mouse on "normal" editors.
"y}" works with IdeaVIM. https://github.com/JetBrains/ideavim
Console for everything is the same like saying I never touch console, only GUI. There is a usecase for everything... I also want to see how you manage a bigger Java project from console with your 20+ years of expertise.
What about Java development necessitates a GUI?

I've never found I needed to use a GUI for developing software, outside of a browser.

Working on a big legacy Java program spread over many dozens smallish files in deeply nested directory trees is very annoying without some IDE features (e.g. jump to definition). And I haven't seen a tool that can provide that kind of support for a classic text editor (Vim/Emacs). So you have to use an IDE (which necessitates a GUI).

To be fair, most other mainstream languages (except maybe Go) lack that kind of tooling too, but at least their cultures do not encourage liberal use of deeply nested directory trees and overengineered abstractions, the way Java does.

Why not just run PyCharm on your local box and tunnel-via-SSH-and-pydevd to remote-debug your programs on the target system? You get (a) a full IDE running on your local system (no need to install anything on target system); (b) full debugging and breakpoints; (c) your choice of any "real" or "virtualenv" Python deployment on the target machine. Downsides are that your own source code on the local and remote systems need to match (for your step-through-code to make sense), and you need to set up mappings between directories with source code on the local and remote systems -- but that's a low cost for full visibility into how your program runs on the target system.
You could mount the remote machines filesystem over ssh with sshfs.

https://wiki.archlinux.org/index.php/SSHFS

I use supercomputers which only have a terminal interface. I found it was easier to do most of the development of the code on my machine with a GUI (e.g. Pycharm or VSCode) and then push code to the cluster for production runs. I use vim for minor adjustments, but it seemed way easier to just push code rather than configuring vim when something like VSCode is so much easier to get set up.
Thing is, you only need to configure Vim once, and then use your version controlled config everywhere for 10 years, very gradually improving it. I doubt VSCode will even exist in 10 years.
Are any of your plugins from 10 years ago still around? You can't compare naked Vim with VSCode.

Also, Visual Studio has been around since 1997 and there's no reason to assume, out of hand, that VSCode won't last as long, being both popular and Open Source.

I'm a Vim user, but cut the FUD.

> Are any of your plugins from 10 years ago still around?

Ctrlp, python (the filetype plugin), vimwiki... most of them honestly.

> You can't compare naked Vim with VSCode.

If you're doing C programming, it's probably close to equivalent out of the box. For Python development, you'll want to at least get the Python plugins; but you'll be doing that in most editors.

IMO, VSCode is interesting, but it's not that spectacular if you've been using any form of IDE (or a decent text editor with plugins). That is, it doesn't offer any major advantages over the other editors.

I'm pretty sure they'll still be around. They're all open source.
I don't even need to configure Visual Studio, and it's been around for 20 years.
VSCode seems to be great, Atom is mediocre and that is polite.
I know atom is easy to slow down with tons of plugins and extensions but why does it have a bad wrap? I am just curious because I've seen this sentiment but I find Atom has an amazing ecosystem of plugins it's not the editor for me mostly cause I came into it with Sublime that is what I personally like and now recently spacemacs but I'm curious
I have 20+ yrs of using vim. Tried numerous times to switch to emacs, I started using VSCode and love it. It's not useless, my vim skills is still handy. Logging in to servers to hotfix thing is no longer something to brag about. Cattle not pets. If I really need to login to a server to edit something, I don't need a fancy .vimrc. I don't code live on prod.
Modern GNU/linux filemanagers support connecting to ssh server and browse and open and edit files just like they are local. You can do it in two seconds.

In ubuntu it's file -> connect to server -> type in ssh://username@ip

That's it you are done. You can now browse the files as if they are local and use sublime/gedit/VSCode/Pycharm/whatever you want

I like this answer. For everyone who wants to do this by commandline: Search for sshfs and FUSE (also possible on Mac with osxfuse). Only be aware that a mac uses a different kind of utf-8 than unix. My command I use for sshfs on a mac:

  sshfs -o Ciphers=aes128-gcm@openssh.com -o Compression=no -o reconnect \
  -o modules=iconv,from_code=utf-8,to_code=utf-8-mac \
  myremote:/somedirectory/ /mylocalmountdir
I'm not familiar with Macs. How is their UTF-8 different from the normal one? How is such a thing even possible?
I also thought the same, you would not recognize it most of the time (even while transferring). But I'm german and I use sometimes Umlauts in filenames/directories. They did not showed up in my Samba share so I got aware of this issue. I think this issue is too hidden.

If you want to read about this topic:

rsync: http://askubuntu.com/questions/533690/rsync-with-special-cha...

sshfs: https://github.com/osxfuse/sshfs/issues/14

Plugins like https://atom.io/packages/remote-edit allow you to directly edit your remote code while still in the GUI. I still mostly use VIM, but its a nice alternative.
I used VSCode once and in just ten minutes, I helped a repressive megacorp meet their HN marketing goals, instead of supporting developers who might actually need it.
hm, I also don't like MS. But kudos to this open source editor and what it can do with Python and JS code. It is by the way developed in Switzerland by a former Eclipse founder (Erich Gamma).