Re: How to print an array of char backward.



Richard<rgrdev@xxxxxxxxx> writes:

Ben Bacarisse <ben.usenet@xxxxxxxxx> writes:

Richard<rgrdev@xxxxxxxxx> writes:

Ben Bacarisse <ben.usenet@xxxxxxxxx> writes:

Richard<rgrdev@xxxxxxxxx> writes:

Ben Bacarisse <ben.usenet@xxxxxxxxx> writes:

Richard<rgrdev@xxxxxxxxx> writes:

pete <pfiland@xxxxxxxxxxxxxx> writes:
<snip>
I disagree.
The code as written, is easy to understand.
If he were doing decimal representation,
he would be dividing by 10 instead.
<snip other points>
If the code was being maintained by Bill possibly. But if a C programmer
does not understand something x&1 or shift right/left then they have no
business writing in C in a commercial setting.

But what of pete's first point? I much prefer % and / in the context
because it expresses a general algorithm.
<snip>
I have no problem with his code, but I would suggest that (especially
the shift) the bit test and the shift are obvious to any half decent C
programmer.

Right and I agreed. I wondered if you had anything to add about his
first point which is not about whether anyone should or should not be
able to read the alternative.

If you are talking about the compiler part and the optimisation then
yes, of course I agree with him.

There is often a misty area with certain code constructs. I would
generally go for maintainability over obscure nano second saving
techniques. In this case however, >>1 is as clear as /2 for me.

That confuses meaning with intent. Understanding code happens at

To some. My point here is that it would not for me in the context of the
code.

multiple levels. The meaning of both may be equally clear, but one
expresses the intent more directly.

Not really. Not in the context. >>1 reads to me the same as /2.

Well we are talking at cross-purposes then. I saw only one context
and in that context >>1 is not known to be the same as /2.

For me
that is. However I do not give bonus points to someone using >>1 for
them being "elite".


Having said that, I'd even go as far as to say that they are *not* as
quite clear as each other. You have to know more about the code to be
sure that >>1 is doing what you want than do with /2. The particular

Obviously - I assumed we had that covered.

Well I am glad we agree about that (the bit you call obvious) but I
had not assumed that we had it covered. I had been assuming the OP's
code where it was, in fact, not covered.

<snip>
I can't get worked up about layout, just as I can't get worked up
about the return type of main. Both are trivial to fix. I once

No they are not. They are far from trivial to fix and layout and
refactoring ofetn introduce many bugs because of human error. In *my*
experience of *large* projects with *many* programmers then a consistent
layout and debugger friendly layout is a must. Fixing layout means
checking out, fixing, submitting for testing etc.

Why? I am suggesting using a tool, just prior to checking the code
into the code base. I agree that sticking to one layout is best --
don't get me wrong -- but I don't see why any more testing is called
for. Why would there be "human error"?

<snip>
I
really don't want to hear from the usual suspects about how they once
debugged 5000000 lines by simply reading the code as if that somehow
meant a debugger was useless for all.

Yes, that would be an extraordinary conclusion to draw from such a
story but, as far as I can tell, the only people every to have
suggested it are people in the pro-debugger camp who want to

pro-debugger? You mean anti-debugger?

No.

over-state the opposing case. Everyone who expressed the view that
they find a debugger less that essential (for things other than a
back-trace) seemed to accept that this was a personal preference.

That is most certainly not the case. The case supported by most regs was
based on the fact that they personally rarely used a debugger. And my
opinion of this was that most were simply posing or really had no clue
how to properly use one.

Let me get this right. You are repeating your rather diffuse
accusations of dishonesty[1]. They *say* it is personal preference,
but you don't really believe that[2]?

As one of the people whose "honesty and motivations" I thought you
were questioning before -- you never said exactly who -- I want to be
sure I have got that right.

It is impossible for a debugger to make your
life harder. It can only help. The rest is really a natural conclusion
and follow on.

I'd debate that except you seem to have made your mind up.

[1] "I seriously question the honesty and motivations of anyone here
who, as professional programmers, claim to debug such code by
reading..." in <frbgnk$9q5$1@xxxxxxxxxxxxxxxxxxxxxxxxx>.

[2] Putting aside the allowance you make for those who are honest but
clueless.

--
Ben.
.



Relevant Pages

  • Re: How to print an array of char backward.
    ... does not understand something x&1 or shift right/left then they have no ... My point here is that it would not for me in the context of the ... I can't get worked up about layout, just as I can't get worked up ... layout and debugger friendly layout is a must. ...
    (comp.lang.c)
  • Re: when laypersons look smarter than math professors Re: a question for the anti-Cantorians
    ... I choose the axioms of the programming language Haskell. ... Section 2.7 gives an informal discussion of the layout rule. ... indicating that the enclosing context is explicit (i.e. the ... that an explicit close brace can only match an explicit open brace. ...
    (sci.logic)
  • Re: GetThreadContext and debug register problem
    ... debugger while my app is executing. ... debugger could go into debug mode is setting debug registers and generating ... CONTEXT structure, and then pass it to SetThreadContext. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: GetThreadContext and debug register problem
    ... A decent app should not care about debugger. ... debugger could go into debug mode is setting debug registers and ... originally used the kernel debug to trigger the debug registers as I ... CONTEXT structure, and then pass it to SetThreadContext. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: You cowboys were right
    ... because I only had to design for certain DOM structures and styles ... different DOM structures as it possibly can. ... will work in a given layout. ... context, context. ...
    (comp.lang.javascript)