Live data from Hacker News

Ask HN: Where do I find good code to read?

news.ycombinator.com

1–10 of 216 posts

Re: Ask HN: Where do I find good code to read?

#2
Depends what good code is to you.

Good code is different depending on your sense of aesthetics, but also it's purpose.

Good code for an enterprise-life-blood type of system is terrible code for a "let's check if this is an idea" type of prototype (and vice versa).

For a relatively large and mature project, someone might suggest Linux, but it's a bit hardcore in my opinion. FFmpeg is actually really nice, and you can wrap your head around the general idea of how that system works, to the point where you can comfortably add new options and even introduce new codecs and containers in a few days.

Re: Ask HN: Where do I find good code to read?

#4
post #3

There was a HN thread months ago on this topic. I recall people suggesting well known github repo’s. I’m unsure which ones but you could start at github…

"Ask HN: What's the best source code you've read?" https://news.ycombinator.com/item?id=32793534

Re: Ask HN: Where do I find good code to read?

#7
The Elixir standard library is quite readable I’d say, but it all depends on what you’re interested in? I’d recommend learning Elixir as it’s immutable and a very simple language and does concurrency better than everything else (by inheriting from Erlang/OTP on which it is based) and the packages don’t seem to exhibit the needless churn that goes on in the world of JS, for example.

Re: Ask HN: Where do I find good code to read?

#9
Peter Norvig's Pytudes was recently posted here. I think that's some of the best code I've read, although they're only small problems and not a bigger project. Still very much worth a read, he goes through the whole problem solving through code process.

https://github.com/norvig/pytudes

Re: Ask HN: Where do I find good code to read?

#10
I find that reading books rather than code tends to be more helpful in terms of finding good takes on what clean code is -- more specifically books on refactoring or specific language-related features (like 'Effective Java' or 'Fluent Python'). The issue with just reading code is that many times - you'll miss out on why the author chose to use the expression or abstractions which they chose to use. Reading a book at least takes you through author's thought process. For an alternative - you could always browse repositories which contain notes on refactoring as well like this one (which does a good job summarizing some of the key principles from Fowler's book on refactoring):

https://github.com/HugoMatilla/Refactoring-Summary

Post reply on HN