3 ms·
I see a lot of reasons listed to use Z, most seem to be improved syntax, but what I don’t really see there is the answer to “why?”. Why is Z being developed? Su
by dahart 7y ago
I see a lot of reasons listed to use Z, most seem to be improved syntax, but what I don’t really see there is the answer to “why?”. Why is Z being developed? Surely not just to smooth out minor syntax annoyances?
> 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”?
- anon4242 7y agoAt a quick glance at least it seems that what Z offers is a better (in the eyes of its designer) syntax. I glanced through to about the ternary operator in order to find the USP. After going back just now I found "The Why of Z" and it seems to be that text output typically needs some kind of module import: "First off, the import statement is clutter. Why can't the text function be built-in, perhaps?" So it seems it's not out to solve the bigger issues of programming...
- deleted 7y ago[deleted]