TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Underscores are stupid? Get a Japanese keyboard

50 pointsby recurserabout 13 years ago

11 comments

vorgabout 13 years ago
If youre going to use a Japanese keyboard, why not go all the way and use Kanji in your code also? Instead of (courtesy of Wikipedia)...<p><pre><code> def create_set_and_get(initial_value=0) # Note the default value of 0 closure_value = initial_value return Proc.new {|x| closure_value = x}, Proc.new { closure_value } end </code></pre> ...we could write (excuse my Chinese)...<p><pre><code> 做 创_去_和_来(先_值=0) 闭_值 = 先_值 回 程.新 {|x| 闭_值 = x}, 程.新 { 闭_值 } 终 </code></pre> Oh look: all the "words" are a single character each! Why not get rid of all those silly grammar symbols in between them (just like in Chinese and Japanese writing)...<p><pre><code> 做创去和来(先值=0) 闭值=先值 回程新{|x|闭值=x},程新{闭值} 终 </code></pre> Now there's tons of whitespace on the righthand side, so why not make it all a single line, with spaces instead of newlines...<p><pre><code> 做创去和来(先值=0) 闭值=先值 回程新{|x|闭值=x},程新{闭值} 终 </code></pre> A lot terser! Makes all the talk about semicolons and underscores sound a little silly to some people, doesn't it?
评论 #3981688 未加载
评论 #3981588 未加载
arsabout 13 years ago
Or just reprogram your keyboard (xmodmap) to make any button do anything you want.
评论 #3981018 未加载
评论 #3981523 未加载
brokentoneabout 13 years ago
I don't like his statistics so much:<p>Ruby - Saving 34% (6,613 keystrokes) PHP - Saving 52% (105,250 keystrokes)<p>Those percentages are not the most helpful. They represent a relationship between the positive delta and the negative delta, rather than a savings for the project (which I feel is the first implication in a percentage saved).
评论 #3982034 未加载
zokierabout 13 years ago
see this previous discussion for keyboard/programming stats: <a href="http://news.ycombinator.com/item?id=2973776" rel="nofollow">http://news.ycombinator.com/item?id=2973776</a><p>Especially the methodology I used then to compare Finnish/Swedish and US layouts seems similar to his.
yuchiabout 13 years ago
Actually Yukihiro "Matz" Matsumoto, designer of Ruby is Japanese. It's pretty ironic, isn't it?
评论 #3981923 未加载
评论 #3981293 未加载
quartertoabout 13 years ago
I have the number keys mapped to their symbols (i.e. pressing 1 gives !, pressing Shift+1 gives 1 etc.) using a custom XKB map. Feels so much more efficient, although I don't have any hard stats.
评论 #3981196 未加载
评论 #3981172 未加载
评论 #3981274 未加载
ksecabout 13 years ago
Interesting, according to the stats, if you have = sign done with out the shift it would have saved another 20% of the keystrokes.
rshmabout 13 years ago
This is my current .Xmodmap file<p>keycode 48 = quotedbl apostrophe quotedbl apostrophe<p>keycode 66 = Tab Caps_Lock NoSymbol Caps_Lock<p>keycode 20 = underscore minus underscore minus
jhuniabout 13 years ago
Use dashes for separators like in Lisp.
评论 #3981262 未加载
nknightabout 13 years ago
&#62; <i>The Control key is in a far more comfortable position below the Tab key, where caps lock would be on a traditional keyboard</i><p>Well, there's tradition and there's tradition... Traditional Unix systems usually had ctrl there, and the old Symbolics/"MIT space cadet" keyboard actually had what I believe is the equivalent of backspace ("rub out") in that location. The modern location of caps lock seems to be a PCism.<p>Edit: Forgot to mention, notably even the Apple II and III had ctrl there, I don't think Apple switched to the "modern" layout until the Mac:<p><a href="http://www.flickr.com/photos/suburbia_org_uk/4820757193/" rel="nofollow">http://www.flickr.com/photos/suburbia_org_uk/4820757193/</a><p><a href="http://www.old-computers.com/museum/photos/Apple_III_Keyboard_s1.jpg" rel="nofollow">http://www.old-computers.com/museum/photos/Apple_III_Keyboar...</a>
cheatercheaterabout 13 years ago
Don't get a Japanese keyboard... just get a better layout!<p><a href="http://bitbucket.org/cheater/us_split/overview" rel="nofollow">http://bitbucket.org/cheater/us_split/overview</a><p>It's just like qwerty, but better, because it inflicts less pain.<p>I didn't even know, but Apple started using it with iPads! <a href="http://www.gottabemobile.com/2012/02/03/ipads-split-keyboard-has-hidden-buttons/" rel="nofollow">http://www.gottabemobile.com/2012/02/03/ipads-split-keyboard...</a>