News for hackers. Stuff that matters.

Ask HN: What is a good “My First Reader” for source code?

I am a hobbyist programmer; I have programmed a few very simple 2d games, a 3D texture mapped terrain renderer, and some other small utilities all in C for a bit of context. I am looking for some good, and frankly easy, very small projects to read for an idea how "real programmers" engineer software and to simply learn. I am not all that interested in fancy, tricky algorithms or anything, just coherent and well engineered (and easy to digest) software. Any ideas where to start?
( 8 comments | 10 points | on HN )
Re:Ask HN: What is a good “My First Reader” for source code? by lucaslee on Wednesday November 07, 2018 @10:29PM (#18404152)
This recent post has some recommendations for open sourced games [1].

Check out my project as well for some smaller projects suitable for reading [2]. I think we have the same ideas-finding smaller but good quality projects to read and learn. Feel free to connect (email in my bio).

[1] https://news.ycombinator.com/item?id=18293159 [2] https://github.com/CodeReaderMe/awesome-code-reading

Re:Ask HN: What is a good “My First Reader” for source code? by otras on Thursday November 08, 2018 @05:07PM (#18410490)
If you're interested in reading JavaScript, I put together a short reading list of JS libraries/codebases to read organized by size [0]. I highly recommend the small but powerful "JSON in JavaScript" and Redux, and as another comment mentioned, the Underscore source code is a great read as well.

[0]: https://github.com/AlexanderEllis/js-reading-list

Re:Ask HN: What is a good “My First Reader” for source code? by lucaslee on Friday November 09, 2018 @09:06PM (#18419539)
Great list! Did you personally read all of them?
Re:Ask HN: What is a good “My First Reader” for source code? by otras on Monday November 12, 2018 @03:34PM (#18435490)
Not yet! So far I've made it through the short codebases and many of the medium ones. I started a new job recently, and I've found that the ramping up period has sapped much of my "reading code outside of work" energy (as I have more than enough code to read at my day job).
Re:Ask HN: What is a good “My First Reader” for source code? by Jefro118 on Thursday November 08, 2018 @11:35AM (#18407467)
If you know or have interest in JavaScript, the Underscore annotated source code is good:https://underscorejs.org/docs/underscore.html
Re:Ask HN: What is a good “My First Reader” for source code? by rahimnathwani on Saturday November 10, 2018 @08:04AM (#18421159)
Re:Ask HN: What is a good “My First Reader” for source code? by tedmiston on Thursday November 08, 2018 @12:03PM (#18407748)
I'm not sure what My First Reader is but perhaps O'Reilly's cookbook series would fit what you're looking for?

They also have another sub-imprint, whose name is slipping my mind right now, focused on teaching technical topics very visually. The general layout of those books is very illustrated compared to typical technical books.

Re:Ask HN: What is a good “My First Reader” for source code? by cimmanom on Thursday November 08, 2018 @06:55PM (#18411155)
OP is probably referring to the types of books generally supplied to small children who are first learning how to read. They tend to be extremely short (no more than a few dozen words in the whole book); heavily illustrated; and use simple words and sentence structure.

By extension, I gather they’re looking for examples of well-engineered programs small and simple enough for a true beginner to thoroughly grok within a short period. Presumably something in a few hundred lines of code that avoids unnecessary indirection or cleverness.