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

>clever code isn't usually good code. Clarity trumps all other concerns.

this is a good one to pick up early. Looking forward to my 20 in dev.




I will write “clever” code to put constraints on the code. Clever code is hard to change and read, which is sometimes what you actually want. Sometimes you actually want anyone who wants to change a bit of complex logic to fully understand what they are changing before making that change. IOW, the cleverness is there for a reason.


Code might be useful way after original constraints / platforms / compilers / requirements / reasons / etc are long gone.

If you have a tradeoff between something today and clarity you might thank yourself later that you didn't went for it and kept code amenable to change. Or as with any tradeoff you can be right going for that cleverness.

I have learned that I want to err on clarity side not on cleverness side but ymmv.


Yeah, I agree with that. Knowing when to break the rules and having reviewers agree with it is def a very rare thing. I think I’ve done this only a handful of times in the last 20 or so years.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: