From: Seebs on 27 Apr 2010 11:53 On 2010-04-27, blmblm myrealbox.com <blmblm(a)myrealbox.com> wrote: > In article <519257a9-785e-43d8-871d-9801d2200dfb(a)x24g2000prc.googlegroups.com>, > spinoza1111 <spinoza1111(a)yahoo.com> wrote: >> I don't have the time, or patience, to hunt down Peter's incompetent >> code: but it appears he is misusing C's bad implementation of >> polymorphism out of vanity, even as he codes what should be OR >> statements or operator tables as case statements with fallthrough in >> order to show off. I just had to quote this one, because it so eloquently summarizes the reason this is pointless. Nilges thinks that writing perfectly ordinary, idiomatic C is done in order to "show off". Why? Because he couldn't do it, because he doesn't know C. But because he's narcissistic, he can't tolerate the experience of thinking he's ignorant about a topic he's trying to lecture people about. Instead, he tries to turn his ignorance into a virtue by declaring that anyone using a feature he can't understand is doing it to "show off". It's like seeing someone complain about "trying to use all those big words to show off" after you've referred to a baby cat as a "kitten". > It seems to me that the pseudo_debug function is intended to be > in some sense analogous to the *printf functions -- something that > allows for the printing, or logging, or something, of messages > that consist of some fixed text and some information to be filled > in at runtime by applying conversion specifiers to values of > expressions. Exactly. It's the *standard* idiom for such expressions in C. >> that allow sets of known cases to be grouped. I demur even if >> structured syntax is in use because of my OO experience. When the >> normal American programmer makes a decision that something's a set, >> it's often the wrong decision. For example, he later realizes after >> eating too much at lunch that members of the set can also belong to >> other sets, and codes a case statement where a value appears at two >> places in the switch, and is never recognized at the second place. > Do you mean something like the following, where in foo() there are two > occurrences of "case 0"?: Who knows? That said, he apparently doesn't realize that it's a constraint violation to give the same value twice. > No idea whether this is standard behavior, but it seems to me that > maybe it should be -- I mean, isn't the point of switch/case to > allow creating a jump table, and wouldn't duplicate values make > that impossible to do? Yes, and it is indeed a constraint violation for two of the cases to have the same value after conversion. (The controlling expression is subject to the integer promotions, and all the case values are converted to the resulting type.) Seriously, I know this is fascinating, but I think we've adequately established that Nilges couldn't pour water out of C with instructions on the heel. I think this may be a good case for killfiling; while this is amusing, I think it's also disruptive. I've invited Nilges to come play somewhere where he'd waste less of other people's time (and thanks to his amazing narcissism, he found the link in under 24 hours without any hints), and I really think it's not helping comp.lang.c to keep engaging. He just plain doesn't know enough about C for this to potentially lead to a productive discussion. -s -- Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam(a)seebs.net http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
From: cbcurl on 27 Apr 2010 12:50 On Apr 26, 12:13 pm, Patrick Scheible <k...(a)zipcon.net> wrote: > cbcurl <cbc...(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... No, he was a professional crook. ;-)
From: cbcurl on 27 Apr 2010 12:52 On Apr 26, 12:21 pm, Seebs <usenet-nos...(a)seebs.net> wrote: > > C# does not fallthrough by default, but does let you jump to other > > case statements using goto, which is even more general. > > And even more vulnerable to non-obvious code flow. At least with C's > switch, you never have to worry that something else in the code will > have jumped to a given case. Yes, but it does allow you to write efficient FSMs in C# without having to support the more general form of goto.
From: cbcurl on 27 Apr 2010 13:03 On Apr 25, 4:14 am, spinoza1111 <spinoza1...(a)yahoo.com> wrote: > The fallthrough idiom is idiotic, because it buys you nothing versus > if logic; Not true. The fallthrough idiom is more efficient than extra tests using 'if.' When accompanied by a comment to make it explicit, this is a well- accepted standard idiom in C, C++, Java, JavaScript and other languages that support the concept. You may not like this idiom personally, but most professional users of those languages would disagree with you.
From: Rui Maciel on 27 Apr 2010 14:05
Patrick Scheible wrote: > "Professional programmer" is a meaningless phrase as there is no > professional certification comparable to doctors or lawyers. If the meaning of the word "profession" is occupation or career and if there are people whose occupation consists of programming and made a career out of programming, then why can't they be referred to as professional programmers? Rui Maciel |