Learning C online?

R

Richard Heathfield

Richard Bos said:

So now you call me a liar? If I were you, I'd check the slander laws in
your country.

"Slander" is usually used to describe spoken slurs. Written slurs are more
normally termed "libel".
 
Z

Zach

Zach said:



No, it isn't.

If you'd like a list of reasons, let me know. If you'd rather save time and
just have the answer to your original question, check these out:

Morning Richard,

I am curious why that site is substandard in your view.
Steve Summit's excellent, and rather gentle, tutorial can be found at
<http://www.eskimo.com/~scs/cclass/>; the serious C student will benefit
most from this tutorial if he or she has a copy of "The C Programming
Language", 2nd edition, by Kernighan and Ritchie. Tom Torfs takes a rather
more austere approach; this doesn't suit everybody, but many people have
found it extremely helpful. His tutorial can be found at
<http://cprog.tomsweb.net/cintro.html>.

Thanks. I have a copy of K&R 2nd Ed but it was printed in India on
rather cheap acidic paper which is now terrribly yellowed and brittle.
Are we allowed to post questions in this channel about the K&R
Exercise? I saw there is an official answer book but it costs $60 or
some insane price for such a small book!
Essential reference: "The C Programming Language", 2nd Ed. Kernighan &
Ritchie. Prentice Hall, 1988. ISBN 0-13-110362-8 (paperback), or
0-13-110370-9 (hardback) - will pay for itself many times over during the
course of your programming career.

I will invest in a new copy thanks. Is a 3rd Edition planned or have
the recent additions to the ANSI standard not been sufficient to
warrant coverage in a new edition?

Zach
 
R

Richard Heathfield

Richard said:
It's perfectly easy to see how he is misrepresenting him. Reading code
is NOT the same as debugging code. The fact that I agree with Jacob for
pretty much all but the most trivial code is not the point. The point is
that Jacob was talking about debugging largish programs - not reading
the code.

In the following two paragraphs, "you" is "generic you".

If we may take it as read that nobody deliberately puts bugs into programs,
it may reasonably be concluded that *any* bug in a program represents a
failure of understanding of the code on the part of the programmer
responsible for that program. That is, even if you fully understand what
is meant to happen, the existence of the bug indicates that you don't
fully understand what is /actually/ happening. (If you did, you'd go
straight to the right place and fix the code!)

So debugging is a voyage of discovery - of increasing your understanding of
the code. You *cannot* debug code effectively without understanding that
code, and you *cannot* understand that code effectively if you have not
read (or even cannot read) that code. On the other hand, if you can read
the code and gain a full understanding of it, you can fix the bug.

Now, personally I *have* debugged quite a few programs written by other
people, a program of many more than 2000 lines, without using a debugger.
So I know it's possible to do so, if you are capable of reading and
understanding code. I'm not claiming that you can *always* do it, but you
can certainly do it sometimes. But Jacob Navia's claim is that you can
*never* do it. This does suggest that he can't read and understand
programs that big - because, if he could, he would surely have been able
to debug one or two of them at least, and therefore he would not have made
the "impossible" claim.

It is very likely that Richard Bos used reasoning of this kind when making
his statement. Since it's so obvious, he made the mistake of not spelling
it out. (In this group, it is often necessary to spell out the blindingly
obvious - and even then, some people don't get it.)

In fact from this discussion I would trust Jacob more that Richard since
he believes in using the right tools for the job rather than some
reliance on "reading the code"

I, too, believe in using the right tools for the job. The difference
between us appears to be that I don't normally consider the debugger to be
the right tool for the job (but I do accept that it is /sometimes/ the
right tool for the job), *for me*. I am quite happy to accept that
different people find different debugging techniques more effective.
Clearly, you find using a debugger to be very effective. Great! I salute
you for identifying and using a tool that you find useful. But I don't
quite understand your vehemence in suggesting that debugging *cannot* be
done effectively without such a tool.
or doing the awful printf and assert
approach which leads to heisenbugs.

In my experience, the infuriating nature of a Heisenbug is that the code
fails to work *unless* you execute it in a debugger. I've had that happen
to me quite a few times. This in itself makes debuggers less useful to me
than I'd like them to be.

No he doesn't.

Clearly, opinions differ.
Who appointed you judge and jury?

Where did I claim to be a judge and jury?
Richard is the man
making allegations about Jacob being "incapable" of reading code. This
was a lie. Pure and simple.

It is a reasonable interpretation of a statement made by Jacob Navia.
So, maybe YOU should apologise?

Maybe I should, and maybe I shouldn't. Perhaps you should make it clear
what it is that you think I should maybe apologise for.
Where do you get off slandering Jacob all the time? Amazing.

Cite?
 
S

santosh

Richard said:
Sometimes you astonish me Santosh :-;

It seems only the past couple of days we argued about Knuth's
suitability for a new programmer ... No. It can't have happened.

I never claimed Knuth was suitable for beginners, except for those well
above average. I think you have me confused with Joseph Hallet, Ben
Bacarisse, user923005 and others.

And in this case, yes, IMO /The C Book/ is rather harder to follow than
K&R2 for someone not already familiar with a bit of programming.
 
R

Richard

Richard Heathfield said:
Richard said:


In the following two paragraphs, "you" is "generic you".

If we may take it as read that nobody deliberately puts bugs into programs,
it may reasonably be concluded that *any* bug in a program represents a
failure of understanding of the code on the part of the programmer
responsible for that program. That is, even if you fully understand what
is meant to happen, the existence of the bug indicates that you don't
fully understand what is /actually/ happening. (If you did, you'd go
straight to the right place and fix the code!)

So debugging is a voyage of discovery - of increasing your understanding of
the code. You *cannot* debug code effectively without understanding that
code, and you *cannot* understand that code effectively if you have
not

This is not true. Lots of bugs are something as simple as passing the
wrong parameter to an API function. No understanding of the rest of the
code required. Catch bug. Look at stack, look at API doc. Aha!
Fixed. Check in. Test. Sign off.
read (or even cannot read) that code. On the other hand, if you can read
the code and gain a full understanding of it, you can fix the bug.

Yes. Your point being? You are unable to debug with a debugger properly
if you cant "read" the code too. What are you talking about? All the
above is the obvious.
Now, personally I *have* debugged quite a few programs written by other
people, a program of many more than 2000 lines, without using a
debugger.

Good for you. I wouldn't waste my time. A debugger would make it a LOT
quicker in MOST cases.
So I know it's possible to do so, if you are capable of reading and

Anything is "possible".
understanding code. I'm not claiming that you can *always* do it, but
you

Good. Because that would be a lie.
can certainly do it sometimes. But Jacob Navia's claim is that you can

"Sometimes" is a long way from "always".
*never* do it. This does suggest that he can't read and understand

That claim is NOT the issue and is clearly a bit of hyperbole. You are
moving the goalposts. Again.
programs that big - because, if he could, he would surely have been able
to debug one or two of them at least, and therefore he would not have made
the "impossible" claim.

Maybe he exaggerated a little? Maybe, like me, he simply would NEVER
bother trying to show off and read that much code and debug it in his
head? I know I wouldnt. I would print it out, mark a few key areas off
with a pencil and then power up the debugger. But thats me. And probably
Jacob. And yes, I would bet that given a printout of 3000 lines of code
that I could debug it with a debugger quicker than you and Bos could do
it in your head. Its why debuggers exist.
It is very likely that Richard Bos used reasoning of this kind when making
his statement. Since it's so obvious, he made the mistake of not
spelling

Then his reasoning is wrong. In fact it was purposely wrong. He posted
with malice aforethought pure and simple. There was nothing "obvious".

No one without an agenda would convert Jacobs statement about always
using a debugger on large code bases to not being able to read a large
code base and then purposely follow up to someones post and deliberately
libel Jacob's abilities.
it out. (In this group, it is often necessary to spell out the blindingly
obvious - and even then, some people don't get it.)

Indeed.

Why you are defending a black and white case of purposeful mischief is
quite beyond me. Richard Bos quite clearly twisted the facts in order to
discredit Jacob and for that reason joins "Chuck" in my killfile -
something I rarely use except for the biggest jerks and malicious
posters.
 
R

Richard

santosh said:
I never claimed Knuth was suitable for beginners, except for those well
above average. I think you have me confused with Joseph Hallet, Ben
Bacarisse, user923005 and others.

And in this case, yes, IMO /The C Book/ is rather harder to follow than
K&R2 for someone not already familiar with a bit of programming.

I'm old fashioned. I know from experience and general data gathered in
years of industry that K&R2 is *generally* the best there is for new C
programmers. It was for me and I am yet to meet anyone who didn't get at
least something from it.
 
B

Bartc

Richard Bos said:
The right question, given that its author is (by his own admission, in
that other thread) incapable of reading code beyond 2000 lines, whether
you should take that risk.

I think that was 'other people's code'.

I have the same problem but my limit is more like 100 lines.

As for lccwin32, it's free and worth a try.
 
J

jacob navia

Richard said:
jacob navia said:


"It is impossible for any human to debug a program written by others
without a debugger, of course if the program has a certain size
(bigger than, say, 1500 -2000 lines)" - Jacob Navia, in message
<[email protected]>

It's hard to see how Richard Bos is misrepresenting you.

So, You CITE me there writing
> "It is impossible for any human to DEBUG a program written by others
> without a debugger, of course if the program has a certain size
> (bigger than, say, 1500 -2000 lines)"

And then you CITE Bos telling

" its author is (by his own admission, in
that other thread) incapable of READING code beyond 2000 lines"

and you do NOT see the difference???????

WHO is lying here?
 
R

Richard

Bartc said:
I think that was 'other people's code'.

Another good point actually. Even if Bos was twisting the facts to
discredit Jacob and elevate his own standing in the clc clique.
I have the same problem but my limit is more like 100 lines.

Yup. Give me a debugger any day. Someone elses indentation, variable
naming standards etc? No way could I (economically) understand most
largish C program in a reasonable time without watching it step
through.

How many things can the average man manage in his mind at one time? 7?

And these guys are telling is they can spot a bug in 2000+ lines of
foreign code when its 30 minutes into executing? Stackes 20 calls deep?
Sure, some obvious things maybe like catching a "=" instead of an "==",
but something else like potential integer overflow when you have no idea
what numbers are ticking throug the system.

I'm sorry. I don't buy all this crap about reading thousands of lines
and not needing a debugger. Its nothing more than, as Jacob said, War
Stories in MOST cases.
 
R

Richard Heathfield

Zach said:
Morning Richard,

I am curious why that site is substandard in your view.

As many bugs as I can eat in five minutes:

* The site doesn't seem to draw a clear distinction between C and C++.

* "The following list shows all the ANSII defined C keywords. I have
included sizeof because it looks like a keyword and it keeps the table
below tidy...." - let's forgive the misspelling of ANSI, but why the
distinction for sizeof? It *is* a keyword.

* "The order (precedence) that operators are evaluated can be seen here." -
order of evaluation has little to do with precedence - the only relation
between them is kind of accidental.

* "C has three types of statement." - six, actually: the labeled-statement,
the expression-statement, the compound-statement, the selection-statement,
the iteration-statement and the jump-statement.

* "When a local variable is defined - it is not initalised by the system,
you must initalise it yourself." - not true for static objects. Locality
is to do with scope, not duration, and static objects can be local.
Nevertheless, they *are* default-initialised if you do not specify an
initialiser.

* "double is used to define BIG floating point numbers. It reserves twice
the storage for the number." - ISO imposes no such requirement on
implementations.

* "An operator must have operands of the same type before it can carry out
the operation." - not true. Consider, for example, the expression p +=
strlen(s); where += takes a pointer as its left operand, but a size_t as
its right operoh dear, that's your five minutes.
Are we allowed to post questions in this channel
group

about the K&R Exercise?
Yes.

I saw there is an official answer book but it costs $60 or
some insane price for such a small book!

See also http://clc-wiki.net/wiki/ which contains a K&R answers section.
I will invest in a new copy thanks. Is a 3rd Edition planned or have
the recent additions to the ANSI standard not been sufficient to
warrant coverage in a new edition?

Last I heard, the answer was that no third edition is planned. (The C99
changes would have been significant if there had been widespread take-up
of that Standard by implementors, but there hasn't been.)
 
R

Richard

jacob navia said:
So, You CITE me there writing

And then you CITE Bos telling

" its author is (by his own admission, in
that other thread) incapable of READING code beyond 2000 lines"

and you do NOT see the difference???????

WHO is lying here?

I thought for one minute that Heathfield was improving. I was
wrong. He's still an ego driven big head with no agenda other than
furthering his own agenda and discrediting others at every
opportunity. This thread has proven that without a shadow of a doubt. I
am truly astonished he has supported Bos when he is so clearly ignoring
the evidence and the obvious meanings of what was said.
 
J

jacob navia

Richard said:
If you can read code, you can debug it.

Sure

Yes. No problems. You just read it, then, all bugs surface
and you do not need a debugger Mr Superman.

THEN, you put your Clarck Kent clothes and there you go,
Richard Bos is there.
> If you cannot debug code without
a debugger, you cannot truly be said to be capable of reading it.

Yeah obvious. I am not a computer, yes, my fault.
Glancing at it, perhaps. Browsing it. But reading implies the text going
through the brain as well as the eyes.

My BRAIN, yes, but there is NO computer in my brain.

YOU of course, you ARE a computer.
So now you call me a liar? If I were you, I'd check the slander laws in
your country.

A liar is a liar is a LIAR!

READING code is not DEBUGGING code moron!
 
R

Richard Heathfield

Richard said:
This is not true.

If you believe that (and I have no reason to believe that you don't), then
I don't think we have sufficient common ground to justify holding a
reasoned discussion about this.

<snip>
 
J

jacob navia

Richard said:
Richard said:


If you believe that (and I have no reason to believe that you don't), then
I don't think we have sufficient common ground to justify holding a
reasoned discussion about this.

<snip>

Hey Heathfield, better answer my reply and do not go silent again OK?

Here is my reply again incase you forgot:

So, You CITE me there writing
> "It is impossible for any human to DEBUG a program written by others
> without a debugger, of course if the program has a certain size
> (bigger than, say, 1500 -2000 lines)"

And then you CITE Bos telling

" its author is (by his own admission, in
that other thread) incapable of READING code beyond 2000 lines"

and you do NOT see the difference???????

WHO is lying here?


Or you are saying that debugging is the same as reading?
 
R

Richard Heathfield

Richard said:

I thought for one minute that Heathfield was improving. I was
wrong.

No, you were right - I'm improving all the time. It's just that what you
think of as "improving" and what I think of as "improving" are obviously
very different.
He's still an ego driven big head with no agenda other than
furthering his own agenda and discrediting others at every
opportunity.

If that were true, I would be attacking Richard Bos, rather than supporting
him.
 
J

jacob navia

Richard said:
jacob navia said:



I'm not entirely sure that I would want to trust my code base to someone
whose contributions to a discussion consist largely of insults, shouting,
and abuse.

When I write:
> "It is impossible for any human to DEBUG a program written by others
> without a debugger, of course if the program has a certain size
> (bigger than, say, 1500 -2000 lines)"

And you CITE Bos telling

" its author is (by his own admission, in
that other thread) incapable of READING code beyond 2000 lines"

and you do NOT see the difference???????

WHO is lying here?
 
R

Richard Heathfield

jacob navia said:

A liar is a liar is a LIAR!

READING code is not DEBUGGING code moron!

I'm not entirely sure that I would want to trust my code base to someone
whose contributions to a discussion consist largely of insults, shouting,
and abuse.
 
R

Richard

jacob navia said:
When I write:


And you CITE Bos telling

" its author is (by his own admission, in
that other thread) incapable of READING code beyond 2000 lines"

and you do NOT see the difference???????

WHO is lying here?

Jacob, ignore him. Heathfield is trolling. He must be. No one could
support Bos's claims in this thread - it's quite clue that his self
regard eclipses that of even RH.
 
J

jacob navia

jacob said:
So, You CITE me there writing

And then you CITE Bos telling

" its author is (by his own admission, in
that other thread) incapable of READING code beyond 2000 lines"

and you do NOT see the difference???????

WHO is lying here?

NOTE:

Heathfield is unable to answer this post. Even if I posted it to him
3 times...

:)
 
R

Richard Heathfield

jacob navia said:

Hey Heathfield, better answer my reply and do not go silent again OK?

Mr Navia, if you must address me in person, kindly have the courtesy to
address me properly.

I did not post an answer to your previous reply ("So, You CITE me there
writing...") because I had already posted another reply in the same
thread, explaining my point of view with regard to the relationship
between reading and debugging, so it seemed superfluous to write the same
stuff all over again in a reply to your article.

What's more, just as you have the right either to reply or not to reply to
particular articles, so do I have that right. There is no need for me to
reply to every article, not even every article that is a reply to one of
mine. (If everyone replied to every reply to their articles, ... well, do
the math.) You get to decide which articles you write, and I get to decide
which articles I write.
Here is my reply again incase you forgot:

I have already explained my position elsethread.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top