That’s not what he meant. It takes 5 lines for a trivial assignment if/else rather than 1 line with a ternary with no loss in readability.
> On Apr 24, 2019, at 7:11 AM, Jan Mercl <0xj...@gmail.com> wrote: > >> On Wed, Apr 24, 2019 at 2:04 PM Mark Volkmann <r.mark.volkm...@gmail.com> >> wrote: >> >> The idea of adding the ternary operator to Go has been debated many times. >> It’s clear that those in charge have a strong dislike for it. For me the >> lack of the ternary operator is one of main things I dislike about Go. It’s >> nails on a chalkboard for me to write a five line “if” statement when it >> could have been a one line assignment statement. > > That's a nice example why Go does not have the ternary operator. > Fitting five if statements into one line makes the code probably > unreadable just for the imaginary gain of saving some vertical screen > space. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.