Live data from Hacker News

Ask HN: What are some of the most elegant codebases in your favorite language?

news.ycombinator.com

121–130 of 186 posts

Re: Ask HN: What are some of the most elegant codebases in your favorite language?

#121
post #105

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.

Interesting. Did you try Jetbrains Rider as an IDE?

Re: Ask HN: What are some of the most elegant codebases in your favorite language?

#122
post #35

Working 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…

> 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 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?

#123
Some past threads for dang to macroexpand:

https://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

https://news.ycombinator.com/item?id=13624926

https://news.ycombinator.com/item?id=16960300

Re: Ask HN: What are some of the most elegant codebases in your favorite language?

#124
post #114

Earlier 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?

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?

#125
post #5

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.

I remember with smug satisfaction a time that I was able to settle a pedantic argument from a so called "security expert" by pasting the code from the library function he was questioning.

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?

#126
post #15

Earlier 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…

[deleted]

Re: Ask HN: What are some of the most elegant codebases in your favorite language?

#128
post #15

Earlier 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…

[deleted]

Re: Ask HN: What are some of the most elegant codebases in your favorite language?

#129
post #69
post #67

Earlier 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?

[deleted]

Re: Ask HN: What are some of the most elegant codebases in your favorite language?

#130
post #105

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.

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.
Post reply on HN