4 ms·
I agree. I read this line: > ∀ instead of forall, which is faster to input than the whole word. It reminds me of the idiom that code is often written once but
by accrual 3y ago
I agree. I read this line:
> ∀ instead of forall, which is faster to input than the whole word.
It reminds me of the idiom that code is often written once but read often, so one would want to optimize for readability and not fewer keystrokes. At least for production code.
- OkayPhysicist 3y agoTo be fair to math symbols, code is read often by programmers, especially programmers of the language you're writing in. For things that get used a lot, short symbols are fine, because everybody reading the code will have seen a lot of the relevant syntax. Otherwise it would be like asserting that programming would be better if we eschewed all specific jargon. Why say "bit" when we can say "single digit for which there are only 2 possible values"?
- WJW 3y agoI have to respond to this with a resounding "meh" tbh. ∀ is a pretty unique symbol, it is very readable even if you don't know what it means. Programming forces you to learn new words constantly anyway. It's not like "object instance", "monad", "recursion" or even "while loop" are all that intuitive to beginners yet all programmers learned them anyway. (feel free to ignore any terms you're not familiar with, they're just examples) ∀ might be just as incomprehensible as OOP for a starting programmer, but for anyone taking even a small amount of time to learn it is not difficult at all.
- dfan 3y agoMy guess is that the majority of Haskell programmers who are comfortable enough with the forall keyword to use it in practice would find the symbol ∀ to be more readable than the keyword, rather than less. (This is not snark, it's my actual belief.)
- Skeime 3y agoI also don’t buy the argument that it’s faster: Ctrl-k, Shift-f, Shift-a is still six keypresses, and they’re more awkward than just typing forall.