Hacker News new | past | comments | ask | show | jobs | submit login

Half an hour? When you're first writing the code, you should know immediately if you're going to need to repeat it and what the abstraction should be. If you don't, then don't waste your time. Later, if it turns out that you actually do need to repeat the code, it should be clear at that point what the abstraction should be.

Let the actual need for duplication guide you in finding abstractions, so you don't waste your time and produce difficult-to-follow code for no reason.




Like I wrote I avoid producing difficult to follow code.

I tend to start structuring parts of applications and algorithms on paper, and this half hour with paper and pencil helps a lot.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: