Go and it’s standard library. ‘Elegant’ is pretty subjective, but it’s a treasure trove of learning how things work under the hood. I’ve learned loads about networking, compression, encryption and more by browsing through it, because the code is super easy to read and understand.
What makes it easy to read and understand though? I am seriously having a hard time figuring this out. People tout Go for this all the time, but I don't know of a single codebase in it that I think fits that description. When I look through them they look convoluted and just sort of messed up. Things like awkward error handling, dealing with null, capitalization for public/private, magic functions, and imports, and m…
Ask HN: What are some of the most elegant codebases in your favorite language?
91–100 of 186 posts
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#92Earlier quoted context omitted.
To me, "anti-pattern" has the same bogus meaning as "clean code"
Although at a high level many of things things are subjective, this take is almost entirely wrong in every dimension. Anti-patterns are things like using a wrong data structure, using the wrong levels of abstractions, tightly coupling components so they are not composable, leaky interfaces, god objects doing too much The strict definitions of many of these can be subjective at the edges, but they all objectively exis…
What is a "wrong data structure"? Is it wrong to do linear scans when hash access would be sufficient?
> ... using the wrong levels of abstractions
When is the abstraction level wrong? I can name you at least 10 projects that avoid so called anti-patterns by introducing unecessary abstractions. Is something really an anti-pattern if it's "solution" massively reduces your development velocity but now everything is nicely composable?
In my opinion, anti-patterns are either obvious (constantly using different names for the same thing) or totally subjective to the context (when to repeat yourself).
But maybe I'm not able to put myself into the shoes of novices and a lot of things seem obvious to me. Granted.
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#93Golang Stdlib -> Golang
redis -> C
anything by armin ronacher -> Python
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#94I'd nominate Java itself. In the decades Java sources have been available, any of the kazillion junior programmers could debug-step into java.* and see exactly what's happening -- progressive disclosure at its finest for building expertise. Most other languages have a hard boundary, so the roots of language are a matter of conceptual documentation and experience. Java also offers that fly-over knowledge, but when pro…
After a decade of programming 50+ hours a week in many languages (typescript, javascript, python, scala, java, lua, bash, c++, etc), I have come to the conclusion that Java is simply the best. The tooling, libraries, stability, verbose rigidity. It forces a style of programming that simply scales to more engineers better
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#95My own ( c# ). It's not opensource yet, monetizing it first. Full DDD, it was a refactor during COVID-19 for my ecommerce. It powers https://belgianbrewed.com Copy paste from: https://news.ycombinator.com/item?id=35257225 > But I believe the project is much cleaner and frankly better to understand than all other projects i've encountered for this size. I'm using DDD, so DDD knowledge is a requirement to navigate this…
Look at that subtle off-white coloring. The tasteful thickness of it. Oh, my God. It even has a watermark. Now lets see Paul Allen's screenshots of the directory structure of his codebase.
Ok, i get it.
Just a shame that while i gave a pretty clear technical description on the "why i think so".
Nobody of the downvoters actually cared to give a actual technical counter argument or even did a test with a technical question... Instead just a reply with a partial movie script...
Ugh.
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#96Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#97Quick demo:
https://www.youtube.com/watch?v=i0CwhEDAXB0
Repo:
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#98So many, I like reading how other people write code. R - sf package is a clean example of functional OOP Python - pytudes (Peter Norvig’s notebooks) Haskell - Elm compiler. I could mostly understand what’s going on even though I barely know any Haskell. Ruby - Sequel is really nice. Rust - Ripgrep Pretty much any F# codebase is super readable too.
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#99Anyone have any good clojure examples?