Giter VIP home page Giter VIP logo

awesome-code-reading's Introduction

Awesome Code Reading

Awesome

How does an open source project work internally? The answer is in the codeTM.

  • Our mission is to promote source code reading for knowledge gaining. We identify high-quality open source projects that are suitable to read. We try to answer questions like: What are the best projects to read? How to get started reading a project?
  • Each project links to a Github issue for discussion and upvote. Please ๐Ÿ‘ for the projects you like.

Projects

Contributing

Pull requests are highly appreciated. Please read contributing guidelines.

awesome-code-reading's People

Contributors

lucasleecr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

awesome-code-reading's Issues

Pure

Link to the codebase

https://github.com/pure-css/pure

Which release/version did you read?

1.0.0 (https://github.com/pure-css/pure/releases/tag/v1.0.0)

Why it is a good project to read?

  • CSS framework created by Yahoo.
  • Not bloated - all CSS, no Javascript.
  • Can be read in a short amount of time.

Starting point

src/base/css/base.css (https://github.com/pure-css/pure/blob/v1.0.0/src/base/css/base.css)

Reading order

Components are fairly independent so any order should be fine.

Interesting parts

Implementation for typical CSS components like forms, grid system, buttons etc.

Any parts should be skipped?

No, nothing too difficult.

Other tips

Get the homepage up and running is helpful to see how the styles are used. https://github.com/pure-css/pure-site

Links and resources

Preview of the styles https://purecss.io/

Contributor

@lucasleecr

Sinatra

Link to the codebase

https://github.com/sinatra/sinatra

Which release/version did you read?

2.0.0 (https://github.com/sinatra/sinatra/releases/tag/v2.0.0)

Why it is a good project to read?

  • Classic ruby based web framework. Large user base.

Starting point

lib/sinatra/main.rb (https://github.com/sinatra/sinatra/blob/v2.0.0/lib/sinatra/main.rb)

Reading order

main.rb (for stand-alone application)
base.rb (for sub-classing)

Interesting parts

  • Integration with rack and its plugins
  • Integration with template engines

Any parts should be skipped?

No

Any other tips?

  • Create a demo Sinatra application, set debuggers in the Sinatra library, and step through the code.
  • Learn rack https://github.com/rack/rack, which is more lower-level
  • Sinatra documentation is very good. Make sure you read it.

Links and resources

Contributor

@lucasleecr

Milligram

Link to the codebase

https://github.com/milligram/milligram/

Which release/version did you read?

1.3.0 (https://github.com/milligram/milligram/releases/tag/v1.3.0)

Why it is a good project to read?

  • Small CSS framework. No Javascript.

Starting point

src/milligram.sass (https://github.com/milligram/milligram/blob/v1.3.0/src/milligram.sass)

Reading order

Any order is ok.

Interesting parts

Common CSS components.

Any parts should be skipped?

No.

Any other tips?

Links and resources

Contributor

@lucasleecr

Spectrum

Link to the codebase

https://github.com/withspectrum/spectrum

Which release/version did you read?

The latest

Why it is a good project to read?

It's a complete project with lots of contributors. I like it for various reasons:

  • It's written in JavaScript which needs quite a few decisions in order to create a maintainable and extensible codebase. They have everything sorted out though, the linter, the test suite, the type system, etc.
  • It's a monorepo which I love working on one rather than on many many different repositories.
  • It uses async workers to delegate tasks to other services. The separation of concerns is very good and they have avoided bloating the backbone from the get-go.

Memberlist

Link to the codebase

https://github.com/hashicorp/memberlist/

Which release/version did you read?

Commit hashicorp/memberlist@bfc6c88. The project doesn't do releases too often.

Why it is a good project to read?

  • Membership in distributed systems. Re-useable in other projects.
  • memberlist is a building block for Serf, which is a building block for Consul.

Starting point

memberlist.go (https://github.com/hashicorp/memberlist/blob/bfc6c8886aaf7d2f180da4717014f54f73e307a6/memberlist.go)

Reading order

No specific order.

Interesting parts

  • The Delegate interface that can be used as hooks in the gossip layer.
  • Payload handling, including encrypted messages

Any parts should be skipped?

No.

Any other tips?

  • Read the tests. It helps to understand how interfaces are used. It also has end-to-end tests.

Links and resources

Contributor

@lucasleecr

SQLite

Link to the codebase

https://sqlite.org/src/dir?ci=tip

Which release/version did you read?

Latest release as of https://sqlite.org/src/vinfo?name=427e2c9d95a92308 (3.32.0)

Why is it a good project to read?

  • A full SQL database implemented in a relatively small number of lines of code
  • High quality fundamental data structure implementations like BTrees and hash tables
  • Good way to learn systems programming concepts and learn from a very high quality codebase in C

Starting point

sqlite.h.in

Reading order

  • Start with the "source code tour" here
  • sqlite.h.in and sqliteInt.h to understand how it all fits together
  • Basically follow the source code tour's suggestions
  • BTree implementation

Any parts should be skipped?

You don't need to understand the "amalgamation" code.

Links and resources

Pell

Link to the codebase

https://github.com/jaredreich/pell

Which release/version did you read?

1.0.4 (https://github.com/jaredreich/pell/releases/tag/v1.0.4)

Why it is a good project to read?

  • Simple WYSIWYG text editor without dependencies
  • Can be read quickly.

Starting point

Start with the demo where a new pell editor is initialized https://github.com/jaredreich/pell/blob/v1.0.4/demo.html#L47

Reading order

Shouldn't matter. Only 1 js file and 1 css file.

Interesting parts

The contenteditable browser Api.

Any parts should be skipped?

No.

Any other tips?

No.

Links and resources

Contributor

@lucasleecr

Bitcoin

Link to the codebase

https://github.com/bitcoin/bitcoin/

Which release/version did you read?

0.1.5. (https://github.com/bitcoin/bitcoin/releases/tag/v0.1.5)

Why it is a good project to read?

  • Written by Satoshi Nakamoto!
  • First implementation of blockchain. A lot of cryptocurrencies are forked from it.
  • Concise - only 9k lines of source files and 6k lines of header files.
  • Most of the code is still relevant today.

Starting point

ui.cpp (https://github.com/bitcoin/bitcoin/blob/v0.1.5/ui.cpp). This is where the initialization happens when a bitcoin application starts.

Reading order

  • Bitcoin address
  • Transaction
  • Mining
  • P2P network
  • Blockchain and consensus

Interesting parts

Almost everything. It was an innovation.

Any parts should be skipped?

  • Bitcoin features that were experimental. This includes: using IRC to find peer addresses (in irc.cpp and irc.h), marketplace/product/review (market.cpp and market.h), and sending bitcoins to an IP address. Code related to GUI.

Other tips

  • Just get started. Don't try to read a lot of theories about bitcoin before you start. The code is pretty clear. Only look up an unfamiliar concept when needed (like merkel tree).
  • Don't be afraid to skip code. For example, the algorithm to select the UTXO is very long but can be safely skipped https://github.com/bitcoin/bitcoin/blob/v0.1.5/main.cpp#L2440). Focus on the concept and workflow.
  • Don't try to compile the project because it's a very old release and requires old dependencies too.

Links and resources

Contributor

@lucasleecr

Tendermint

Link to the codebase

https://github.com/tendermint/tendermint

Which release/version did you read?

0.12.1 (https://github.com/tendermint/tendermint/releases/tag/v0.12.1)

Why it is a good project to read?

  • A full blockchain implementation in Go
  • Generic/stand-alone blockchain and consensus engine. Can be used to build custom blockchain applications through the abci interface (also part of the tendermint project).

Starting point

Reading order

  • Tendermint core cli
  • Abci cli
  • P2P network
  • Transaction, blockchain, consensus

Interesting parts

  • Blockchain and consensus
  • Abci interface

Any parts should be skipped?

  • Non core blockchain stuff.

Any other tips?

  • Read the documentation first to learn how the cli works.
  • Setup local tendermint core instances. Useful for setting debugger when get stuck.
  • Be prepared to invest a lot of time. It's a large project with many dependencies in separate repos. Focus on tendermint core and abci.

Links and resources

Contributor

@lucasleecr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.