[Shootout-list] Policy on command line args and file checking

Isaac Gouy igouy2@yahoo.com
Tue, 22 Jun 2004 07:59:06 -0700 (PDT)


Please post a policy on command line arg (and file) handling.

Should implementations assume command line args are present and
correct, or should they check? 

This:
   n = Int32.Parse(args[0]);   

or this:
   static int argi(string[] args){
      int n;
      try {
         n = Int32.Parse(args[0]);
         if (n < 1) n = 1;
      } catch {
         n = 1;
      }
      return n;
   }

(imo an arbitrary decision, and clean up, would be fine.)


	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail