Say we have a boolean variable indicating whether an input array is 2D or 3D (just an example). Is it acceptable to name it
is_2d_or_3d instead of
is_2d, to make it clearer that if false, it indicates the input is 3D?
I've personally been doing this for quite some time. I don't remember if I picked it up from some guidelines or just thought of it myself. Is there any conventions suggesting this? If not, are there any drawbacks of this approach (besides not being recommended by guidelines)?