Is this me, or does C ++ seem to be asking for more use of the if statement, and then C #?
I have this code base and it contains many things, such as:
if (strcmp((char*)type,"double")==0)
I wondered if this is not a "code smell" when there are too many if statements?
I'm not saying this is bad, but things like comparing strings with a lot of strings involved, could they not be done differently?
Is there an alternative to just writing sequences of if statements?
THIS IS JUST AN EXAMPLE, THIS MAY BE ANY KIND OF STATEMENTS instead of:
if (string a == "blah") then bla
if (string b == "blah") then blo
source
share