Too Many if Statements?

slogging_away hinnc at yahoo.com
Tue Feb 7 12:09:38 EST 2006


I don't consider myself to be a seasoned programmer so if you mean
redesigning the script to make the checks and therefore reduce the
number of 'if' statements, I'm not sure if that can be done.  The
script needs to make numerous checks for the existence of particular
strings within the configuration file.  It also uses 'if' statements to
determine what type of file is being examined, etc.. If an error is
encounterd it writes warning messages to a master file.  I guess what I
am trying to say is that in order to make the many checks on the
configuration files I do not know of any other way than to check for
the existance of particular statements, (strings), and then report on
those if they are incorrect or missing - hence at least one 'if'
statement for every check. 

I appreciate the feedback though!




More information about the Python-list mailing list