Live data from Hacker News

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

news.ycombinator.com

11–20 of 267 posts

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

#13
I have a Notion database of code Snippets for this purpose.

Described this in a recent blog post: https://tkainrad.dev/posts/managing-my-personal-knowledge-ba...

It's nice to take a moment after finishing a project, a challenging task, or whenever you feel like it and preserve snippets that you are proud of. Going through these pieces of code later brings back memories of these past projects, teams, tasks,...

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

#15
post #2

I don't feel proud of my code if it works but I do feel terrible about it if it doesn't work perfectly. As soon as I realize that there is any problem in any of my projects, I need to drop everything and fix it immediately or else I can't sleep or think about anything else. I guess not being able to carry on with my life if I know that my code has the slightest issue means that I assume it is perfect and therefore I'…

Sounds like a perfect case of perfectionism.

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

#16
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 flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures....

Yet the program construct, unlike the poet's words, is real in the sense that it moves and works, producing visible outputs separate from the construct itself. […]

The magic of myth and legend has come true in our time. One types the correct incantation on a keyboard, and a display screen comes to life, showing things that never were nor could be."""

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

#19
I often return to things with reluctance, assuming massive technical debt, only to be pleasantly surprised (sometimes I am pleasantly offended!). I'll usually attempt a "haut-syntactica" refactor, only to fall back into the flow and elegance of the original work ... tho I definitely have a tendency towards over-engineering in the first instance.

On an aside, someone here mentioned that python 2 isn't python 3, in that the code itself gets old quick. But I don't think that really comes into it. Unless you're spaghetti-plugging holes in clients, there's a lot of joy to be had in manipulating any language or system to a desired end, especially when it's hard won, and I would think too when you return and see yourself in the result.

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

#20
post #11

The only thing I have ever gone back and admired is when I wrote the following snippet of code: long time; // no see

Hehe, well if we're going here there are various go-to shell commands / filenames / hostnames I inevitably end up using at some point just for the wry smile:

    $ PONG=1.1.1.1; ping $PONG
    $ more cowbell
    $ cat dog | tee hee
And my favourite choice of empty file:

    $ touch me
Also I was fairly please years ago when I briefly re-aliased cd to something that could do "the right thing" (TM):

    $ cd ...
    $ cd ..../src/
etc..
Post reply on HN