Live data from Hacker News

Ask HN: How do I become a faster programmer?

news.ycombinator.com

21–30 of 71 posts

Re: Ask HN: How do I become a faster programmer?

#21
1- Learn your tools inside out.

Find out which shortcuts would give you the best keystroke / time earned ratio.

2- Sharpen your skills inside out.

Truth is, to be very fast at something, you must have done it many times before. I don't believe one can be fast at problem solving if it's the first time.

Once you get the usual patterns squared, you can get quite fast at implementing them.

3- Write in a more functional fashion

This has a strong tendencies to reduce bugs and that's where massive time wasted can go.

4- Improve your understanding

Often slow speed is due to a lack of full understanding. Draw and redraw a problem on paper until you have a good grasp of the problem. Mix it with other concepts of real life (ie. arrays and stacks of dishes)

I think we were all slow before we were fast. Still there are many devs faster than me. That said, I think creatively faster than them. I think we all have our advantages/disadvantages based on the way that our brain is wired.

Re: Ask HN: How do I become a faster programmer?

#22
It is just like optimizing any piece of code. Log everything, identify hotspots and improve them.

1) Time yourself. Keep a little text file with timestamps and brief fragments of what is going on. Do this every time you have a mental context switch, start a new sub-goal, accomplish something or give up on an attempt. Usually I find myself logging something every 5-15 minutes.

1B) Documentation lookups should not be manually logged. Instead flush your browser history for the day before starting and then save out a copy of that when you are done programming.

2) Once finished, identify and eliminate time sinks. If you spent 15 minutes writing boilerplate, refactor that out for the next time you need it. If you spent 15 minutes looking for correct bit of previously refactored boilerplate, organize your archived code. Look at what parts of the documentation you visited the most and study them.

3) Always be trying new tools. There is no such thing as a silver bullet, but there are some pretty impressive special purpose alloys. While tedious, it is worth running previously-solved challenges though the new tools. (Subtract out the time spent just thinking during the old run to correct for the additional experience on re-running it.)

4) Practice! Find the smallest "unit of delivery" and deliver that as often as possible. For example if you do games, do game jams.

By following these I am now 60x faster for one subset of competitive programming (Mystery Hunt style puzzles).

Re: Ask HN: How do I become a faster programmer?

#23
If you want to write code faster - I have 3 letters for you - I D E. Learn your IDE, be it vim, textmate, IntelliJ or emacs.

I used to use textmate (w/ default plugins) for HTML, CSS, Javascript and Ruby. Now I discovered IntelliJ does stuff really fast and works.

IDEs/Editors have macros help you perform repeating work fast.

TextMate allows you to run shell commands inside the editor which is pretty useful. There are few for Ruby if you want to see output of an execution as a comment (see Avdi's screencasts).

There are shortcuts for performing tasks. In case your IDE does not provide, use the ones which your operating system supports. Example for Mac OS X - you can use Apple Scripts, Alfred, Keyboard Maestro etc.,).

Take time reading your IDE manual or help. Graphical UIs show tips and suggestions. console based provide tutorials when you open without arguments. With vi, use :help and follow the article. It takes months or even years to understand and learn your IDE.

Talking about downsides, once you start using your IDE a lot, you will learn about the downsides like 'pinky finger problem on emacs' (Google for this), and then you'll realize you have to customize your IDE. Note: These are good to have problems because you realize you are advancing.

For HTML, ZenCoding as a plugin came out 3-4 years ago where you can use div.container>div.hello+div.details>span>a*3 (on tab) will expand and give you html.

StackOverflow has lots of answers and details on discovery of productivity tools.

Re: Ask HN: How do I become a faster programmer?

#24
Faster writing code. I have 3 letters for you - I D E. Learn your IDE, be it vim, textmate, IntelliJ or emacs.

I used to use textmate (w/ default plugins) for HTML, CSS, Javascript and Ruby. Now I discovered IntelliJ does stuff really fast and works.

IDEs/Editors have macros help you perform repeating work fast.

TextMate allows you to run shell commands inside the editor which is pretty useful. There are few for Ruby if you want to see output of an execution as a comment (see Avdi's screencasts).

Re: Ask HN: How do I become a faster programmer?

#26

By first becoming a slower programmer. I know it sounds very zen-like, but when you give it some thought, you'd discover that most of your time is spent bug fixing. Worse for us embedded guys, as it's really easy to get into the build-download-run cycles and each takes much more time than a typical run cycle on a .NET environment, for example. Just realize that actual coding is the easy part, and concentrate on slowl…

I guess it depends on the seriousness of what you're doing. In programming normal, non-critical code, Python and exploratory programming will speed you up quite a bit.

But if most of your time is spent debugging, then taking your time is probably worth it. And use tools that makes a lot of bugs impossible: Use a memory-safe language with strong typing and concurrency abstractions that prevent data races etc.

If you're making a big system where remembering where everything is is half the job, a good IDE with solid auto-complete might help. I'm a big fan of MS Visual Studio, though it has limited programming language support. I've heard good things about Intellij too.

If most of the code will be written by someone else then you want an opinionated programming language that enforces a certain style, like Ada or Go.

Finally, if your problem has already been solved, don't solve it again. Use Erlang for distributed systems, Ada for critical systems, Esterel for extra-critical systems that can afford to be slow, etc.

Re: Ask HN: How do I become a faster programmer?

#29
Be aware that you might not want to be one. Being fast at something implies that you are really adept in it. I am mostly interested in stuff that's nontrivial to me, and, as a consequence, I'm not particularly fast in it. People tend to be very fast in modifying/changing their own code, but not everyone can/wants to do that.
Post reply on HN