News for hackers. Stuff that matters.
Re:Most Pressed Keys and Programming Syntaxes by alpb on Thursday July 12, 2012 @03:08AM (#4233442)
I skimmed comments here and couldn't find anything that talks about why e is so popular? Is it because ETAOIN? Because almost no "{" "}" pressed in C/Java. Almost no ":" used in Python. "/" key is more popular than "[" "]" in Objective-C. This makes no sense. I don't believe that blog post.
Re:Most Pressed Keys and Programming Syntaxes by Heinleinian on Thursday July 12, 2012 @05:53AM (#4233795)
Just off the top of my head, I'd guess it's due to a lot of e's in words that, depending on the language, you'll see in almost every single method or function. Things like return, end, else, true, include, self, private, etc.
Re:Most Pressed Keys and Programming Syntaxes by zxoq on Thursday July 12, 2012 @08:48AM (#4234219)
Don't forget set / get, which ubiquitous in almost every language.
Re:Most Pressed Keys and Programming Syntaxes by orangeduck on Thursday July 12, 2012 @05:06AM (#4233693)
Because it is the most common letter in English and used for variable and identifier names.
Re:Most Pressed Keys and Programming Syntaxes by k-mcgrady on Thursday July 12, 2012 @05:30AM (#4233739)
I found the Objective-C one strange too. I would have thought '[' and ']' would have been two of the most pressed keys. I only really use '/' for commenting.
Re:Most Pressed Keys and Programming Syntaxes by dan1234 on Thursday July 12, 2012 @08:10AM (#4234133)
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 score too highly in overall frequency? I have no answer for the high frequency of '/'.
Re:Most Pressed Keys and Programming Syntaxes by k-mcgrady on Thursday July 12, 2012 @08:36AM (#4234191)
That's a good point. Regarding the '/' I'm betting the code sample was very well commented.
Re:Most Pressed Keys and Programming Syntaxes by alpb on Friday July 13, 2012 @10:19AM (#4239899)
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.