Remix.run Logo
▲ 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.

▲justinator 9 minutes ago | parent | next [-]

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

▲opan 2 minutes ago | parent | next [-]

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

▲stkdump 3 minutes ago | parent | prev [-]

Using more fingers allows for faster typing.

▲alexfortin 22 minutes ago | parent | prev | next [-]

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

▲egeozcan 10 minutes ago | parent [-]

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

▲divbzero an hour ago | parent | prev [-]

Yes, otherwise is more natural but less terse.

▲jordigh 5 minutes ago | parent | next [-]

We often write "otherwise" in mathematics:

https://arxiv.org/html/1501.05438v2#:~:text=otherwise,-%2C

https://arxiv.org/html/1302.5008v3#:~:text=otherwise

https://arxiv.org/html/1501.05438v2#:~:text=otherwise,-%2E

In fact, I think that's the most common alternative, not "else".

▲autoexec an hour ago | parent | prev [-]

"or else" works too but that's still three extra characters