Re:If-then-else had to be invented
by goblin89 on Sunday December 13, 2020 @09:35AM
(#25406811)
True!
A point could be made for restricting ifs to 1 or 2 clauses and delegating more complex conditions to switch/case, but that is arguably even more far out there (and in case of Python it actually doesn’t have the switch operator). Also, “if not X {…} if not {…}” would be confusing but possible.
I guess I should leave language design to the better-equipped for the time being.
A point could be made for restricting ifs to 1 or 2 clauses and delegating more complex conditions to switch/case, but that is arguably even more far out there (and in case of Python it actually doesn’t have the switch operator). Also, “if not X {…} if not {…}” would be confusing but possible.
I guess I should leave language design to the better-equipped for the time being.