Live data from Hacker News

Most Pressed Keys and Programming Syntaxes

mahdiyusuf.com

21–30 of 75 posts

Re: Most Pressed Keys and Programming Syntaxes

#21

Vaguely related, if anyone is interested in tracking their own typing (and individual key counts) check out http://whatpulse.org it's pretty great :-) (my profile, http://whatpulse.org/stats/users/210575/ )

...so this captures every key and mouse movement on your computer, then sends it to a 3rd party server for 'analysis'.

Seems legit.

Re: Most Pressed Keys and Programming Syntaxes

#23

I can understand 0 and 1 being frequently used. But I wonder why 5,6 & 7 seem to be under-used compared to the other numbers?

I would wager that it is because when creating named variables, people tend to start with the low integers, like var1, var2, etc... And when using constants, they will often use maximums up to a threshold, like 999.99. So the middle range (5-8) is rarely used.

Re: Most Pressed Keys and Programming Syntaxes

#24

I can understand 0 and 1 being frequently used. But I wonder why 5,6 & 7 seem to be under-used compared to the other numbers?

I was thinking the same thing until I looked at Perl, which has 4 being quite frequent.

The reason, of course, is that 4 is also $, which is used to denote a scalar in Perl.

Thus, because 5,6,7 correspond to %,^,&, which generally get used to a lesser degree for things like modulo, hashes, exponentiation and logical-and, they're used less.

Re: Most Pressed Keys and Programming Syntaxes

#25
post #16
post #2

I admit, the Lisp one at the end made me laugh. For most other languages the focus seems to be mainly on letters (typing out keywords/identifiers), so in that sense there is little evidence that one language would be easier to write than another. Additionally, I imagine that some of the code is auto-completed by an IDE, which this analysis fails to account for.

Shouldn't shift be twice as hot as the parentheses?

No because this heat map is clearly generated "offline". That is, this is built from a source-file dataset. An "online" dataset would be the output of a key logger. Online analysis would show the number of right parentheses to be a tiny fraction of left parentheses due to auto insertion and other paredit-like operations.

Re: Most Pressed Keys and Programming Syntaxes

#26

I can understand 0 and 1 being frequently used. But I wonder why 5,6 & 7 seem to be under-used compared to the other numbers?

> I can understand 0 and 1 being frequently used. But I wonder why 5,6 & 7 seem to be under-used compared to the other numbers?

The heat map isn't accounting for shift. 5,6,7 also include %,^,&

Re: Most Pressed Keys and Programming Syntaxes

#27
A live sample would be much more interesting, both would be best. I'd be most interested in the meta keys. As a scandinavian especially {}, [] etc. buttons are very awkward to press. Infact, so are most special characters used in programming.

As mentioned, auto-complete and similar functionality change the heatmap, but that's what people actually press. This data would be alot better for actual use.

Though I don't mean it as a scold, it wasn't really in the hands of the author to collect such vast amounts of live data, and surely a lot more work than was his intension.

Re: Most Pressed Keys and Programming Syntaxes

#28
post #21

Vaguely related, if anyone is interested in tracking their own typing (and individual key counts) check out http://whatpulse.org it's pretty great :-) (my profile, http://whatpulse.org/stats/users/210575/ )

...so this captures every key and mouse movement on your computer, then sends it to a 3rd party server for 'analysis'. Seems legit.

I realize you're probably joking :) but the software just "pulses" the number of keystrokes and clicks to the server whenever you tell it to.

It can generate keystroke data like this, but the data is stored locally.

Re: Most Pressed Keys and Programming Syntaxes

#29
post #16

Earlier quoted context omitted.

Shouldn't shift be twice as hot as the parentheses?

No because this heat map is clearly generated "offline". That is, this is built from a source-file dataset. An "online" dataset would be the output of a key logger. Online analysis would show the number of right parentheses to be a tiny fraction of left parentheses due to auto insertion and other paredit-like operations.

Still, the OP is right - for every character that can only be types by pressing SHIFT should also increase the counter for SHIFT.

Re: Most Pressed Keys and Programming Syntaxes

#30
post #4
post #2

I admit, the Lisp one at the end made me laugh. For most other languages the focus seems to be mainly on letters (typing out keywords/identifiers), so in that sense there is little evidence that one language would be easier to write than another. Additionally, I imagine that some of the code is auto-completed by an IDE, which this analysis fails to account for.

One question is why the Lisp code doesn't use the letter E as much as every language? Is that just due to normalizing of parentheses?

While I do not know standard lisp, according to my memory of scheme the following list of c keywords containing the letter 'e' exist in scheme: while.

while the following do not: break, case, continue, default, double, else, enum, extern, register, return, signed, sizeof, typedef, unsigned, volatile

Post reply on HN