← Back to context

Comment by stkdump

2 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.

  • 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).

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".