Ternary operator in Java, because damn it looks so slick

  • 2
    It might be my bad memory but doesn't it look the same in all languages? (That I know at least)
  • 0
    @BartBB I reckon it does, yes. Haven't done much besides Java.. yet 😉
  • 2
    @BartBB in python ternary operator syntax is `a if test else b`
    While in coffeescript it is `if condition then a else b`
    the python way is best. Allows you to write super explicit statements such as `a if test1 else b if test2 else c if test3 [...] else z`. I know how if would look like with the java/C syntax, but I definitely don't wanna read it :p
  • 0
    Well, I guess it's time to go all in with Python and finally learn it properly, eh?

    Thanks for reaching me something new. @hiestaa
  • 1
    @BartBB pleasure, I can't tell how I love the python ecosystem tho I like to share it (as long as we don't talk about timezone and unicode... Can't be perfect eh!)
  • 0
    teaching* :D @hiestaa
Add Comment