Live data from Hacker News

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

news.ycombinator.com

131–140 of 186 posts

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

#131
post #78

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

#132
post #78

I'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.

It was very sparse with any syntactic sugar or ways to shorten common operations. Now it's much better, especially if you eschew the 00s style of programming - with obligatory getters and AbstractSingletonProxyFactoryBeans.

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

#133

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

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?

#134
post #6

So 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.

> R - sf package is a clean example of functional OOP

Funny because I detest it because of how difficult it makes it to dig into and customise spatial data and visualisations at a low level like I am used to with the spatial packages it sort of supercedes

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

#135

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

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 object feel delightful (and a Godsend on big Java names).

I also strongly prefer the keyboard shortcut set JetBrains uses. Having to reach all the way up to my function keys for combo operations makes me sad; even when I use other IDEs I love using an Intellij keybinding when available to quickly jump in and be efficient.

But to your point, I also tend to use it on higher end workstations (i.e. minimum of 16GB RAM, local repo pulls on fast SSDs, tons of logical cores, etc.).

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

#136
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.

Try JetBrains Rider, and be sure you are using a recent flavor of dotnet. When I migrated past 4.x to 6 of the .Net ecosystem, it dramatically improved my ability to work and deploy in C# with their rather delightful build system.

For example, in the Monogame game library, you can build a self contained binary for Windows, Linux or MacOSX nearly effortlessly with just a single command line.

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

#137
post #78

I'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…

As much of a fan as I am of Java, I have to agree. There are some real bombshells in the library that can either make your coding life or debugging a prod service miserable (sometimes both). Other additions are great, but have hurt readability a bit (i.e. Java lambdas).

Checked exceptions get a bad rep, but I've frequently found taking advantage of their hierarchical nature can be beneficial to at least making them less bad to catch. When I work with languages that have no exception support at all, I sometimes even miss them.

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

#138

For C, I've really enjoyed reading the Ruby source code. There are good and bad spots, but overall especially if you know Ruby the language, the source is both entertaining and enlightening.

Is there a good guide that covers that codebase? I'm very familiar with Ruby but I've never dived into the C code and I'm not sure where to start.

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

#139

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://n…

Hmm, upon closer investigation the only one of these that holds up is:

https://news.ycombinator.com/item?id=13624926 (2017; 98 points; 67 comments)

I feel sure I'm missing a lot. This subject seems to come up every few months or so.

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

#140
post #136

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

Try JetBrains Rider, and be sure you are using a recent flavor of dotnet. When I migrated past 4.x to 6 of the .Net ecosystem, it dramatically improved my ability to work and deploy in C# with their rather delightful build system. For example, in the Monogame game library, you can build a self contained binary for Windows, Linux or MacOSX nearly effortlessly with just a single command line.

But these executables are quite huge, are they not?
Post reply on HN