geekhack

geekhack Community => Off Topic => Topic started by: Gerk on Tue, 13 September 2011, 11:06:34

Title: Most Pressed Keys in programming
Post by: Gerk on Tue, 13 September 2011, 11:06:34
Thought this was interesting enough to share with everyone here.

http://www.mahdiyusuf.com/post/9947002105/most-pressed-keys-and-programming-syntaxes
Title: Most Pressed Keys in programming
Post by: Soarer on Tue, 13 September 2011, 11:24:50
Yeah, pretty cool ;-)

Would be nice to seperate shifted and non-shifted keypresses - he mentions that shift presses aren't shown, but it would be even better to split each key into two parts.

Surprising lack of curly braces in the C and C++ cases!

And I'm guesing at a fairly small sample size, because the difference between C and C++ for underscore is so huge - that's probably just the result of different naming conventions being used in each case. Although, comparing those would be another good application of the tool!
Title: Most Pressed Keys in programming
Post by: Gerk on Tue, 13 September 2011, 11:28:53
Yep probably also has to do with the particular projects they sampled to get the data.  I was a bit surprised at a couple of the results as well.  I do a LOT of php and I was really surprised that things like [] and ; didn't register more clicks than they did.
Title: Most Pressed Keys in programming
Post by: Soarer on Tue, 13 September 2011, 11:42:30
Just noticed that the Java sample doesn't have even usage of ( ) brackets - how odd!
Title: Most Pressed Keys in programming
Post by: AlleyViper on Tue, 13 September 2011, 16:22:10
Great post, it would also be nice to include actionscript for the occasional web design stuff. Oh well, this reminds me on much the PT layout is a pain [] or {} (alt gr + num row 7-0), and the loss of the much needed <> key if used over an ANSI board without remapping.
Title: Most Pressed Keys in programming
Post by: jpc on Tue, 13 September 2011, 21:23:47
So they analyzed finished programs? I think if they used a keylogger during actual development, the results might look different.

A real developer will revisit the same code over and over -- refining, refactoring, renaming, etc. That's not reflected in the finished codebase.

In some IDEs, auto-complete reduces the amount of alpha chars you type, that's also not reflected here.

Of course a real developer types plenty that's not reflected in code: testing, emailing, wasting time on GH. Ask me how I know :biggrin:
Title: Most Pressed Keys in programming
Post by: thebilgerat on Wed, 14 September 2011, 00:59:30
Quote from: ripster;415809
Lol.  No delete/backspace key.

Yeah.

Right.

thats for the testers to use.
Title: Most Pressed Keys in programming
Post by: JBert on Wed, 14 September 2011, 07:57:04
Quote from: Soarer;415516
Just noticed that the Java sample doesn't have even usage of ( ) brackets - how odd!
Also, isn't the Java heatmap swapped with some other? I really wonder how much use the '*' key would see in most codebases. (In C/C++ you'd at least use it to dereference pointers).
Title: Most Pressed Keys in programming
Post by: Gerk on Wed, 14 September 2011, 13:28:27
Yes they seem to have analyzed code after the fact, so no backspace or delete keys, no arrow keys, etc.  I think they didn't name the posting well, it should have been the most used chars in languages, not the most typed keys.

There's a link from that page to the heatmap.js where you can copy and paste your own stuff (or type into a box) and see you're own heatmap.  They probably just took some sample files from each language and ran them through that and posted the image that was a result.  I don't think they did much in the way of critical selection of the actual projects used ...
Title: Most Pressed Keys in programming
Post by: Pretendo on Mon, 19 September 2011, 17:33:14
Did you notice that in most of the languages, "I", "N", "T" are very heavily used? Hee hee.
Title: Most Pressed Keys in programming
Post by: aynjell on Wed, 21 September 2011, 17:37:27
With Direct X10, I bet capslock rates highly. :D