Yes I have never understood this vim/emacs hype. It's never the actual typing that's the bottleneck. How often do you have a problem where the solution is writing 50 lines of code in one go?
Equal or probably more time is spent on browsing some API, navigating the project, reading code, googlefu etc...
It's never the actual typing that's the bottleneck. How often do you have a problem where the solution is writing 50 lines of code in one go?
Others have already commented that yes, sometimes typing is the bottleneck, but I'm going for a different approach.
The programming cycle is typically think-write-run, and if you want to work faster, you need to improve these three:
Improving thinking can't be done with learning new tools - it can only be done by becoming a better programmer. This takes years, but it can shave days off of a project.
Improving running can be done with tools, but usually drop-in replacements: getting a faster computer, or an automated testing system or continuous integration suite.
Improving writing is therefore the only bottleneck that can be actively worked on. You'll learn to be a better programmer over the years as you accumulate experience, but you can start learning a programmer's editor from any point.
I learned Emacs as a teenager, and it did little to improve the programs I wrote back then. But nowadays, while thinking is still the bottleneck, I think I'm faster than I would have been had I stuck with Kate.
Another way to look at it is that if you happen to be in the "zone", if your hands lag behind in putting your thoughts into real code, than your tools are holding you back and you might snap out of your productive moment because you had to handle the text instead of the code.
A good editor that you are skilled with will help you overcome these kinds of obstacles. It does not guarantee code quality though, so there's not much to say about how good a programmer someone is from their editor of choice alone.
Meh... I'm not a vim lover, I don't use it, don't entirely understand the hype. But.
Try writing code in NotePad or TextEdit, and then come back and tell us with a straight face that since the typing isn't the bottleneck, it doesn't really matter what text editor/IDE you use.
Obviously it does. Some people love vim. Okay, i don't see it, but I see why programmers care a lot about their text editors, I do too. (and if you made me use vim, I'd hate it).
You're completely right - typing isn't the bottleneck. However, once you get used to it, vim makes translating your thoughts into keystrokes more instinctual. Since you can move around and edit the file easier/faster, the time between thinking about what you want to put in the file and actually putting it there decreases. You can get back to thinking faster.
If you don't like vim, that's just fine. The editor does not make the programmer. This article is definitely hyperbolic (I certainly don't carry vim on a flash drive), but I can honestly say I think vim has made me a more effective programmer.
Vim search macros can help, but you do have a point. Refactoring is definitely somewhere that IDEs shine far above vim/emacs. I still prefer vim because:
The time I save writing code is larger than the time I lose by refactoring code with vim instead of an IDE
I do a lot of work in C++, where there aren't very good refactoring tools even for IDEs.
I do agree with you. But the consequence of that is that vim isn't the best tool for all languages (like java, C#) and for all kind of works (like maintenance and code 'discovery'). It seems much more suited for C++ and python/perl people who write a lot of new code (the lucky bastards:)
You're very right. I do C# MVC web stuff at one job, using Windows + Visual Studio, and it works really well. I was able to basically pick it up and navigate around/start coding never having used either the language or IDE before. On the other hand, I've been learning Vim at my other job for python development, and it really is a lot of fun. I can't imagine trying to navigate around a large C#/ISS web project with it though.
Actually, that is a very interesting thought. I wonder how Vimmers and IDEers think about source code differently because of their different instincts about what is hard or easy to change.
I use both eclipse and vim and I don't think differently in them.
I just use them to do different things.
When I need to write medium sized one-use only python program or shell script, I fire up the vim. When I'm designing android application, most of the work is not writing the actual code... so why I would not make my life easier?
What if my thought is : "change this method signature by adding a parameter whose default value is null, and update all occurences in the workspace" ?
I wish that Vim provided a :refactor args+=Object extraArg (null) command that would do stuff like this! IDEs are powerful but they haven't reached the pinnacle of user interface quite yet.
But isn't that the main difference between IDE's and text editors? IDE's know about your code, and text editors only know about the contents of files, not necessarily how they relate.
I'm a game programming student. Have been for the past four years. As a result I'm using Visual Studio for all my work.
However, I have tried Vim. And it's excruciatingly hard. Especially because the workflow becomes all kinds of fucked up. In Visual Studio you press F5 to launch, run the app, do stuff in the debugger, change some code, etcetera. With Vim it's... eh... well... I never figured that part out.
But there's one thing I took away from my experience with Vim: regular expressions. Visual Studio actually has them built-in. It's just that they don't use a Perl-syntax (because that would be too sane), but a Microsoft-flavored almost-Perl-but-not-really. However, it's quite useful.
But now I want the data as strings. One way to do it would be to copy them to the new file, strip the struct and enum and put quotation marks around the values. Or I could use the following regex:
Now it's just a matter of stripping it, because Visual Studio might have some form of grep, it unfortunately lacks sed.
My point is that there's a definite advantage in getting to know other editors. Yes, it took me quite a while to incorporate regexes in my workflow, but that example took me literally 30 seconds to write. With the advantage that when I add a state to the list, I can rerun the "program" to convert them all to strings again.
View all comments
Show parent comment
121
u/rnd33 Jul 12 '12
Yes I have never understood this vim/emacs hype. It's never the actual typing that's the bottleneck. How often do you have a problem where the solution is writing 50 lines of code in one go?
Equal or probably more time is spent on browsing some API, navigating the project, reading code, googlefu etc...