Hacker News new | ask | show | jobs
by summarybot 18 days ago
As someone who uses Programmer Dvorak I often encounter pages where the js uses `event.code` instead of correct `event.key`. Silent discards of the shift key also affect Programmer Dvorak as the numbers require it.
1 comments

> Silent discards of the shift key also affect Programmer Dvorak as the numbers require it.

That sounds... aggressively unergonomic. Are programmers not expected to frequently use numbers?

Actually programmers use the symbols far more frequently than the numbers. The number row on Programmer Dvorak is, from left-to-right,

  & [ { } ( = * ) + ] ! #
Looks really weird at first glance! but if you try it out, [square brackets] and (parens) are symmetrical fingers on opposing hands. By hand, [] is the ring fingers (2,0 on a qwerty). {} is (3,4 on the left-hand) and () is 5,8 aka your pointing fingers, left hand then right.

Having the luxury of the parens and frequent symbols (especially if you code Clojure or a Lisp) on the tippy-top row is awesome.

Plus, the numbers are also split by hand!

From middle-going-out:

Left hand: 91357 Right hand: 02468

Which lets you type numbers without looking for them by eye :)

> Plus, the numbers are also split by hand!

> From middle-going-out:

> Left hand: 91357 Right hand: 02468

What is the advantage of this order vs. numerical order? If I'm reading your post correctly the numbers are arranged 7531902468 on the keyboard, with maybe a space in the middle? Is there some mathematical property where odd and even numbers are more likely to alternate than for odds or evens to be found side by side? Maybe 0 is more likely to appear so they want it on an index finger? It just seems unlikely that the next most common digit is 9, unless this was developed by people who set prices on items.

Very simply: if it's an even number, it's your left hand. If it's an odd number, it's your right hand. If you want to type a number like 2,467,333 you can do it without looking for the numbers. On qwerty I tend to "lose my footing" when it comes to typing numbers out. But if it's a 2 on programmer-dvorak, it's right hand, index finger. 2468 is each of your four digits, in order. and 1357 is the other hand's digits. However, I hold left-shift to access the numbers which means my pinky is unavailable for the left numerical ascension, so I tend to do 1 and 3 with my index, and 5 with middle, and 7 with ring. Nine [9] and Zero [0] are "stretch" numbers in the middle: 9 and 0 are reached via one's index fingers going diagonally toward the middle of the tippy-top row.

tl;dr: right hand even,, left hand odd,,, increasing from index to pinky. "Look ma, no eyes!"

> If you want to type a number like 2,467,333 you can do it without looking for the numbers.

You don't need a special keyboard layout for that. Any layout at all has the same feature.

> On qwerty I tend to "lose my footing" when it comes to typing numbers out.

Why not use the numpad?

What numpad :)?
I use a layout with an AZERTY-style shifted digit row for coding (and for everything else). A quick check of one C++ codebase I've been working with shows ~20× as many instances of digit-row symbols as digits (18× for QWERTY digit-row symbols, 27× for those in my layout), though C++ is unusually symbol-heavy. A couple of ECMAScript repositories show 3× or 10×. On some Common Lisp, digit-row symbols are 5× as common as digits for my layout and 22× for QWERTY (almost entirely because QWERTY parentheses are terrible). I don't expect to see a lot of code where numeric literals are more common than type modifiers and operators and such… most of the times numbers are being manipulated in code, they're not being typed in directly as digits but going through comparisons and arithmetic and such, and that's symbols.
We use the ( ) [ ] { } keys more often than numbers, so it works out nice