Live data from Hacker News

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

news.ycombinator.com

131–140 of 267 posts

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

#131
Perl code mostly. I rarely use Perl anymore and my current code is much more straightforward and maintainable that the Perl stuff I wrote but wow was some of it elegant and clever. I enjoyed writing lots of it which isn't something I experience much anymore.

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

#132

Earlier quoted context omitted.

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.

I learn to accept when I am tired and need to take a break. Sometimes hours of needling through code can be solved in minutes on a fresh brain. I used to be stubborn and wouldn’t stop until I had made some progress and that went on making a tired day into an exercise in frustration. Took a while to have the confidence to shut down and start fresh the next day.

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

#133

I'm a fan of my recursion scheme examples :p For the most part my standards get higher as time goes on though. So only small things!

Ive been toying with Racket and found myself admirig scheeme and recursion in general. It is so simple and yet so elegant.

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

#134
My first ‘real’ program. Written in VB6 in 2005. It connected to a state message switch using dmpp2020 protocol. It function was to run drivers license numbers and return a photo for Police Officers. It had two components- a back end that connected to the state and a web based front end. They were connected through a sql server. The front end wrote a request to a table and the back end monitored that table. The response from the state was then returned into another table. It was used by a couple of agencies including our 911 center. This was necessary as binary objects were a new thing at the time and neither our CAD or RMS system could do anything except plain text. So the subject of this - do you ever go back and admire your code - in this case I go back and wonder how it ever managed to function lol. Seriously. In reality though my admiration was in how rock solid it was. It’s last use :( was in 2017 so it was in service for 12 years and during that time it crashed literally never. I can’t say the same for the our other interfaces to the same message switch. So thanks HN for the opportunity to remember that!

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

#135

I don't code, but I do write. I regularly re-read my own writing to spot any problems, but sometimes just for pleasure. For example, about 18 months ago I wrote a 5 part series on how to build a direct conversion receiver for the ham radio bands from scratch. I learned tons along the way and it was really rewarding to write. Re-reading it recaptures some of that joy and reminds me that I'm a good writer, even when I…

If it captures you back then yes, your writing is so good that it doesn’t get in the way, you don’t even notice it. I am not a natural writer and have to always make an effort to make something sound the way I want to. Quite often I cringe at my old scribblings and that sometimes without a reason..

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

#136
post #122

Everyone's talking about code, but I do this with carpentry. Right now, I'm working as a trim carpenter in residential construction, and I pride myself on doing as good a job as I can. As a result, when I come back to a job to install door hardware after everything is painted, I sometimes just wander around the house and admire my work. Especially tricky details that took a bit of thinking to get right, even if no-on…

I do this with almost everything I make. The act of creating is an act of achieving an aesthetic you developed in your mind's eye, so it seems reasonable to want to spend some time admiring that aesthetic once achieved.

The thing I can't get over, is that I know a lot of successfull, highly paid programmers who don't care about code at all. It's sad (to me) that they get rich, while not caring about their code.

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

#137

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 once wrote a stored procedure that did something that has now been built into most databases. I didn't write the original code, I just modified the code to use the information schema. It took me two days to understand the original code and two days to make my changes. For a few years after I wrote that code I got emails from random people asking me questions about it and I sadly could not help them.

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

#139

What 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.

I always write // XXX comments that mean there's something here I'm supposed to remember but I don't have the time to write it down right now. It's always fun going back over those and trying to reverse engineer what the hell I was thinking at the time.

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

#140

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 am never impressed by my own style, but I do forget very quickly all the corner cases that the code had to deal with, so I am always impressed that “that guy” thought about those details that are completely outside of my radar!
Post reply on HN