In my opinion, the best way to learn something new in programming is to study Comits in public repositories.
Here you have the utmost practicality, best practices, great variety and so on. There is only one unpleasant moment - not every change to the repository can be considered instructive or at least as informative.
Moreover, it is almost never possible to restore the full context in which a change appeared - only the author himself can know it. Is it possible in such conditions to pull out the crumbs of useful information?
So, once again I will formulate the initial position:
- We have a set of komitov in different public repositories
- The context that gave rise to the changes contained in committees is not known.
- This set of komit contains those that carry wisdom or are simply interesting.
The question arises, how to separate the "flies from cutlets" - can we select from the general heap those changes that will be useful to us? The first thought that comes to mind is to come up with a rule according to which to rank the incoming comites and select from them the “best” (those that better comply with the fictitious rule). This very rule, of course, cannot be one - it is too simple) Most likely, it should be a set of smaller rules that limit certain parameters. For example:
')
- Size change. Hardly anyone will read huge comets in thousands of lines
- Matching programming language. For each repository there is a main programming language, and all the main code is written on it. But there is also a bunch of accompanying files (scripts for automation, configuration files, documentation), which are also subject to change. Of course, they are of no particular interest without context.
- The attitude of the author to the change. This is the only thing that can be pulled out of context - no one can appreciate the work done better than the programmer himself. Therefore, if he writes in the commentary “magic (ugly dirty hack)!”, This comit is hardly worth considering as the limit of perfection. In addition to the comment to the commit, it is also useful to analyze the comments in the change itself.
With the help of these rules, we can discard the bulk of the slag and leave the commits, which are more or less in line with our expectations. But as a final touch, it would be nice to give the opportunity to make a comit assessment of a living person, which will make the analysis more correct.
Approximately such thoughts were spinning in my head some time ago, and I decided to implement them in the form of the web service
thebestcommits.info . This is still a very raw prototype, in which only the basic functionality is implemented. The service on an hourly basis takes data from Github with githubarchive.org, analyzes it and displays it as a slide presentation on the browser page. The internals consist of Golang and Python, the graphical representation is implemented using reveal.js
I am interested in the opinion of the community about this idea. Is it interesting enough to develop it further?