Underscores are stupid? Get a Japanese keyboard (2012)

by lelfon 6/4/24, 11:44 AMwith 72 comments
by kleibaon 6/4/24, 7:42 PM

You can remap keys on any keyboard layout, no need to get a Japanese keyboard.

Many years ago, I was working in a German lab and their keyboard layout is really impractical for programming in C-like languages because all commonly used symbols are really awkward to type. I wasn't well-versed in XFree86 then (or today for that matter) but I remember I could solve the problem by simply changing they map that Emacs uses to map keyboard keys to input events. In other words, I was still using a German keyboard but when I typed "blindly", it behaved like a US keyboard. I even had some keys to behave context-sensitively, i.e., the same key stroke would produce different symbols depending on where the cursor was positioned in a buffer. That was actually tremendously useful.

So, if you wanted some other key to give you and underscore without having to hold down Shift (which I don't get why this is a problem in the first place, it's not like we don't have auto-complete in our IDEs), there's multiple ways you could achieve it.

by red_hareon 6/4/24, 8:24 PM

> ALT-yen-mark to get a proper backslash

I believe this is an artifact of JIS_X0201, which is, to my knowledge, the first major Japanese 8-bit encoding and mostly 7-bit ASCII + Katakana (that character set you see in old Japanese video games) and some Japan-specific symbols filling the other half of the 8-bit space.

In it, byte 0x23 was changed from "\" to "Ā„".

The history is fascinating:

> The 1964 ISO draft reserved the positions 0x24 and 0x5c for first and second currency symbols to be assigned by each country, but it was considered too dangerous in international communications to use currency symbols that could be localized. The ISO committee had two options that to use a generic currency symbol (¤) or to give the dollar ($) and pound (£) signs permanent assignments. It was agreed that the dollar sign was assigned to position 0x24 and the pound sign was to position 0x23. The latter was not required in countries that did not need the pound sign. The JIS committee decided to put the yen sign („) in 0x5c (one of the national use positions).

https://en.wikipedia.org/wiki/JIS_X_0201

It's legacy lived on in Shift JIS which Window's extended and resulted in Japanese Windows computers having file paths like "C:„Users„MyName" and escape sequences like "„n"

All this to say, my respect for Japanese devs who work with encoding is top-tier.

by dylan604on 6/4/24, 8:24 PM

Maybe it's because I took an actual typing class way back in the dark days of actual clackity-clack type writers, but I don't get the dislike of shift keys. Are these people that learned to type from only playing games or other non-formalized learning to type? Kudos for you learning regardless of the method, I'm just looking at why I don't have the same aversion to the shift keys. I even use the "proper" shift key meaning I use the left shift when using a right hand key and vice-versa.

by kleibaon 6/4/24, 7:57 PM

How fun - I have no recollection of that discussion from 12 years ago, but somehow I just found out that I commented on that thread back then:

https://news.ycombinator.com/item?id=3976669#3981000

(Don't click, it's not worth reading. Pretty much like this comment, too, sorry.)

by koito17on 6/4/24, 10:27 PM

I always buy Macbooks with JIS layout, not because underscores are convenient to type. It's convenient to push the かな button to start writing in Japanese then 英ꕰ when finished. On an ASCII keyboard, Mac OS requires either C-<RET> or pushing the Fn key, both of which waste an entire second to display a modal, then another second to actually switch keyboard layout.

I will admit, JIS layout makes writing Clojure a bit easier, though it also makes quoting tedious. Escaping is even more tedious. Push M-Ā„ is one option. Another option is to configure Mac OS to output backslash, but then you can't input Ā„.

When coding with an ASCII keyboard, I frequently make typos due to muscle memory. If you work in the US, that is another major disadvantage. Your work computers will have ASCII keyboards, not JIS keyboards.

by neilvon 6/4/24, 8:38 PM

10% of the remaining advantage of Scheme today is not needing to use the Shift key to type identifiers on US keyboards. Instead, you use minus rather than underscore, and there's no camel-case, and mostly no all-caps (except for syntax transformer pattern variables, IMHO).

However, Scheme and other Lisps have the problem of parentheses being a shifted character on most US keyboards.

For Scheme, my Emacs tweaks included letting you type the square brackets (unshifted on US keyboard) to get parentheses. (Or you'd get the correctly matching closing character, if the close-square-bracket key you pressed would match an open-square-bracket.)

by mgaunardon 6/4/24, 8:38 PM

That's an Apple Japanese keyboard.

Apple messes with the standard keyboard of all layouts.

by psychoslaveon 6/6/24, 1:04 PM

For multiple lexies into a single identifier, I love middle dot (Ā·), which is actually works in most modern languages out of the box. Example `someĀ·variable`. Try it in your favorite languages and let me now how it goes.

For elements that have to bee ditched in a destructuring operation, like `target, _ = someĀ·generator()`, it’s possible to use a word that explicit this discard. One short one term for that is "lee", as in "Basest part, ā€˜dregs’, ā€˜refuse’[1]."

I wasn’t aware that many people disliked so much underscore and other YOLO approaches to morphe agglutination. I always felt sad that we had to endure this ridiculous typographical masochism that plague the whole industry. But going against a widespread habit, as absurd and sore could it be, is generally its own road to some form flagellation.

[1] https://www.oed.com/dictionary/lee_n2?tab=meaning_and_use#39...

by simonebrunozzion 6/6/24, 12:23 PM

> I find the layout incredibly efficient for writing Ruby code

No surprise, as Ruby was developed by a Japanese. [0]

[0]: https://en.wikipedia.org/wiki/Ruby_(programming_language)

by lawnon 6/6/24, 12:52 PM

Nah, get an ergonomic keyboard with more keys in better places that lets you place whatever symbol anywhere.

Yes, I have underscore on the main layer on a 32-key keyboard. It's just that common in my usage.

by mrweaselon 6/4/24, 7:48 PM

The downsides aren't unique to Japanese keyboards. On Danish keyboard " requires the use of the shift key, same for = and the \ in on the 7 keys, along with /, requiring you to hit option + shift + 7 (on a mac keyboard, I believe it's Alt + shift + < on none Apple keyboards).

The Japanese keyboard in the article does have { printed on a key, it's Option + Shift + 8 and the Danish Mac keyboard, and the key isn't labels with {, } is on the 9.

by zwayhowderon 6/4/24, 8:49 PM

I briefly flirted with a Japanese keyboard just to get the extra keys that they have (next to the space bar which is much smaller) I then remapped those keys to other more useful commands.

I then discovered VIA/QMK keyboards and now I have keycaps I can't even see on my vertically mounted split-key keyboard and more programmability than I know what to do with. But in 2012, a Japanese Keyboard was much cheaper than a Kinesis and to me the only option.

by karmakazeon 6/4/24, 10:49 PM

Food for thought. When I was making my own custom keyboard layout I resisted the additional rabbit hole of shuffling punctuation. The only change I did make was to put ',' above right-hand pinky (shifted is ':' and home-row pinky being a letter). I decided I'm not going to use semi-colon terminated programming languages anymore so it's fine to be down with the '<' key.

by dangon 6/4/24, 8:13 PM

Related:

Underscores are stupid? Get a Japanese keyboard - https://news.ycombinator.com/item?id=3980866 - May 2012 (40 comments)

Underscores are stupid - https://news.ycombinator.com/item?id=3976669 - May 2012 (127 comments)

by jacqueslon 6/6/24, 12:27 PM

I used one for 10-15 years, and the extra column of characters definitely were bad for RSI. My right ring finger’s tendon was impacted the most. The extra reach to arrows, the enter key, etc. were too much for me. I went back to a US layout and don’t have issues now.

by omitmynameon 6/4/24, 10:00 PM

you can simply remap keys with karabiner-elements.pqrs.org, why bother with a japanese keyboard?

by jessetempon 6/6/24, 12:51 PM

Sounds like a questionable tradeoff to me. I just want underscore remapped to shift-space. It’d be easy to type because they’re both big keys. And underscore is a variation of a space anyway. It’s like an uppercase space

by toastalon 6/6/24, 12:31 PM

> less drastic than switching to something like Dvorak

Still no regrets. With software being such an important thing to my life, easy snake_case & kebab-case a big reason I haven’t been interested in switching to another layout.

by akasakahakadaon 6/4/24, 12:22 PM

Similar thing. To avoid my fingers fighting each other when pressing cut copy paste in Macbook, I almost bought those 20-key left hand gaming keyboard so that I can do them in a single keystroke.

by ameliuson 6/6/24, 3:00 PM

"Hit underscore to launch rockets, hit minus to exit"

On my keyboard, the symbol for underscore looks just the same as the symbol for minus. No idea which is underscore and which is minus.

by lfkdevon 6/6/24, 12:38 PM

Just get any VIA keyboard, easy to remap everything

by wormiuson 6/4/24, 10:53 PM

The keys I hate the most are $ % ^ & { }

I think underscores are pretty painless, but maybe it's just that my hands being like Trumps tiny hands make it less painful? I never liked the idea of a short space bar, but thinking about it now with the comment of having a couple useful buttons does sound kinda nice.

by nbzsoon 6/4/24, 8:24 PM

Get a Kinesis Advantage or the newest keyboard. Your hands will thank you later:)

by bamboozledon 6/4/24, 8:38 PM

Don't get a Japanese keyboard unless you want to become insane.