From: Gavin Sinclair Date: 2002-12-08T14:31:33+09:00 Subject: Re: Ruminations... From: "Ted" > I was looking at "Ruby in a Nutshell" on Amazon's site and came across this in the Introduction on page 3: > > begin > f = open(path) > rescue > puts "#{path} does not exist." > exit 1 > end > > Concerns: > * What if the file exists, but the open uncovers some other condition. The problem has been misdiagnosed; Correct, it should rescue a specific error, like Errno::ENOENT. > * The "routine" has more than one exit. This violates the "one entry, one exit" rule of structured programming. The snippet is out of context, so your conclusion is unjustifiably harsh :) Gavin