Live data from Hacker News

Ask HN: What are the “best” codebases that you've encountered?

news.ycombinator.com

41–50 of 278 posts

Re: Ask HN: What are the “best” codebases that you've encountered?

#42

For a C codebase, Postgres[1] wins for me hands down. It's clean and suuuuuuper well commente, such that with a little context you can dive into something very complex and still get a feel for what is going on. [1]: https://github.com/postgres/postgres

Second this; Postgres codebase is what got me out of the "good code is self documenting" nonsense. For those of us in the database space it is an incredible resource - and overall a great example of good code. sqlite is much less complex, but similarly approachable. In more recent examples, I think you see a lot of this same reader-centric pragmatic ethos in many Go projects. The Kubernetes codebase comes to mind as…

/* don't even try to load if not enabled */ if (!jit_enabled) return false;

I still think comments like these are super redundant and annoying.

Re: Ask HN: What are the “best” codebases that you've encountered?

#43

I wish there was a way to read the codebase where there is a tag that tells you what the folder does. In github, rather than see what has changed, it would be interesting if there was a comment that told you what the folder contained. edit: Relevant here because the best codebase for me is one where I can understand the folder structure, but that is a sort of 0th order effect that should be equalized with some tool.

Java did this with package-info.java. It is underused, in my experience.

Re: Ask HN: What are the “best” codebases that you've encountered?

#44
Maybe I have a low-ish bar, but the Kodi Add-Ons in the official code base is a nice system of continuous integration with established acceptance and review procedures. I wrote a small add-on for a woodworking show and as soon as all the checks were passed and there was a final sign off, it was immediately available for installation on all platforms.

Re: Ask HN: What are the “best” codebases that you've encountered?

#45

For a C codebase, Postgres[1] wins for me hands down. It's clean and suuuuuuper well commente, such that with a little context you can dive into something very complex and still get a feel for what is going on. [1]: https://github.com/postgres/postgres

Second this; Postgres codebase is what got me out of the "good code is self documenting" nonsense. For those of us in the database space it is an incredible resource - and overall a great example of good code. sqlite is much less complex, but similarly approachable. In more recent examples, I think you see a lot of this same reader-centric pragmatic ethos in many Go projects. The Kubernetes codebase comes to mind as…

I think that beauty of OpenJDK concurrency mostly seems to come down to Doug Lea being a genius of concurrency.

Re: Ask HN: What are the “best” codebases that you've encountered?

#46

I wish there was a way to read the codebase where there is a tag that tells you what the folder does. In github, rather than see what has changed, it would be interesting if there was a comment that told you what the folder contained. edit: Relevant here because the best codebase for me is one where I can understand the folder structure, but that is a sort of 0th order effect that should be equalized with some tool.

In Go, a folder is a package and as soon as you write a comment before the `package foo` declaration, it's package documentation. And thus GoDoc automatically generates a nice webpage out of it.

See for example this package comment: https://github.com/golang/go/blob/master/src/net/http/doc.go...

Turns into this documentation (the beginning only): https://godoc.org/net/http

Out of the box.

Re: Ask HN: What are the “best” codebases that you've encountered?

#49
post #42

Earlier quoted context omitted.

Second this; Postgres codebase is what got me out of the "good code is self documenting" nonsense. For those of us in the database space it is an incredible resource - and overall a great example of good code. sqlite is much less complex, but similarly approachable. In more recent examples, I think you see a lot of this same reader-centric pragmatic ethos in many Go projects. The Kubernetes codebase comes to mind as…

/* don't even try to load if not enabled */ if (!jit_enabled) return false; I still think comments like these are super redundant and annoying.

Agreed, sounds like trying to convince that imperative code is an easy reading. But OK, for some people it may be.

Re: Ask HN: What are the “best” codebases that you've encountered?

#50
post #12

Because of ego, I'm going to plug my own (a Java parsing tool): https://github.com/norswap/autumn4 And hopefully I can some constructive criticism :) For something not from me but still in Java, the Proguard source code is very clean: https://sourceforge.net/p/proguard/code/ci/default/tree/

it reads like C , not like regular java all idioms are C like
Post reply on HN