Live data from Hacker News

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

news.ycombinator.com

211–216 of 216 posts

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

#211
What do you want to build? It's much easier to find code to read, and motivation to read it, when you have a goal to work towards. For example, when writing an interpreter, I read code for various interpreters. Looking at a variety of projects from different people gave me a lot of ideas and examples of different approaches to solving the same problem.

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

#212

There was a blog post from Peter Seibel recently called [Code Is Not Literature)]( https://gigamonkeys.com/code-reading/ ) which pointed out that although everyone seems to agree reading code is great, very few tend to do it regularly. I feel like I get a lot more out of messing with / hacking on code than I do from reading it. I'm sure people vary, but I've got loads more out of open source contributions to sometime…

> You'll only really know if it's good code (or why) after you start trying to change it. I like this and it is true. In addition, I have found that good code also tends to survive refractors despite having the quality of being easy to change. The Ask HN post specifically mentioned good code but what follows are some (of my subjective) thoughts about the benefits of reading bad code. Bad code is haphazard and varied…

Good point on the benefits of reading bad code. One of the best developers I've worked with said he'd become a good developer by refactoring a lot of bad code.

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

#213
Read source code from projects that used by wide range of people. Some tiny repository might look nice at first sight, but it could be a result of limited scope, and production codebase always involves a large range of scope.

Even if there're some caveats/hacks in these codebase, it might have a valid cause and you can learn something from how it evolved or how it (dirtily or gracefully) solves the issue.

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

#214

As many have already said, what you'd consider "good code" depends on what you want to learn and achieve, but here are a few recommendations: 1. Busybox. It's basically a collection of common Unix utilities, from common commands like ls or cat, to system daemons like crond and init. It's a good way to learn more about how Linux and other Unix-based systems work under the hood. Busybox applets are pretty independent f…

Thanks for reminding me of reading busybox's source code. You can learn a lot from learning how bash utils implemented, but it's really a headache to understand which tools from which package/git repo, busybox is a good enough and battle-tested collection for all of this.

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

#215
Like with restaurants — check the bath, if it's good and clean, the restaurant is most likely to be good.

Look where good tech documentation lives.

Flutter is one good example of great docs. Ruby on rails is an anti example (even though the framework itself is great for its goal).

Post reply on HN