Live data from Hacker News

Ask HN: What is the most beautiful piece of code you've ever read?

news.ycombinator.com

1–10 of 394 posts

Re: Ask HN: What is the most beautiful piece of code you've ever read?

#3

https://github.com/achael/eht-imaging This python code was part of the imaging, analysis, and simulation software for radio interferometry that led to the historical first 'image' of a black hole.

What about the code did you find so striking? Any part in particular you recommend checking out?

Re: Ask HN: What is the most beautiful piece of code you've ever read?

#6
For me, the answer is - The code that never existed.

Not to sound cheeky but eliminating code, is a beautiful thing. Less code is easier to maintain, understand, and faster to run. So the less code you can achieve, the better overall the software will be.

Re: Ask HN: What is the most beautiful piece of code you've ever read?

#8
As a student in 2001, Tim Sweeney's template recursive inheritance was next level for me:https://www.flipcode.com/archives/Vector_Math_Quaternions.sh...

About 10 years later you would find this stuff everywhere in boost but for the time this was spectacularly elegant for C++

Re: Ask HN: What is the most beautiful piece of code you've ever read?

#9
It's a bit of a tricky question because you can have a beautiful snippet entangled in a mess of a codebase.

I think a much better question would be most beautifully structured codebase.

Code, as a snippet, or line, is constantly struggling between poetic conciseness and verbose clarity... To which I will always pick clarity (for "the next guy"), hence not necessarily elegant.

Post reply on HN