5 ms·
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
by sltkr 14y ago
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.
- shasta 14y agoOne 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?
- PerryCox 14y agoIt probably gets used about the same amount as the other languages, it's just that the parentheses get used an insane amount and outweigh all the other characters.
- waterlesscloud 14y agoIt might be more interesting to see these with the vowels factored out.
- waterhouse 14y ago~ $ curl -s 'http://lib.store.yahoo.net/lib/paulgraham/onlisp.lisp' | egrep -o '.' | sort | uniq -c | sort -nr 18641 3277 ) 3276 ( 2561 e 2159 a 1934 s 1903 r 1672 n 1661 t 1477 l 1380 o 1287 c 1282 d 1067 p 1064 i 1030 m [...] Without vowels: 18641 3277 ) 3276 ( 1934 s 1903 r 1672 n 1661 t 1477 l 1287 c 1282 d 1067 p 1030 m 929 f 852 b 654 , 601 g [...]
- nathan_long 14y ago> 3277 ) > 3276 ( My first thought: 'unmatched paren?' But I bet there's a smiley face on that page somewhere. EDIT: If there is, I don't see it.
- ordinary 14y ago(let ((rpar (get-macro-character #\) ))) Escaped. :)
- chacham15 14y agoWhile 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
- batgaijin 14y agoYeah, paredit would make only the left paren red...
- sordina 14y agoShouldn't shift be twice as hot as the parentheses?
- snprbob86 14y agoNo 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.
- kleiba 14y agoStill, the OP is right - for every character that can only be types by pressing SHIFT should also increase the counter for SHIFT.
- snprbob86 14y agoIf you want to be pedantic... "Shouldn't shift be twice as hot as the parentheses?" For offline analysis? No. Shift should be as hot as the SUM of both types of parentheses. In practice, both parentheses will be equal in count modulo some epsilon for unmatched parenthesis in strings and comments. Therefore, shift will be close to twice as either parenthesis. For online analysis? No. Shifted characters can come into existence without being typed. For parenthesis, autocompletion is one way. Automatic bracket matching is another. There are many more, including template expansion, copy/paste, and several paredit operations.
- dkersten 14y agoI'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++).
- abp 14y agohttps://twitter.com/#!/swannodette/media/slideshow?url=http%3A%2F%2Ftwitpic.com%2F6hwt28%2Ffull https://twitter.com/#!/swannodette/media/slideshow?url=http%...
- dkersten 14y agoI 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!)