Comment by stkdump

3 hours ago

The modern universal keywords if, else, for and while are good because they are fairly short and thus quick to type.

"loop" can all be typed with one finger, as the letters are all together on the qwerty keyboard, and the "o" repeats itself.

"while" on qwerty is sort of a chore.

  • When you can touch-type, it's better to have keys spread to use separate fingers. That way, you divide up the work. You have one finger still lifting while the other's already starting the next press.

    • Try it. What's faster to type: one word with a total of 5 distinct letters, or one word with a total of 4 letters, three being distinct?

      I understand the theory when writing, you know: sentences. Writing code ain't that. I'm also not typing on a model M. This laptop's keys press down like 1 or 2mm at most. You actually only need to press down twice -- just move your finger from "l" to the "o" depress/press again for another "o" and move right over to the "p".

      Do you reprogram your keyboard so parentheses, square/angle brackets, etc can be typed with their respective hands? Naw. When people type numbers all day, are they delighted to use the row of numbers up top, or a numpad? Never have I ever.

  • Usually for speed and avoiding strain you want to incorporate as many fingers as possible. In fact it's a common mark against dvorak online that "ls -l" is all typed with the right pinky (not an issue in the workman layout luckily).

    • Also remember this was typed with typewriters. That gives its own set of constraints. It's quicker to type two different characters than the same character twice in a row, as you need to wait for the typebar to return enough.

  • w TAB in a properly configured emacs

    • Correct me if I'm wrong– I haven't check on THAT corpse– but couldn't you configure w TAB to be a shortcut for whatever you want (or make your own?).

I'm writing some Crystal (which has Ruby-like syntax) and I'd add `unless` to the list. I like it!

  • "Unless" feels like adding come-from (next to goto) to a language. A statement/flow should not change its meaning after being declared/written IMHO.

    edit: My criticism is for the suffix version to be clear. Unless / else is actually cool.

    • `destroy_world() if $angry;` is Perl syntax. And Python has `destroy_word() if angry else live_long_and_prosper()`.

      (But it's not remotely like come-from.)

      P.S. in re the other response, "unless" is "if not". "until" is "while not".