3 ms·
I love the Python version, it reads like English. Use umbrella if raining, else wear shades.
by drcongo 5y ago
I love the Python version, it reads like English.
Use umbrella if raining, else wear shades.
- DonHopkins 5y agoDo you mean "use(raining ? umbrella : wear(shades))" or "raining ? use(umbrella) : wear(shades)"? Personally I prefer FORTH, which like Yoda reads, and unambiguously puts the condition first, the IF second, the ELSE third, and the THEN last. FORTH ?KNOW IF HONK! ELSE FORTH LEARN! THEN FORTH doesn't have expressions, parens, precedence, or associativity rules, it just has a stack (or rather, two stacks: operand and return; or three of you count the vocabulary search stack). ( And actually it does have parens, but they are for comments! )
- Zababa 5y agoIs this how you would say it in English though? I think "If raining use umbrella else wear shades" is closer to regular English.