There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
SCJA
~Currently preparing for SCJP6
Steve
SCJA
~Currently preparing for SCJP6
Steve Luke wrote:
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Bear wrote:
Yeah, using an if to use the ternary to avoid an if is somewhat iffy.
fred rosenberger wrote:
Steve Luke wrote:
I would say this is bad regardless of the terniary. I'd rather see this:
Steve
Nageswar Kakolla wrote:I always like to use ternary operator as it simplifies number of lines period.
I suspect a lot of old features from C++ were retained in Java so as not to frighten off C++ programmers. People are very conservative, so features were kept and we are left with things likeNageswar Kakolla wrote:. . .
2. Also, if it was poor programming style, why would java authors would keep it in the first place
SCJA
~Currently preparing for SCJP6
The world's cheapest jedi mind trick: "Aw c'mon, why not read this tiny ad?"
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|