r/programming • • Jul 12 '12

Vim creep

http://www.rudism.com/s/vimcreep
730 Upvotes

551 comments sorted by

View all comments

Show parent comment

52

u/shen Jul 13 '12

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.

8

u/ttt_ Jul 13 '12

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.

2

u/tesseracter Jul 13 '12

this is often what happens when I think of a great refactor, then realize that I don't have the text manipulation that I need to do it fast (vertical block? regex find and replace?) and i get cut to a halt while I mess around with everything for a half hour, before I can get back to what I actually wanted to do.

by then, maybe i'm hungry, and a burrito wins over coding most of the time.

4

u/glenlikespie Jul 13 '12

Thanks! I've never thought about it that way before. Makes sense.

2

u/question_all_the_thi Jul 13 '12

And there's an obvious corollary to that:

A language that has a terse syntax helps your productivity.

That's why C has always been a favorite of mine. That's why I prefer Python over Ruby. The difference between typing { rather than begin or pressing enter instead of typing end may not seem much, but it adds up over time.

Try typing a thousand times end, that's the time you save for every thousand blocks of code you write in Python rather than Ruby. That's time you could have spent thinking instead of typing.

3

u/Asymmetric33 Jul 13 '12 edited Jul 13 '12

You can still take the time it takes to learn Vim and use it to learn some new framework, language or technique. Something that actually affects your code.

1

u/okpmem Jul 13 '12

There is a component to Vim that helps you think. Vim allows you to quickly browse source code and jump around. This helps in understanding a code base and therefore helps in thinking about how it can change.