On Tue, 20 Feb 2001, Jill Rowling wrote:

> Just to be difficult, what's the difference then between multiple exits and
> a (C) switch statement?

The switch is used for programming a list of alternates.
No exit/egress is involved. The next statement after
the switch is always executed -- unless you've populated
it with gotos and exits ;)

Multiple exits are jsut that: multiple points of egress from
a function/subroutine. The problem with the latter is that
often there are some required exit conditions to be met
(i.e. setting up return values, destroy your mess, etc) that
make maintenance a nightmare if there many exit points. It
is very easy (too easy) to introduce subtle bugs in subroutines
that have multiple exit points.

--
Rick Welykochy || Praxis Services



-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to