Earlier quoted context omitted.
Have you tried C#? It looks a lot nicer to work with than Java.
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.
Ask HN: What are some of the most elegant codebases in your favorite language?
121–130 of 186 posts
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#122Working with Perl, two things spoiled me for other languages: JSON and DBI/DBD. In Perl, everything serializes to JSON without fuss. It can be "lossy"; objects without an explicit JSON serialization method and coderefs can't be deserialized, but serializations at least have placeholders for them. Compare to Python's json module, which doesn't try very hard to serialize things and throws exceptions every time it runs…
> Compare to Python's json module, which doesn't try very hard to serialize things and throws exceptions every time it runs across something new. It's very frustrating to use.
Sounds kinda backwards to me. I thought the fact that throwing exceptions (or "making a fuss," if you will) is better than silently producing incorrect (or "kinda lossy," if you will) results wasn't controversial anymore in 2023.
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#123https://news.ycombinator.com/item?id=33413124
https://news.ycombinator.com/item?id=32384769
https://news.ycombinator.com/item?id=25355171
https://news.ycombinator.com/item?id=15663980
https://news.ycombinator.com/item?id=18037613
https://news.ycombinator.com/item?id=14836013
https://news.ycombinator.com/item?id=34205294
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#124Earlier quoted context omitted.
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.
Have you tried Jetbrains stuff?
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?
#125Go 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.
Very satisfying to be able to say "nope, it's fine, here's the source".
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#126Earlier quoted context omitted.
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…
> Anti-patterns are things like using a wrong data structure 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" massivel…
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#127Everything is nicely documented and pretty easy to read.
It's a great companion if you want to learn more about how languages are implemented.
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#128Earlier quoted context omitted.
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…
> Anti-patterns are things like using a wrong data structure 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" massivel…
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#129Earlier quoted context omitted.
It’s the complete lack of magic. What you see in front of you is pretty much exactly what happens. You don’t have to keep a cathedral of language semantic subtleties in your head when reading someone else’s code.
Then why don’t we go back to assembly? There is even less magic there, every line is trivial to understand, isn’t it?
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#130Earlier quoted context omitted.
Have you tried C#? It looks a lot nicer to work with than Java.
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.