Live data from Hacker News

Most Pressed Keys and Programming Syntaxes

mahdiyusuf.com

71–75 of 75 posts

Re: Most Pressed Keys and Programming Syntaxes

#72
post #15

It'd be useful to use the histograms to distinguish between different programming languages for automatic language detections of something like gists.

highlight.js [1] does this, though by running highlighters rather than using some learning-based mechanism. It feels wasteful to run this on display rather than storage, though. SourceClassifier [2] also works, though with less languages. And here's [3] an implementation made with Bayes and Go.

[1] http://softwaremaniacs.org/soft/highlight/en/ http://softwaremaniacs.org/media/soft/highlight/test.html

[2] http://blog.chrislowis.co.uk/2009/01/04/identify-programming...

[3] https://github.com/octplane/go-code-classifier

Re: Most Pressed Keys and Programming Syntaxes

#73
post #70

Earlier quoted context omitted.

I'd love to see how Clojure compares, as it uses fewer parentheses and may even be competitive to, eg, Java in its use of parentheses. As an aside, its interesting (to me, as a Colemak user) that all of the hot alphabetic characters in all the analyzed languages are on the home row of the Colemak layout (except L, which seems to be kind of hot in C++).

https://twitter.com/#!/swannodette/media/slideshow?url=http%...

I actually pasted a Clojure file from a project I'm working on into the heatmap.js page and found that my home row was yellow/red, the parentheses were green and everything else was blue. So yes, parentheses are not as used in Clojure as in Common Lisp (and again colemak is awesome for keeping things on the home row!)

Re: Most Pressed Keys and Programming Syntaxes

#74
Interesting, but a different visualisation would be even more interesting: heat maps showing deviations from the mean. This would highlight the differences between the languages, which (except for the case of Lisp) are rather subtle.

Re: Most Pressed Keys and Programming Syntaxes

#75
post #66

Earlier quoted context omitted.

I do type a lot more square brackets in ObjC than any other language, but I find that I type a lot more generally due to the increased length of many method names in ObjC (or I would do if autocomplete didn't do it for me). (Simple) Example: PHP: $myString = sprintf('Total: %.2f', $myFloat); ObjC: NSString *myString = [NSString stringWithFormat:@"Total: %.2f", myFloat]; Maybe this is the reason these characters don't…

That's a good point. Regarding the '/' I'm betting the code sample was very well commented.

I bet the code sample was from Apple's demo projects so there were like 100 lines of licensing/copyright at the top of each source file.
Post reply on HN