Re: Seriously struggling with C



"Richard G. Riley" wrote:
On 2006-02-21, CBFalconer <cbfalconer@xxxxxxxxx> wrote:

.... snip ...

I wouldn't even consider anything other than the one liner:

while (EOF != (c = getchar())) putchar(c);

There is a very good reason why this should never be done.

Debuggers. It would be very hard to step into "putchar". Hence
the bog stand of

while((c=getchar())!=EOF)
putchar(c);

As someone who once had to spend an entire week breaking statement
lines down so that it would be "debugger friendly" I could never
recommend your solution.

Yet you are willing to eliminate the clarifying blanks in the
statement. At the same time I cannot remember when I last used a
debugger in anger. printf usually is adequate.

At any rate we all have our reasons for our preferances.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>


.



Relevant Pages

  • Re: Seriously struggling with C
    ... I wouldn't even consider anything other than the one liner: ... There is a very good reason why this should never be done. ... As someone who once had to spend an entire week breaking statement ... lines down so that it would be "debugger friendly" I could never ...
    (comp.lang.c)
  • Re: real random
    ... The reason is because there is no way to keep the ... debugger out of a mainstream system -- i.e., ... By not showing the process that generates numbers? ...
    (comp.lang.c)
  • Re: 64-bit c++ application crashing on solaris
    ... The very first question you should ask is where exactly is it ... Use debugger to find out. ... You have not presented any reason why you'd think that. ... Ian Collins. ...
    (comp.unix.programmer)
  • Re: advantages of C
    ... Only if you're using a debugger that doesn't understand about name ... But gdb handles gnu C++ name mangling these days, ... plenty of free ones around, so no reason I can see not to use one... ... You all think I'm paranoid, ...
    (comp.programming)
  • Re: kbdmux vs ATA? (was: ATA related panic during ZFS scrub)
    ... I guess the policy was to not pick up any locks while in the debugger. ... The reason for the second rule should be obvious, but the reason for the first rule is less obvious: it's called during the boot in all kinds of sensitive places as a result of calls to printf, so has to be willing to run under the most sticky of circumstances. ...
    (freebsd-current)