Re: switch case - to require the break statements seems strange to me
| From: | Robert Cummings | Date: | Fri, 12 Sep 2008 20:27:27 +0000 |
| Subject: | Re: switch case - to require the break statements seems strange to me | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-280048@lists.php.net to get a copy of this message | ||
On Fri, 2008-09-12 at 16:11 -0400, Eric Gorr wrote:
> On Sep 12, 2008, at 3:44 PM, Robert Cummings wrote:
> >
> > I don't see how that in any way makes an argument for or against. Once
> > still must spend client's money wasting time on code that has
> > questionable merit. Yes, some debugging code is a great boon in any
> > application, but littered everywhere to fulfill someone's subjective
> > philosophical ideal when sometimes it's just plain unnecessary...
> > wasteful IMHO.
>
> As far as I know, no one has yet come up with a proof showing when
> debugging code is and/or is not necessary.
>
> The simple fact is that bugs can popup anywhere and spending a
> client's time and money by spending a few minutes writing all of the
> simple test cases throughout an application can be well worth it as it
> can save far more of the client's time and money by not wasting it on
> tracking down bugs that could have been easily caught.
It is impractical to include debugging code for every conditional in a
program. Doubly impractical to do so in PHP unless you have some way to
prevent said debugging code from running in production. Maybe you're
confusing debugging code with unit tests. As I said earlier, it is far
more practical to do so for complex conditions where a reader might
easily get lost. Rather useless for simplistic cases.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP