> Z also has the ternary operator, though it's syntax is more readable than most programming languages:
I’m kind of a fan of the very terse ternary, I personally don’t feel like
X = if cond1 value1
else if cond2 value2
else value3
Is particularly more “readable” than X = cond1 ? value1 : (cond2 ? value2 : value3)
I do appreciate the multi-line functional if statement, but the big reason for use of a ternary in my book is when I really want or need a one-liner. Plus I like having a very obviously different syntax for the functional if vs the imperative if, I don’t want them to look similar.That said, readability seems like a weak argument and always prone to subjective debate. For the last several jobs I’ve had we used auto-formatters and have completely gotten rid of stupid programmer debates about readability.
> The first thing Z clarifies is that Exceptions are not baseballs. For some reason, rather than "raising" an issue, you would "throw" it. That makes no sense at all.
FWIW, this text is off-putting, it’d be better to just describe the syntax Z uses without the incredulity. This feels like a titch of bike-shedding. The big problems with exceptions have nothing to do with the keywords and everything to do with the design. That said “settle” feels weird and it’s also going to be potentially confusing when you try to add a “finally” block, or a re-raise semantic.
> If you forget to settle an error, Z will throw a runtime error.
Should that be “Z will raise a runtime error”?