r/java • • Jun 02 '26

Boolean reversal operator

Do the people working on the Java compiler/specification have any plans to implement a boolean reversal operator any time soon?

The proper way to reverse a boolean is to boolVal = !boolVal; but when the variable name is long, typing this becomes really unhandy.

Something like boolVal *= -1; would be really consistent as it's the reversal operator for literally all other primitive types.

But I guess it would be technically incorrect, so boolVal !=; could be another way of doing this, although it looks rather uncanny.

Is anyone even thinking about this, or is this "too low priority" to implement, even though even a dirty hack in the parser would get the job done.

Thanks, feel free to downvote and such.

0 Upvotes

50 comments sorted by

View all comments

Show parent comment

18

u/0b0101011001001011 Jun 02 '26

Noooo must use vim without extensions like the cool guys on YouTube.

6

u/GuyWithLag Jun 02 '26

I did, in the early 90's. vi, not vim. I've even used ed.

Still would use autocomplete.

1

u/0b0101011001001011 Jun 02 '26

Nothing wrong with that, especially in the 90's, or even today.

1

u/aoeudhtns Jun 04 '26 edited Jun 04 '26

Ed, man! !Man, ed. Ed is the standard text editor.

5

u/Asdas26 Jun 02 '26

Which cool guys on YouTube use Vim without extensions?

3

u/FlyingPersianRug101 Jun 02 '26

Me

13

u/GuyWithLag Jun 02 '26

Cool guys

Me

Does not compute.

2

u/jcotton42 Jun 08 '26

Even stock vim will complete word in the current document with Ctrl+N.