Live data from Hacker News

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

news.ycombinator.com

161–170 of 186 posts

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

#161
post #158

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…

Just took a glance and it looks interesting (first time reading Haskell) - thanks!.

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

#162
post #114

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

I think you just don’t realize when a given software is Java. I personally really like intellij, one might say it is “bloated” (though I hate that word), but that’s only because of indexing everything, not due to java itself.

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?

#163

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.

They limit the usable memory way too low by default — if you have RAM increase it to at least 2GB, but 4 may be even better and it will be snappy as hell.

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

#164

Earlier 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

It may be faster than.. visual studio.

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

#165

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.

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.

The ecosystem is certainly more mature than many smaller languages, but it is still in a different league than Java’s. Most of it is not too great copies of the corresponding Java library, often being made by Microsoft only, with plenty of paid options while in the java world all of it is open-source and free, while offering a much wider selection.

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?

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

My experience with languages is that people want more exotic languages as they gain experience, than they grow away from them and go back to pragmatic ones. I think Java strikes a great balance here, and while I also had a phase where I thought how much better Scala is for example, I can appreciate java much more nowadays and will default to it for most projects.

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

#167

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

Well, c++ is literally the most complex language, famously not even Stroustrup would say he knows the whole, so comparing go to that hardly makes it look good.

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

#168
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…

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.

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

#169
post #168

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

Unchecked exceptions are the better version of Result type.

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?

#170
post #155
post #135

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

I used VSCode for JS for a while, until a major refactor, the experience was awful and I switched to Intellij. I love it and never going back.
Post reply on HN