TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Underscores are stupid? Get a Japanese keyboard

50 点作者 recurser将近 13 年前

11 条评论

vorg将近 13 年前
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 未加载
ars将近 13 年前
Or just reprogram your keyboard (xmodmap) to make any button do anything you want.
评论 #3981018 未加载
评论 #3981523 未加载
brokentone将近 13 年前
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 未加载
zokier将近 13 年前
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.
yuchi将近 13 年前
Actually Yukihiro "Matz" Matsumoto, designer of Ruby is Japanese. It's pretty ironic, isn't it?
评论 #3981923 未加载
评论 #3981293 未加载
quarterto将近 13 年前
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 未加载
ksec将近 13 年前
Interesting, according to the stats, if you have = sign done with out the shift it would have saved another 20% of the keystrokes.
rshm将近 13 年前
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
jhuni将近 13 年前
Use dashes for separators like in Lisp.
评论 #3981262 未加载
nknight将近 13 年前
&#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>
cheatercheater将近 13 年前
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>