Hacker News new | ask | show | jobs
by bjourne 4619 days ago
I'd assert that if you're a great developer, then the code you write quickly is not worse than the code you write slowly. For every problem there is a perfect way to solve it, and every hack and other kind of ugliness your code acquires increases the distance of your code from the ideal one.

If you write code too fast it gets those imperfections because you are not yet good enough. But you are on your way to improve since you are able to reflect on your work and see how it can be better.

A good way to get better is to write code as slowly as possible. Take your time and focus on making every detail as good as you can. It will take time but as long as you do it slowly enough you will learn a lot. You will get better as your "slow and perfect" time improves and your brain adapts. You will improve much faster than in "fast and sloppy" mode which trains your brain to not mind the ugliness.

1 comments

I'd have to disagree there. No matter how good a developer you are, if you're in a rush, you're not going to output the same quality. There's always going to thousands of decisions in a programmers head where they could take time to make something more efficient. If time is the top priority, then well designed code isn't.

And for what it's worth, I don't think that code needs to be perfect. If you're testing out an idea, your code may just need to be good enough to test the idea. Then when the idea has been validated, you can worry about perfecting the code.

Well I disagree with you. :) Being in a rush almost by definition means that you have to perform faster than you're capable of. But the point is that you can push your limit on what "being in a rush" means by practicing. A few hours might be impossibly rushed for one programmer while it is ample time for another. Furthermore the more you train yourself on writing good code, the less of a speed advantage it is to write bad code.