by georgieporgie · 15y ago · 0 comments
I'll just come out and say it: my favorite editor is Visual Studio. Sure, it's slow to load and rather fat now, but I'm talking solely about the editing functionality.
With vim, I have to climb an amazing learning curve, regularly practicing all sorts of commands to achieve basic productivity. With VS, any command I don't recall is readily available through the menus. As I access it in the menus, I'm reminded of the keyboard shortcut, so it seems like a much more natural leaning experience to me.
If you only code every now and then, so you've got a lot of time between sessions to forget things, and not a whole lot of time in total, then something like Visual Studio which has good 'discoverability' is going to be better for you - as you say, if you get lost just go to the menu and it does a pretty good job of showing you around.
If, however, you are coding full time for a living, spending at least 8 hours a day 5 days a week coding (and let's face it, for most people on HN it's probably more like 12 hours a day 6 days a week), then spending even 2 whole weeks getting to grips with an esoteric but POWERFUL editor like Vim will very quickly pay off in terms of time saved and productivity gained.
Not my experience at all. It's a sea of confusion and pain.
Personally, the god-awful slow file switching, frequently-incorrect highlighting, almost totally worthless JavaScript, ASP, and ASP server-side code support, XML comments with no built-in documentation builder nor viewer, text-column editing that's a total joke, and the always-helpful "too many warnings" error are my most recent peeves.
I hate VS. With a passion. I cannot believe that such a painful-to-use program is held up as the pinnacle of programming experiences.
So why do I use it? Because .NET defies logic; framework-wide intellisense is the only way to do anything in it. Give me almost any other language/framework and in a few days I can get by almost entirely with a programming text editor and occasional official-documentation browsing. Several months into .NET code, I still Google more than I MSDN, StackOverflow more than .NET-developer-blog, and the massive style inconsistencies between different sections of the library mean I cannot go into any new area without Visual Studio to hold my hand and kick me in the nuts.
However, over and over, on each of my projects that used Eclipse, inevitably multiple team members would have Eclipse crash and throw their entire workspace into disarray. Sure Eclipse might give you a 20% boost of productivity day to day, but that once every six months catastrophic disaster it would cause negated a lot of it.
Sometimes Eclipse would have trouble talking to the database, sometimes it would screw up its project file, other times it would outright corrupt files, cache things wrong, etc. This wasn't just for me, it was the experience many of our programmers had at various companies.
Now I'm working on my own project, and it's not near as large so I haven't felt the pain of not having magic-refactor. I've been forced to hack on a script to provide step-through debugging capability, and probably once a day I'll google to find the right keystrokes to do something, but I feel in the end, the effort is more than worth it.
Refactorings: I can rename a method in one location and it will change all the calling code. This would be dangerous to do by hand: Best case scenario, there would be a compiler error for all the broken code. Worst case, that method name was already overloaded and you just introduced a bug.
ctrl+n: Open any file that's in your project. It can find the file by camel case or pattern matching and it only includes files in your project.
ctrl+alt+h: See a tree of all the callers of a method. Extremely useful when you're considering a refactoring. You can instantly answer the questions, "Is anyone calling this method?", "Is anyone calling the methods that are calling this method?...", "What will be affected by this change?", and so on.
I would disagree with the gp's assertion that there is an extreme amount to learn to obtain basic editing efficiency. A dozen commands or so and gvim so you can use the mouse should take you 20 minutes and a bit of practice to feel comfortable with.
Not to be overly pedantic, but your favorite IDE is Visual Studio, and you just happen to use whatever crappy editor component comes bundled with it.
If we could have full-blown Vim embedded inside IDEs instead of good-but-incomplete plugins which merely give you some of the key mappings, I'd be elated and couldn't see why anyone would stick with the Notepad-style editor which is the default.
While I really hated Visual Studio (and still do), this combination of tools really makes it worthwhile. It is an awesome marriage of a mediocre IDE, some substantial refinements to make it usable, and a phenomenal text editor. The nice thing about ViEmu is that is extremely full-featured. It even reads my entire .vimrc with all my customizations and personal magic!
So, I guess what I want to say is that instead of deciding between using an IDE and a text editor, you should actually use both! Real progress lies in synthesis, not analysis!
Personally, I love vim, and have been using it for years and years, and feel hobbled without it, but if you're satisfied with your tool, and don't long for something better, stick with it.
Not at all. If VS suits your needs, then rock on!
Personally, I enjoy the occasional vi/vim story here, as in reading the comments I almost always come away with several new ways of doing things in vim.
I think there's a better question to be asked, however. Given that programming involves a seemingly endless stream of tools/techniques that seem good enough and alternatives that are promised to be much better, do you have an efficient strategy for determining which alternatives to explore? (This is a question I've been wrestling with myself recently.) How much time should be budgeting for exploring an alternative before writing it off as a time sink instead of productivity multiplier?
In your case, since you already use vi/vim daily for some editing tasks, I'd suggest a low time-investment strategy of lowering the slope of your learning curve: review how you normally use it, isolate one or two procedures that seem awkward or irritating, and then focus a small amount of time on researching/practicing the recommended alternative practices of experienced users. I've found that by focusing on the occasional experiment, learning is much more enjoyable. If I think about how much I don't know about vim, on the other hand, I'm inclined to feel overwhelmed and put off learning anything.
Admittedly, this approach isn't going to help if your resistance point is learning to dump the arrow keys and mouse. On that one, I don't know that there really is any good alternative to a couple of weeks of devoted effort.
Incidentally, in relation to your last paragraph, I don't see any advantage to vim's keyboard usage because I use a Kinesis Classic with a Dvorak layout. My arrow keys, home, end, page up, and page down are all within reach from home row. And of course, the Dvorak layout makes some vim shortcuts less intuitive. As for the mouse, I hardly touch it while coding.
I know it is hard to justify plonking down 2 weeks when your current methods work. For me it is the ability to type what I am thinking without having to reach for the mouse (I know in VS you could customize keyboard shortcuts exactly the way you want but somehow it seemed a lot more obvious in vim for me).
I've found Vim's text editing to be better than VS. For example, it's extremely to change a string - ci" - where in VS it's ctrl-leftarrow a few times then ctrl-shift-rightarrow a few times. In Vim it's much harder to compile things, no Intellisense, no refactoring, no decent equivalent to the Solution Explorer, and tons of other missing things. There's no doubt about it. A lot of these things are less useful when working in PHP, so Vim makes sense there.
Not believing the Vim hype is like wondering how anybody could be a Dallas Cowboys fan, which makes a lot of sense to people who grew up or live in Dallas. To people writing code where VS isn't available, there's more focus on editing letters which Vim lets you do more efficiently.
I'm curious, does anyone use Visual Studio for non-code editing? For example, I'm typing this in Vim right now. I use Vim for lots of meant-for-human-readers text.
In the past, I've used VS for editing PHP, which I then deployed to the server using a keyboard shortcut.
I understand what you're saying, but I want to point out that VS can be used as an editor even when the target platform isn't MS.
What I'm curious about, is it so good an editor that people commonly use it for general text editing for non-code text? I know Vim and Emacs gets used like that a lot, maybe Notepad too.
The startup time is too long for off-hand editing (I suppose this is hardware dependent). In that case, I'll open Notepad for quick to-do lists, or vi for non-line-ending-mangling tasks. It's pretty unusual for me not to have VS running, though.
I wouldn't start up a VS instance just to edit text, but if I have one running, it's my editor of choice.
Any full featured editor has so many commands, menus are not practical to display them. VS included. So you're either using just using a subset of VS' functionality, or use hotkeys in VS too.
I'm definitely using hotkeys very heavily in Visual Studio.
http://www.yr.no/place/Norway/Nord-Tr%C3%B8ndelag/Stj%C3%B8r...
As to copy/paste, does that depend on the platform? I use vim in a terminal on Linux and Ctl+Shft+C/Ctl+Shft+V on selected text works fine for clipboard transfers. I don't use vim on Windows often enough to remember how things work there, however, and the article that prompted this discussion was focused on Mac usage.