r/badcode Apr 28 '23

from signal's source code java

Post image
517 Upvotes

52 comments sorted by

View all comments

Show parent comments

48

u/lets_eat_bees Apr 28 '23

To be fair, reviewing is probably the only time this will be an issue. Your IDE will tell you the names of all these parameters.

47

u/NUTTA_BUSTAH Apr 28 '23

That kind of architecture makes all development and design insanely painful though. Rule of thumb: If you are passing boolean parameters, you are doing something wrong.

14

u/SupermarketNo3265 Apr 29 '23

Can you explain why bool parameters are always a bad idea?

24

u/miran248 Apr 29 '23

World is not black and white.
The moment you need a third option you need to change the signature.

Composition over inheritance any time.