Live data from Hacker News

Ask HN: Do you ever go back and admire a piece of code you wrote?

news.ycombinator.com

101–110 of 267 posts

Re: Ask HN: Do you ever go back and admire a piece of code you wrote?

#103

Programming isn't unique in allowing you swing between moods of "this feels great :D" and "I'm so dumb". (I think most people feel like either at times, even hours apart). But Fred Brooks makes a good point with: """The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexib…

When I started my first programming job the CEO told me that programming is 59 minutes of feeling like an idiot and 1 minute of feeling like a genius. It's really stuck with me, and has so far proven true.

59:1 is pretty good. Sometimes debugging gets me really down

Re: Ask HN: Do you ever go back and admire a piece of code you wrote?

#105

All the time. The old joke is about us looking at code we wrote six months ago, and being horrified at what we see. And I've had more than my share of that. But what's ALSO happened, many times, is I look at old code I wrote... and I'm IMPRESSED. Just blown away by the beautiful elegance and power of the abstractions I came up with, the sheer intelligence of the approach, the insight and lucidity oozing from the code…

I have lived to see both ends of the spectrum from "who wrote this, it's awful" and "wow, who wrote this it's beautiful"

I wish I could see over time that the latter takes precedence, but I'm just happy these days that the majority most falls somewhere in in the midpoint between both extremes.

Re: Ask HN: Do you ever go back and admire a piece of code you wrote?

#107

All the time. The old joke is about us looking at code we wrote six months ago, and being horrified at what we see. And I've had more than my share of that. But what's ALSO happened, many times, is I look at old code I wrote... and I'm IMPRESSED. Just blown away by the beautiful elegance and power of the abstractions I came up with, the sheer intelligence of the approach, the insight and lucidity oozing from the code…

Me writing docstrings: God this is so much work for nothing... my code should speak for itself. Me 6 months later: Thank god I wrote docstrings, what is this garbled mess.

I always advise juniors to document their code because they never know, next maintenance programmer to touch it might be themselves. I can't remember why I wrote code a week ago, let alone 6 months.

Re: Ask HN: Do you ever go back and admire a piece of code you wrote?

#108
post #90
post #67

Earlier quoted context omitted.

It's unfortunate that the younger generation of coders took "comments are code smell" idealogy to heart and are actively against writing comments.

Too many comments explain what is going on. That should be obvious from well-written code. But comments why it's done that way can be extremely valuable. And sometimes there is indeed something wrong with the code. In those cases, a comment saying so can save a lot of time analyzing what's wrong with the code.

I came to write basically this exact thing FWIW. Always write the why, not the what. It's the clear difference between useful comments and excess noise.

Re: Ask HN: Do you ever go back and admire a piece of code you wrote?

#109
> Are there analogous feelings in other creative pursuits you practice?

Not exactly a “creative pursuit” but often with legal work it takes years for any sort of feedback on a document’s effectiveness. Sometimes you’re alerted to a potential issue and your first thought is “yikes, there’s no way I drafted for that”. Much like coding it’s always a good feeling when you go back and see that you had contemplated the weird scenario and drafted accordingly.

I’ll admit it feels a bit more “magical” when it happens in my code though. I think perhaps because the stakes are lower so I can appreciate the work instead of feeling like I’ve dodged a bullet.

Re: Ask HN: Do you ever go back and admire a piece of code you wrote?

#110

Programming isn't unique in allowing you swing between moods of "this feels great :D" and "I'm so dumb". (I think most people feel like either at times, even hours apart). But Fred Brooks makes a good point with: """The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexib…

When I started my first programming job the CEO told me that programming is 59 minutes of feeling like an idiot and 1 minute of feeling like a genius. It's really stuck with me, and has so far proven true.

What's awful are those bad days when it's actually hours and hours of feeling like an idiot, draining you away, and then when you figure it out you still feel like an idiot because first off it was so simple and second of all solving something in minutes is not going to wash away hours of feeling like an idiot.

Luckily as I have gotten older I have gotten fewer and fewer of those days.

Post reply on HN