From: cbcurl on
On Apr 24, 12:03 pm, spinoza1111 <spinoza1...(a)yahoo.com> wrote:
> Peter (and you), if you think you are professional programmer should
> AVOID idioms such as fallthrough which are unique today to C, and use
> switch() in a structured form. This is because you're responsible to
> program maintainers who because they are smarter than you and have a
> work ethic, have troubled to learn languages like C Sharp and Java.

I think it is widely agreed that C's default fallthrough behavior is
not desirable, but I fail to see the harm in making use of this
feature as long as you use an explicit comment to indicate that it is
intentional and not an accident. Most C compilers now can generate
warnings/errors for fallthrough lacking an explicit comment, so as
long as you have enabled this behavior in your compiler you should be
safe from this particular type of error.

Of course, if you really knew Java yourself, you would have known that
it copied C's fallthrough behavior and suffers from the same issues.

C# does not fallthrough by default, but does let you jump to other
case statements using goto, which is even more general.

From: cbcurl on
On Apr 25, 3:43 am, Patrick Scheible <k...(a)zipcon.net> wrote:
> spinoza1111 <spinoza1...(a)yahoo.com> writes:
> > That's what the code looks to a professional programmer.
>
> No, that's what the code looks like to a programmer who's a bit green
> or rusty on C and doesn't pick up on its idioms.
>
> "Professional programmer" is a meaningless phrase as there is no
> professional certification comparable to doctors or lawyers.

"Professional programmer" just means you get paid to program and
largely make a living doing so. Just like "professional musician",
"professional golfer", etc. The more you get paid, the more
"professional" you are. ;-)

From: Patrick Scheible on
"Jennifer Usher" <jennisuzan(a)gmail.com> writes:

> "Patrick Scheible" <kkt(a)zipcon.net> wrote in message
> news:w9zoch8rn7p.fsf(a)zipcon.net...
>
> > "Professional programmer" is a meaningless phrase as there is no
> > professional certification comparable to doctors or lawyers.
>
> This is true. But in many cases, self-taught programmers can run rings
> around those with degrees, especially those with two year degrees from
> community colleges.

True, but in part that happens because a computer science degree just
means the student has finished the coursework. For law, they need to
pass the bar exam as well. For medicine, they need to complete their
residency as well.

Also at least in some schools the computer science coursework is
mostly theory -- automata theory, computational complexity, etc. - and
deliberately does not teach programming technique. Of course, it
would be difficult to teach techniques for writing and managing large
programs in a one-semester course.

-- Patrick
From: Patrick Scheible on
cbcurl <cbcurl(a)gmail.com> writes:

> On Apr 25, 3:43=A0am, Patrick Scheible <k...(a)zipcon.net> wrote:
> > spinoza1111 <spinoza1...(a)yahoo.com> writes:
> > > That's what the code looks to a professional programmer.
> >
> > No, that's what the code looks like to a programmer who's a bit green
> > or rusty on C and doesn't pick up on its idioms.
> >
> > "Professional programmer" is a meaningless phrase as there is no
> > professional certification comparable to doctors or lawyers.
>
> "Professional programmer" just means you get paid to program and
> largely make a living doing so. Just like "professional musician",
> "professional golfer", etc. The more you get paid, the more
> "professional" you are. ;-)

Was Bernie Madoff a professional investment adviser? He got paid for
it pretty well...

-- Patrick
From: Charlie Gibbs on
In article
<6d90c101-4e77-4b99-996a-9cafec56cf9a(a)y17g2000yqd.googlegroups.com>,
cbcurl(a)gmail.com (cbcurl) writes:

> I think it is widely agreed that C's default fallthrough behavior
> is not desirable, but I fail to see the harm in making use of this
> feature as long as you use an explicit comment to indicate that it
> is intentional and not an accident.

In the example we're arguing about, the fallthrough cases are empty.
I see nothing wrong this this; it's basically syntactic sugar for an
IF statement with two conditions joined by ||, except that it allows
other cases to be dealt with in the same construct.

The real danger is forgetting the break statement at the end of a
non-empty case; that's when the really strange things start happening.
If you really want such behaviour, then an obvious comment is in order -
although I admit that it gives me a queasy feeling to even think about
doing it.

--
/~\ cgibbs(a)kltpzyxm.invalid (Charlie Gibbs)
\ / I'm really at ac.dekanfrus if you read it the right way.
X Top-posted messages will probably be ignored. See RFC1855.
/ \ HTML will DEFINITELY be ignored. Join the ASCII ribbon campaign!