jeudi 31 octobre 2019

Reasons why Condition shortening for same attributes is not enabled?

I have seen this Post, and want to know if there are any known reasons why this is not implemented. Does someone know why something like this is not available? I can't find anything on the web.

i only want to know if there are known downsides or disadvantages or things i did not consider on this idea.

i wish there would be something like this:

if (objectOneWithLongName.getNumber() == [12 || 13]) {
  someCode();
}

I think this would be a huge advantage for coders, to have something like that.
what do you think?
is it a bad idea and if so, why?
Where there already any thoughts on this subject by the creator of java and they dismissed it?

Otherwise, if someone has seen this, or it's on the timeboard at Oracle, can someone link the JEP?

Aucun commentaire:

Enregistrer un commentaire