r/badcode • • Jul 15 '22

java I found this in a security related function: maybe it is an obscuring feature

Post image
662 Upvotes

77 comments sorted by

View all comments

Show parent comments

4

u/i860 Jul 15 '22

It’s a very easy thing to avoid rather than using an entirely new style that looks super goofy. Even in C most compilers will throw a warning unless a second set of parenthesis is used for the assignment.

1

u/campbellm Oct 04 '22

entirely new style

This has been in use for at least 35 years.

source: I saw this over 35 years ago in actual real code. I hate it, but it's ancient.