Live data from Hacker News

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

news.ycombinator.com

81–90 of 186 posts

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

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

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

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

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

Yes. I have been burned by this in C#, it’s very frustrating.

you can step directly into System.* source as well...

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

#84
post #38

Earlier quoted context omitted.

Ruby, being a Perl-inspired language, has `.to_json` built in. You can do ```rb # hashes { foo: 'bar' }.to_json # numbers 28.to_json # anything really ['hello', 42, { lorem: "ipsum" }].to_json ```

That’s simply not true. This method is monkeypatched by json gem

JSON was added to Ruby stdlib in ruby-2.0.0 (2013), and has been a default gem since ruby-2.3.0 (2015).

This is pretty close to "built in", I think.

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

#85
post #19

My own ( c# ). It's not opensource yet, monetizing it first. Full DDD, it was a refactor during COVID-19 for my ecommerce. It powers https://belgianbrewed.com Copy paste from: https://news.ycombinator.com/item?id=35257225 > But I believe the project is much cleaner and frankly better to understand than all other projects i've encountered for this size. I'm using DDD, so DDD knowledge is a requirement to navigate this…

"I just finished reading the greatest script I've ever read in my life." - "Oh, really? Who wrote it?" "I did."

"What's the name of it?"

..."Lessons in humility"

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

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

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…

That’s because it is easy to use. Maybe you use too much python or Java but go was designed to specifically allow people to memorize the entire syntax, truly.

Want to make a function or variable or field public? Just capitalize it. That’s it.

Error handling? Check if the error isn’t nil and handle it, otherwise move on. No need for silly things like try except.

And there are no magic functions because everything is explicit.

Go is just simple and pleasant to use.

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

#87
post #75
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.

Pointer vs value receivers and named returns have so many gotchas that it is not even funny. Lack of magic my ass.

Can you name any? I have never seen a “gotcha” because it’s just explicit… it’s not like you are surprised by a pointer.

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

#88

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…

I love Go. I think it depends on what trajectory you followed to reach to Go or any other language. For me it was BASIC -> VB -> Java -> Python for some time -> Go How you feel about Go is how I feel about JavaScript

That’s because JavaScript is an awful language and I just don’t understand why people keep insisting on using it for everything. It even infected infra as code.

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

#89
post #13

For Lisp I would recommend Edi Weitz's CL-PPCRE: https://edicl.github.io/cl-ppcre/ Pretty much anything else from Edi Weitz is also great. Mezzano is quite elegant in my opinion, especially for an operating system. For example, this is the USB mass storage driver: https://github.com/froggey/Mezzano/blob/master/drivers/usb/m...

CL-PPCRE is great
Post reply on HN