Quantcast
Channel: Ruby Issue Tracking System: shevegen (Robert A. Heiler)
Viewing all articles
Browse latest Browse all 100

Ruby master - Feature #16451: Special ternary operator for methods ending in `?`

$
0
0

I am slightly against this proposal.

To me personally it does not make a lot of sense to differ between the
trailing character of a method in regards to the ternary operator. IMO
the ternary operator should not discriminate against last characters
of any method, ever. It would also add a bit more complexity and I
am not sure if the trade-off is worth to be had here.

Another problem I see is the prolific use of '?'. It would be better,
in my opinion, to keep the syntax simple(r), if possible. With many
special syntax and combinations of syntax in use, it becomes harder
to determine what is going on in general.

Ultimately you only have to convince matz about the use case and
proposed benefit of a suggestion, though, not me. :)

(I should also add that I use the trailing token '?' for methods a
LOT, but I avoid using the ternary operator, largely because I have
found that it takes me longer to determine what is going on,
as opposed to e. g. if/else checks, even though they require more
lines of code.)


Viewing all articles
Browse latest Browse all 100

Trending Articles