So the best bits are probably the multipage comments that precede a handful of lines of code and explain what's going on :)
Ask HN: Do you ever go back and admire a piece of code you wrote?
61–70 of 267 posts
Re: Ask HN: Do you ever go back and admire a piece of code you wrote?
#62Often I'm sort of irked by my old code.
But it is telling that from time to time I find some old simple code that was easier to read / change than I expected if only because I coded it so simply and in an iterative sort of way.
There's something to be said for being simple...
Re: Ask HN: Do you ever go back and admire a piece of code you wrote?
#63Often I look at my older code and recognize the stage of development as a coder that I was in. It's usually not cringe-worthy but it makes me pensive about how I would handle it now.
Another joy is when I find out that a module I wrote is being used extensively by other developers. Just recently I found out that a small, single-purpose function I wrote for my specific needs and deployed to our shared library, is fundamental to another team. They asked me about modifying it for requirements they have. The code itself wasn't beautiful but it filled a need and could be understood well-enough to modify by another. It made me happy all day.
And yes, other creative pursuits give me the same joy. Some practice sessions on my drums seem effortless. My ideas seem to flow regardless of the technical difficulty. Likewise, some dinners I make are chef-level tasty and get the desired "yummmm" from my wife and daughter.
Keep a memory of the times when your code makes you smile. Those memories pull you through the down times.
Re: Ask HN: Do you ever go back and admire a piece of code you wrote?
#64I've only been coding for a few years now. Often I'm sort of irked by my old code. But it is telling that from time to time I find some old simple code that was easier to read / change than I expected if only because I coded it so simply and in an iterative sort of way. There's something to be said for being simple...
Re: Ask HN: Do you ever go back and admire a piece of code you wrote?
#65Re: Ask HN: Do you ever go back and admire a piece of code you wrote?
#66But I'll also comment on the opposite (which I attribute to continually trying to improve my craft). Often when I look at code I wrote >6 months ago, I find something that I'd do differently today. Sometimes it's downright distasteful!
Re: Ask HN: Do you ever go back and admire a piece of code you wrote?
#67What I like better is when you are bumbling through code you wrote a while ago trying to figure something out and there it is, a golden comment from past you, telling future you why you wrote shit this way. Usually it's some corner case or weirdness in an API you're calling.
Re: Ask HN: Do you ever go back and admire a piece of code you wrote?
#68Re: Ask HN: Do you ever go back and admire a piece of code you wrote?
#69C'est la vie.
Live. Learn. Adapt. Move on.