if statement - Two separate if clauses or one single if else -
stupid question, practice use 2 separate if clauses or 1 single if if else clause, eg:
if (a = 1) (dosomething) if (a=2) (do other thing)
or
if (a=1) (do something) else if (a=2) (do other thing)
those 2 if conditions not true same time. variable used comparator , not changed @ all.
the 2 ways work expected , nothing programmatically wrong it, asking practice , recommended?
i'd use style easier read.
clarity better difficult follow code.
execution speed isn't going big problem here.
Comments
Post a Comment