On Tue, 18 Jul 2023 at 03:13, Dom Grigonis <dom.grigonis@gmail.com> wrote:
Maybe for someone who majored in languages python’s if-else is more easily understood. To me, personally, 2nd one is unbearable, while 1st one is fairly pleasant and satisfying.
This is a REALLY good example of how hard it is to be objective about syntax. Being familiar with something really truly does make it immensely better - for you. You're comfortable with the C syntax. That's great! So am I. But that isn't a good indication of how it would be accepted by someone who isn't familiar with either syntax. The ?: syntax has the advantage that the evaluation order is left-to-right, which is the most common (though far from universal) evaluation order. That is a definite advantage, to be sure, but perhaps not as big as you might think. The if/else syntax is more consistent with other Python syntax by using words, though. Ultimately, *all* syntax has to be learned. ChrisA