Live data from Hacker News

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

news.ycombinator.com

21–30 of 186 posts

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

#21
post #2

Php and Laravel

Also Carbon. It makes working with dates and times (something which is by it's very nature a PITA) actually enjoyable and easily readable.

I also really appreciate FakerPHP for how easy it is to generate realistic fake values.

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

#23
post #7
post #4

Earlier quoted context omitted.

I`ve seen so many posts and comments about Laravel and how it has made PHP a modern choice for webdev. As someone who has written many small apps in PHP, I might dive into it and finally see what that Laravel thing is all about.

I'm currently using Laravel at work. It's very opinionated, and some folks say it uses anti-patterns with regards to its use of facades. That being said my last job was C#/.Net and I am so much more productive with Laravel. It really allows you to develop quickly and I haven't yet bitten by any of the "anti-patterns". If you give it a shot I'd recommend just using Laravel Sail as, if you already have docker installed…

> It's very opinionated

It is and it isn't. It does opinionated ways of doing things. But IMO what makes it so great is just how easy it is to opt out of the opinions you don't like. Facades are an excellent example of this: don't want to use them? Well, you don't have to (and IMO a really big app that may be a good choice - in a small app it likely won't matter and you might as well use them).

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

#24

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…

Look at that subtle off-white coloring. The tasteful thickness of it. Oh, my God. It even has a watermark.

Now lets see Paul Allen's screenshots of the directory structure of his codebase.

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

#26
post #14

Redis is a popular answer for C, and I agree.

I was going to say this too. C is more my "consistently appreciated" language than ever my favorite of the moment, but the Redis codebase is a fantastic example of it that's very easy to digest.

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

#29
post #12
post #9

Earlier quoted context omitted.

To me, "anti-pattern" has the same bogus meaning as "clean code"

That's an interesting take! I'm still early in my career and I ask with genuine curiosity, but why do you think "clean code" has a bogus meaning?

Not the OP, but clean code misses the point. Its is very subjective and depends on one person's previous experience and patterns they've been exposed to.

"Reasonably readable" is what I strive for nowadays, and a key aspect is that I no longer think there is an objective measure for it. It depends on the team/company you're in, and its important to keep in mind that the goal is to effectively communicate the program to them.

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

#30
What I find to be elegant in a codebase is where the chosen abstractions or seams that separate subdomains/concerns is well chosen that each is handled mostly in one place without a lot of ceremony or machinery. I would call these 'well factored' for factors which are domain-specific.

Each language has different ways that may lend itself as part of this shaping, but I like being able to think of this as something to look for when reading and strive for when writing, irrespective of the language at-hand.

Post reply on HN