4 ms·
Keep in mind that part of what makes reading code beneficial is that it's not necessarily easy- in fact, it's often rather hard! The benefit is developing a set
by mhink 10y ago
Keep in mind that part of what makes reading code beneficial is that it's not necessarily easy- in fact, it's often rather hard! The benefit is developing a set of "mental heuristics" to figure out what parts of a codebase are useful, so that when you have to dig through someone else's code you can figure it out just a little bit faster.
That said, here are a couple suggestions. I'm not sure what you use other than C# (and Javascript?) so I'm just gonna link things from several languages.
redis-rb [1] is the 'official' Ruby client for redis. (For that matter, I've always heard that redis itself [2] is a good example of C code.) React's source [3] is rather difficult to figure out, but the team recently released a codebase overview [4] which might help. Alternatively, preact [5] is relatively straightforward, and IMO is a good example of structuring an ES6 codebase.
Rails [6] is ridiculously huge, and has established a bunch of its own conventions for file loading, but on the flip-side it is extremely well documented. To take a single bite of the elephant, take a look at its ActiveJob [7] sub-framework.
1: https://github.com/redis/redis-rb https://github.com/redis/redis-rb
2: https://github.com/antirez/redis https://github.com/antirez/redis
3: https://github.com/facebook/react https://github.com/facebook/react
4: https://facebook.github.io/react/contributing/codebase-overview.html https://facebook.github.io/react/contributing/codebase-overv...
5: https://github.com/developit/preact https://github.com/developit/preact
6: https://github.com/rails/rails https://github.com/rails/rails
7: https://github.com/rails/rails/tree/master/activejob https://github.com/rails/rails/tree/master/activejob
- twoquestions 10y agoThank you! I'll have to look at these later on! Still feels like stealing, but that's my problem :)
- yxhuvud 10y agoStolen knowledge is best knowledge. Then dazzle everyone with how smart you are! Oh, and don't be afraid to do git blame on some particularly hairy piece of code and see how it came to be. Often commit messages has a lot of information. If you are using Emacs, vc-region-history is pure gold, I don't know how to produce that view from the command line.
- yxhuvud 10y agoRails codebase tends to have a problem of only containing information about how something is supposed to be used and very little about how things fit together or why particular choices where made.