frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

What is the most beautiful / highest quality code you've seen (or written)?

10•gooob•3h ago
literal shower-thought i had tonight as i was thinking about how at work we all don't like dealing with our helm charts because the syntax and structure ends up looking so ugly and it just feels wrong (not to mention the multiple different approaches of handling kubernetes resources in multiple different pipelines.

i try to see beyond any initial repulsion to weird looking code because i know that it may be super functional. but it got me thinking: what makes code beautiful? what makes code "high quality"? (other than that it results in a working, performant, and robust software program obviously).

so i'm curious -- can you show me the best code you've encountered? it can be a small snippet or it can be a "slice of a library" or an architecture etc. have you written anything yourself that you are super proud of?

Comments

jamiejquinn•2h ago
One recent HN post I loved recently was on Arthur Whitney's insanely terse C code[0]. I personally find it beautiful, and many others did, but many did not. So it goes.

[0]: https://news.ycombinator.com/item?id=45800777

thisoneisreal•2h ago
The best system I ever worked with looked incredibly simple. Small, clear functions. Lots of "set a few variables, run some if statements." Incredibly unassuming, humble code. But it handled 10s of millions of transactions per day elegantly and correctly. Every weird edge case or subtle concurrency bug or whatever else you could think of had been squeezed out of the system. Everything fit together like LEGO blocks, seamlessly coming together into a comprehensible, functional, performant system. I loved it. After years of accepting mediocre code as the cost of doing business, seeing this thing in a corporate environment inspired me to fall in love with software again and commit to always doing my best to write high quality code.

EDIT: I think what made that code so good is that there was absolutely nothing unnecessary in the whole system. Every variable, every function, every class was absolutely necessary to deliver the required functionality or to ensure some technical constraint was respected. Everything in that system belonged, and nothing didn't.

abc_lisper•36m ago
Was it written by one person?
drooby•1h ago
High quality ("beautiful") code is as simple AND legible as possible, while remaining logically correct. All must be present.

It is a balance. And legibility is a fuzzy attribute that depends on the intellectual capacity of the collective observer.

But, beauty is subjective.. some people think maximally terse code is beautiful so... shrug

vismit2000•1h ago
Pytudes by Peter Norvig: https://github.com/norvig/pytudes
efortis•56m ago
To me, Nginx. I remember seeing this file structure and saying: "ohh, that's how it should be done"

    src/os/win32/ngx_alloc.c
    src/os/unix/ngx_alloc.c
---

A few years later I stumbled upon this refactoring video by Uncle Bob and that was my second aha! moment.

https://web.archive.org/web/20150905163826/https://www.youtu...

---

Many people here recommend Redis as an inspiring example.

bilbo-b-baggins•2m ago
My personal best is probably the metaclass tree formation in HumbleDB.

Best I’ve seen is probably the Golang arm64 NEON asm implementation of maphash using AES before the 1.24 update.

What is the most beautiful / highest quality code you've seen (or written)?

10•gooob•3h ago•7 comments

Ask HN: What Are You Working On? (Nov 2025)

455•david927•5d ago•1335 comments

Ask HN: Is Computer Science still a good choice?

16•speedylight•14h ago•22 comments

Why isn't everyone using Cerebras?

3•tghack•7h ago•1 comments

Ask HN: Interviewing currently (or recently)? how have interviews changed?

3•akudha•7h ago•0 comments

Ask HN: How to learn concurrency?

35•shivajikobardan•1d ago•18 comments

Ask HN: Are Agents Just Hype?

4•spacemnstr42069•9h ago•5 comments

Ask HN: How do you handle logging and evaluation when training ML models?

3•calepayson•11h ago•1 comments

Ask HN: How common is banning Docker?

9•martypitt•17h ago•11 comments

Ask HN: Looking for a good course to learn proof assistant Lean 4

5•rabarbers•19h ago•1 comments

Ask HN: What's your solution to tech addiction?

4•asim•14h ago•9 comments

Ask HN: How does one stay motivated to grind through LeetCode?

84•blutoot•2d ago•103 comments

Ask HN: Could Microsoft replace its CEO with ChatGPT?

23•nothrowaways•2d ago•36 comments

Ask HN: How would you set up a child’s first Linux computer?

221•evolve2k•5d ago•296 comments

Ask HN: What metrics do you track in a Conversational Agent?

4•shubhamintech•20h ago•0 comments

The Lotus program analysis framework

2•cutelimination•1d ago•0 comments

Ask HN: Senior people, how did your career evolve?

80•Seb-C•3d ago•51 comments

Tell HN: X is opening any tweet link in a webview whether you press it or not

647•stillatit•1w ago•519 comments

Ask HN: My family business runs on a 1993-era text-based-UI (TUI). Anybody else?

316•urnicus•1w ago•308 comments

Ask HN: Who is hiring? (November 2025)

400•whoishiring•1w ago•580 comments

Ask HN: How do you get over the fear of sharing code?

74•sodokuwizard•5d ago•90 comments

Ask HN: What do you do while LLM is writing code

8•me551ah•1d ago•13 comments

Ask HN: Effective way to deal with mosquitoes?

19•simonebrunozzi•3d ago•34 comments

You've reached the end!