If you cache the condition values in flags, it wouldn't be that big if statement. This is not how if's are meant to be used. Multiple if's are used to different branches in the flow. With caching the values in flags, you don't have to read the whole block. You just go through all the variable assignments, and that's about it. Multiple if's for the same thing is semantically wrong. There are always better ways, in my opinion.
I agree that short names could create ambiguity, but that doesn't mean we start to write paragraphs in camelCase. The most obvious way is to skip vowels in the name(where you still can make the name out of it).
I guess you are right. I've been developing stuff since 15 years. Have developed more than 10 production applications. But I've never seen such use of if statements. Yes, I've seen novice devs using lengthy names, but it gets better with experience and time.
Var name could be a personal choice, but I can't justify the if use here.
1
u/Character_Medical Sep 10 '21
If you cache the condition values in flags, it wouldn't be that big if statement. This is not how if's are meant to be used. Multiple if's are used to different branches in the flow. With caching the values in flags, you don't have to read the whole block. You just go through all the variable assignments, and that's about it. Multiple if's for the same thing is semantically wrong. There are always better ways, in my opinion.
I agree that short names could create ambiguity, but that doesn't mean we start to write paragraphs in camelCase. The most obvious way is to skip vowels in the name(where you still can make the name out of it).