Hacker News new | ask | show | jobs
by ainzzorl 1822 days ago
> "There are so many projects on GitHub – pick one you like and see how they did it." But most successful projects are quite large; where do you start from?

I'm working on a slightly similar project motivated by this problem: how do you learn from established open-source projects - most interesting ones are too big, too complex, to hard to get started with.

So I'm compiling a collection of interesting code examples from open-source projects and explaining/annotating them. I'm trying to pick examples that are:

- Taken from popular, established open-source projects.

- Somewhat self-contained. They can be understood with little knowledge of the surrounding context.

- Small-ish. The can be understood in one sitting.

- Non-trivial.

- Instructive. They solve somewhat general problems, similar to what some other coders on some other projects could be facing.

- Good code, at least in my opinion.

I'm planning to share it in a few weeks.

6 comments

> > where do you start from?

My answer for this has been to scroll all the way through the git history of a repo structurally similar to something I want to do and read each of the first month-or-so of commits.

I cover The Architecture of Open Source Applications as well, here: https://death.andgravity.com/aosa :D
You blog about interesting things, subscribed :-D
Thank you!
This is very interesting to me. Do you have a blog or some other way of keeping track of this?
I started a repository for it: https://github.com/ainzzorl/goodcode. Please follow!

It's empty for now, but I included a few examples [1] of what I'm going to annotate and add there.

[1] https://github.com/ainzzorl/goodcode#examples

A project you may want to look into adding is Tern [0]. I've had a good time reading through the code over the past couple of weeks, and have found it to be at least not "bad" code, and pretty easy to understand.

Specifically how they are untarring each container layer and creating a chroot jail to run commands inside is fairly self-contained and interesting.

[0] https://github.com/tern-tools/tern

Why smallish? Small only teaches you tactics and not strategy. (in the sense architecture is most important for largish projects)
Gotta start somewhere.
Yes. I was thinking to start with smaller examples showing how they write code at <big project> without necessarily understanding the big picture, but bigger examples would be great too eventually. Something like http://aosabook.org/en/index.html already mentioned here.
That sounds great, would please notify me whenever it's up ? here's my email: mohammedi.haroun@gmail.com
+1 can you share a way to follow along?