2 ms·
I think the semantics of the language is also important. A ternary operator in a C like language probably is frustrating because it's some magic that was just
by olah_1 7y ago
I think the semantics of the language is also important.
A ternary operator in a C like language probably is frustrating because it's some magic that was just shoehorned into the language with no rhyme or reason behind it.
However, in a language like Perl 6, each magical operator has an intelligible semantic meaning behind it almost like a natural language. So when you mix and combine different operators, it starts to make sense to you. See this post for an example https://perl6advent.wordpress.com/2017/12/11/all-the-stars-of-perl-6/ https://perl6advent.wordpress.com/2017/12/11/all-the-stars-o...
- Chris_Newton 7y agoI think the semantics of the language is also important. Yes. I suppose I’m arguing here that the importance of semantics is much greater than the importance of syntax. It’s not that syntax doesn’t matter, but these days I find myself much more concerned with what features a programming language offers than exactly what they look like. A ternary operator in a C like language probably is frustrating because it's some magic that was just shoehorned into the language with no rhyme or reason behind it. I’m not sure I can agree with that. The big difference between the ternary-if operator and if-else statements in the C family languages is that the former is used in expressions while the latter is used with statements. Sometimes that distinction is useful.