I really like Pandoc codebase [0]. It is a document converter written in Haskell. Reading it’s source code a decade ago was a turning point for me. Prior to that, I always felt an insurmountable gap between my toy codebases and real projects. All those open source software written in C++ etc. looked so unapproachable that I felt like I could not write production ready software. Pandoc however, was written in a langua…
Ask HN: What are some of the most elegant codebases in your favorite language?
161–170 of 186 posts
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#162Earlier quoted context omitted.
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
As an end user though, I honestly can’t think of any Java software I actually enjoy using. Minecraft? That’s literally the only thing that comes to mind.
On the server front many cloud infrastructures themselves, apple servers, pretty much every top 500 company has some form of business critical infrastructure chugging along on top of the JVM happily.
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#163Earlier quoted context omitted.
Have you tried Jetbrains stuff?
I have. Maybe I don’t have enough RAM for it, but I find their IDEs to be slow and laggy. Xcode and Visual Studio Code feel so much snappier on the same machine.
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#164Earlier quoted context omitted.
I have. Maybe I don’t have enough RAM for it, but I find their IDEs to be slow and laggy. Xcode and Visual Studio Code feel so much snappier on the same machine.
I find it very weird that Xcode is faster than... anything, really
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#165Earlier quoted context omitted.
The ecosystem is nowhere near as mature though. I don’t work with either anymore but back in 2017 I made the switch from C# to Java and it felt like a breath of fresh air when it came to the maturity and capability of JVM tooling compared to what’s available for .NET.
The dotnet ecosystem is incredibly mature. Its as old as java in most tooling cases, IDE, Language, Build System etc. The runtime is the newish part.
Also, you will find a java library for that random new tech you want to use, while it is likely missing for .NET.
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#166I'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…
Java was the language I used in university. While it may be well structured, I hated it as a junior level dev. There’s just so many unnecessary classes and abstractions to accomplish basic stuff. It makes sense in large applications with experienced developers, but it sucks to learn.
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#167Earlier quoted context omitted.
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…
(Opinions are my own) At my employer we use a subset of C++ and we use Go. We have a process by which when you write code others have to review it and you need to have a review by someone who is an "expert" [0] in the language [1]. You become an "expert" by being ordained by a shadowy committee who reviews code you submit to the code repository. They look for knowledge of the core language, how this language is used…
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#168I'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…
While I think there's a lot to love about Java, the standard library itself is not an especially great role model. Most of it was written a long time ago and has a fairly antiquated style - lots of mutable state, nullability, and checked exceptions. Not that the library isn't an incredible asset - it's luxuriously rich compared to working in Node.js - but if it were written from scratch today, I suspect it would look…
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#169Earlier quoted context omitted.
While I think there's a lot to love about Java, the standard library itself is not an especially great role model. Most of it was written a long time ago and has a fairly antiquated style - lots of mutable state, nullability, and checked exceptions. Not that the library isn't an incredible asset - it's luxuriously rich compared to working in Node.js - but if it were written from scratch today, I suspect it would look…
From your repo: Respectfully, I disagree that checked exceptions are a misfeature. Java’s implementation definitely leaves a lot to be desired (inheritance doesn’t make sense for them), but otherwise checked exceptions are a better form of Result types.
The problem with checked exceptions is that methods throwing them force its callers to react to the even if they are irrelevant to them. In 99% of cases I don't have any JSON specific error handling, yet Jackson forces me to do a try-catch-rethrow ceremony in thpse 99% to declare I don't want to do anything specific.
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#170Earlier quoted context omitted.
Take some time to learn the navigation and refactoring abilities of the JetBrains family. It is IMHO unmatched by most. Using almost any other IDE feels like a downgrade, especially on large codebases with complex dependencies. Beyond Java, they have excellent support for Python, C#, Go, Javascript, and more. The engine builds a deep understanding of your code, which can make ctrl-space to suggest a method on an obje…
Used JetBrains for more than 10 years, but got tired of it lagging all the time and using so much memory (even on M1 Pro with 32GB RAM, even on small projects). So I switched to VSCode for everything except Java. And I’m not a person who is easily annoyed I would say.