>>>>> "SHC" == Shawn H Corey <shawnhco...@gmail.com> writes:

  SHC> Uri Guttman wrote:
  >>>>>>> "SHC" == Shawn H Corey <shawnhco...@gmail.com> writes:
  >> 
  SHC> Uri Guttman wrote:
  >> >> why the || '' ??
  >> >> 
  >> >> the help sub doesn't seem to exit/die
  >> 
  SHC> Not proven; you cannot assume this.
  >> 
  SHC> One school of thought about programming is that all functions must have
  SHC> only one return and all programs must have only one exit.  Therefore,
  SHC> help() may return or it may not.
  >> 
  >> that school leads to gotos and spaghetti logic. last/next/return are
  >> your friends. i have see code where one exit is forced and it looks
  >> forced. ewww.

  SHC> I didn't say it was a good idea.  And part of this philosophy is no
  SHC> goto's.  Instead, use lots of state variables and if statements.

i have seen that and it is WORSE than gotos. double ewww!!

  >> 
  SHC> Until you actually see the help() sub, you don't know if it returns.
  >> 
  >> true. but i had to point out your own assumption that it DID return and
  >> not exit. these are the trials and tribulations when we use PSI::ESP to
  >> see invisible code.

  SHC> If it exited, then my extra code does nothing.  If it didn't, my code
  SHC> set station to the default value.  Yes, I'm assuming at declaration of
  SHC> $station it was assign a valid default.  Here's the statement:

  SHC> my $station = '';

  SHC> Call it paranoid defensive programming.  ;)

overly paranoid imo. but that doesn't mean the bugs aren't out to get
ya! :)

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to