Live data from Hacker News

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

news.ycombinator.com

41–50 of 267 posts

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

#42
post #32
post #20

Earlier quoted context omitted.

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

"cd ..." etc. worked in 4DOS, an alternative (and extended) DOS shell: https://en.wikipedia.org/wiki/4DOS .

I think it was standard DOS, from maybe DOS 5 upwards?

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

#43
I do sometimes go back and stare at this wonder I crafted once:

  s=>s[0]+/.*( .|z)|...s.s?|T..|M[i-t]+|[AFINOUW][^o]v?|.*/.exec(s)[0].slice(-1).toUpperCase()
It does something pretty useful, that has surely been written many times over. But unlikely ever as succinctly as this. :)

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

#45
post #12
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

I came across this gem recently: catch (Exception up) { throw up; } Truly genius code

  try
     ToastTheGenius;
  except
   On Glass: Exception do
     raise(Glass);
  end;

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

#46
post #40

One of my very first was Inna domain parking app, that it tried to "fertilize" any domain that was pointed to the server. It would obtain feeds piped via Yahoo feeds for keywords from the domain, and sell the domains later at higher price for the slightly better SEO value. I still love the domain parser I had there. I actively tried to avoid regex by the time, and I had a huge validator that brings tears to my eyes.…

I do hope you stopped doing this. Parked domains have frustrated me so often!

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

#47
post #42
post #32

Earlier quoted context omitted.

"cd ..." etc. worked in 4DOS, an alternative (and extended) DOS shell: https://en.wikipedia.org/wiki/4DOS .

I think it was standard DOS, from maybe DOS 5 upwards?

I was thinking it worked in MS DOS after some point, but I was remembering more like Windows 95 era. I don't think it worked in MS DOS 6.x, because IIRC that's when I was using 4DOS. However, it doesn't work in Windows 10 CMD.EXE.

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

#49

No, I mostly go back and surrender to not understanding why I wrote what I wrote. Yes, I am in awe. But because it's a like a third person wrote it. Regardless of comments.

Haha. I'm always proud of myself when I look at code that I don't understand, and I see some comment clarifying it and making obvious the reason why it couldn't be simpler and why I did something the way I did it. And then I'm like: "hey, you can trust yourself"

When that doesn't happen, I just spend the time to understand it again and add the comments. It eventually gets better.

Post reply on HN