Anyone have any good clojure examples?
Ask HN: What are some of the most elegant codebases in your favorite language?
81–90 of 186 posts
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#82I'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…
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#83I'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.
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#84Earlier 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
This is pretty close to "built in", I think.
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#85My 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."
..."Lessons in humility"
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#86Go 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…
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?
#87Earlier 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.
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#88Earlier 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
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#89For 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...
Re: Ask HN: What are some of the most elegant codebases in your favorite language?
#90Envoy proxy for C++