Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I find that almost all coders can recognise clean code but many fail to produce it.

I think partly it's down to the "if it ain't broke don't fix it" mentality - once it's working there's a temptation to leave it as is and move on to the next task, especially if you're under time pressure.

In fact the time just after you've got it working is the time you have maximum knowledge about the code and the problem it solves, so that's the best time to refactor. Even something as simple as renaming variables and functions to be consistent and reflect what they actually do (rather than what you thought they would do when to started) can make a huge difference.



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

Search: