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

You are supposed to hate your code.

If you don't hate it, you aren't trying hard enough.

I would not equate hating the code with the code being something to be ashamed of.

I hate every goddamn piece of code I write.



I'm always biased against my code as well. But man.. Software with a million downloads is something to be proud of. That's a lot of people getting use out of something you created.


One of my uni professors had a good maxim he has posted above his desk:

love the software, hate the code


I thought it was only me. But I periodically go back and stare at how beautiful some of my code is too.


I seem to have a 3 year window during which I hate the code and then I come back and think, "wow, that's pretty nice code, why don't I do code like that any more?". I think I spend a lot of time obsessing over small warts and it takes time for those to recede into the background where they belong.


I hate my code but usually I hate other's code even more. What makes me think my code is not so horrible is when two days after my commit I check commits from my teams on it, and I see their updates nicely integrating the logic I built, proving they understood easily how it is working.

The more I code, the more I do it for other people getting behind, and also the more I "flatten" the code. By that I mean:

- Remove recursions

- Remove pretty hacks

- Split dense logic (one line = one thing)

- Replace comments by properly named function calls

- Factorize everything that is happening more than thrice

- Linearize sequences of steps

- Remove nice to have just in case, but never used function parameters

- etc.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: