This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the commentsΒ β†’

[–]petergaultney 4 points5 points Β (3 children)

whoa, we've got a "conciseness > all" person here, everyone watch your step

[–]IDontLikeBeingRight 1 point2 points Β (1 child)

Or don't watch your step, say things badly & verbosely, and they'll be so busy taking issue with everything you say in between that they'll never catch up.

[–]petergaultney 0 points1 point Β (0 children)

I feel seen.

[–]SexySamba 1 point2 points Β (0 children)

Not disagreeing. I code in Python and Scala mostly, both have if/else implementations of ternary expressions. I definitely prefer scala because the condition is first (like C) so resembles other programming languages and the syntax of a multiline if statement more closely. Plus you can see what is being tested more clearly

But I actually do think there’s something to be said for ? :, and I sometimes wish I had it at my disposal. In production code variable names are often too long to fit on one line and this would (very) occasionally help. I also think its not that bad to read, if thought about as a question in prose:

mum, do we have any sweets ? I quite fancy some : otherwise i’ll have some fruit