Um, just a general opinion question: does Kotlin r...
# announcements
e
Um, just a general opinion question: does Kotlin really need ternary operator?
🚫 27
👌 6
g
If you want to read more opinions, check this discussion https://discuss.kotlinlang.org/t/ternary-operator/2116
e
Thanks, tho I wanted a bit more fresh opinions
g
Do you think arguments changed some how? %)
e
Fair point :^)
g
I use Kotlin for about 2.5 years and never want to have ternary operator, especially now
In 90% of cases people use it in Java to check for
null
e
Yeah, me neither. It's just that there's a hot discussion was set off in russian tg chat, so I referred to another source of opinions
g
I think mostly it’s just nagging of newcomers rather than real need to have ternary operator in the language
h
need? no. Would I like to have it? Yes
1
g
This is actually a really good reason do not introduce a new language feature
4
d
IMHO the lack of ternary operation is pretty good, as it pushes Java developers to use
if
as an expression, driving them from mutability/statements thinking to immutability/expressions, which generally lead to more robust software
👏 2