7 ms·
Analyze Github commits to know which convention is popular
- ethomson 13y agoMaybe this is intended to be obvious, but it is not to me. Is this actually counting the number of commits that show a particular convention, or is it showing the number of occurrences of said convention? The web site states "number of commits" (without really discussing methodology) which is, frankly, not at all interesting to me. Is a commit of 100,000 LOC weighted equally to a commit of one LOC? Are these projects internally consistent or no? Do projects eventually become internally consistent?
- CatMtKing 13y agoNumber of occurrences, by the looks of it. Each match (per line) increments its counter by one. https://github.com/outsideris/popularconvention/blob/master/src/parser/python-parser.coffee https://github.com/outsideris/popularconvention/blob/master/...
- Falling3 13y agoThanks, I was wondering the same thing. I feel much better knowing that 93% of lines are kept to 80 characters than 93% of programmers never use more than 80.
- yazgazan 13y agoThe stats are the same for Scala and Python ...
- itsmonktastic 13y agoAnd for JS. Whoops :P
- joshavant 13y agoIf your favorite language isn't here, another trick you could use is adding 'site:github.com' to your Google searches.
- vmarsy 13y agoWhat is the methodology for the 'Line length is over 80 characters' ? A lot of lines of code have less than 80 characters, no matter what the conventions are. What would be interesting is the percentage of files that have not a single line with more than 80 characters and the other files. It would be more obvious to see who doesn't care about 80 characters.
- CatMtKing 13y agoFor python, it seems to consider tabs as 4 spaces and take the character count of the line. https://github.com/outsideris/popularconvention/blob/master/src/parser/python-parser.coffee https://github.com/outsideris/popularconvention/blob/master/... It seems to only look at commits, (so it doesn't consider the entire file, though it's certainly possible to do)
- MattBearman 13y agoVery cool idea, always interesting to see this kind of data. My only feedback would be to put the language names as well as logos. I had no idea what those last two languages were, and waiting for the hover title text is a bit tedious (not to mention some people may not realise you can do that)
- dansimau 13y agoPython's PEP8 recommends underscores for functions, method names and instance vars, but the stats are showing a break down of camelCase with and without first capital letter (which shouldn't really be relevant).
- signed0 13y agoAre you sure you are looking at the Python page? I don't see a category for variable names.
- anonymoushn 13y agoClicking on Python returns the Scala page here. I cannot get to the Python page.
- samspenc 13y agoAm I the only one who couldn't recognize the Scala logo till I saw the HTML source?
- fennecfoxen 13y agoMystery meat navigation! I couldn't identify Python or Scala.
- znowi 13y agoI feel bad for tab-lovers. A crushing defeat :)
- jlgreco 13y agoI'd like to see this metric for C. I expect much higher tab-usage there.
- calpaterson 13y agoThe problem is that a lot of "tab-lovers" mean "pressing tab" which, in most editors will insert spaces. http://www.jwz.org/doc/tabs-vs-spaces.html http://www.jwz.org/doc/tabs-vs-spaces.html
- dfritsch 13y agoI was thinking the same thing. Not necessarily was easy as counting spaces...
- jlgreco 13y agoI think most tab lovers mean "tabs to indent, spaces to align". The 'unholy third option' here: http://www.codinghorror.com/blog/2009/04/death-to-the-space-infidels.html http://www.codinghorror.com/blog/2009/04/death-to-the-space-... Delightfully this is what Go has settled on. (Who actually presses their tab key anymore? Even vim does that for you.)
- jamesaguilar 13y agoIt's not that bad in go though because you should just run gofmt every time you save. It's bad when you have to do it by hand.
- jlgreco 13y agoI don't see why it should be bad to do by hand. I have never experienced any difficulties with this style when using any other language in Vim.
- jlgreco 13y agoI think there is a problem with "Type of Parameters Definition" for Javascript. Followed by space def add(a:Int, b:Int) = a + b Using space in before/after def add(a:Int, b:Int) = a + b No space def add(a:Int, b:Int) = a + b I'm not seeing any difference between those three.
- rcsorensen 13y agoLooks like that was fixed in https://github.com/outsideris/popularconvention/commit/fc731892f63a961bfb3c7b1544a170b87f765de3 https://github.com/outsideris/popularconvention/commit/fc731... .
- jnuss 13y agoCool idea. I would love to see more languages and conventions added. I will say the background image at the top (the code with the focus explosion effect) gives me a headache though. The site looks better without the image.
- leastfixedpoint 13y agoIt's wrong for Java. "final" is not what is usually called a constant there, "static final" is. Also, who ever uses special prefixes for statics?!
- gboudrias 13y agoGood idea. Needs more conventions. And more languages of course.
- EricMuller22 13y agoAgreed, very cool idea. Would love to see it expanded upon.
- jtms 13y agostrikes me as odd it doesn't offer ruby as a choice when Github started life and became popular catering to Ruby/Rails devs
- graue 13y agoNice charts. I'd be curious about number of spaces, particularly for JS: 2 spaces seems more common in the Node community, but I see a lot of 4 as well. Perhaps it has to do with whether the author is more comfortable with Ruby (usually 2) or Python (4). My current company goes against the grain by using snake_case instead of camelCase in JavaScript code. It weirded me out at first, but considering our backend is Python, it's nice not to switch conventions.
- rcsorensen 13y agoI've come to really enjoy using the conventions of the language to keep things clear when writing css-rules that are intermixed with javaScriptVariables talking to a ruby_backend emitting jsonEncodedObjects. Keeping things js-named helps keep my mind in the path of JavaScript conventions instead of Ruby ones in situations like array_of_things.pop and arrayOfThings.pop()
- graue 13y agoYeah, that's true too. Just looking at the positive side of a convention that's not mine to change :)
- shortstuffsushi 13y agoYeah, I completely agree. It starts to get a bit confusing when you have a BackEndInCSharp that goes through a javaWebServer before reaching iOS. We tend to have a hard time being consistent once we get to iOS, but that's due also to the fact that we've just merged three different teams (each without a specific standard...)
- casual_slacker 13y agoDojo and jquery use tabs. Nodejs and Google Closure use 2 spaces @see http://code.jquery.com/jquery-1.10.1.js http://code.jquery.com/jquery-1.10.1.js https://github.com/joyent/node/blob/master/src/node.js https://github.com/joyent/node/blob/master/src/node.js https://code.google.com/p/closure-library/source/browse/closure/goog/dom/dom.js https://code.google.com/p/closure-library/source/browse/clos...
- 13y ago
- kstenerud 13y agoInteresting, though at no point does the site actually say what language it's analyzing. I recognize the javascript and java icons, and I'm guessing that since the third one is a snake, it's python, but I have no idea what the last one is.
- isxek 13y agoThe site seems to stop after having one of the language icons selected. There's a "Loading..." graphic, then it disappears, then nothing. Is anyone experiencing the same issue?
- twiceaday 13y agoThere is a typo, for Java the last item says "Use special prefix fot staticvar"