Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Learning C online?

Reply
Thread Tools

Learning C online?

 
 
Richard Heathfield
Guest
Posts: n/a
 
      03-13-2008
Richard Bos said:

<snip>

> 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".

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
 
Reply With Quote
 
 
 
 
Zach
Guest
Posts: n/a
 
      03-13-2008
On Mar 13, 2:56 am, Richard Heathfield <r...@see.sig.invalid> wrote:
> Zach said:
>
> > What are the best websites (or HTML or PDF free books available for
> > download and if so where) for learning C?

>
> > Is this a good site:
> >http://www.space.unibe.ch/comp_doc/c_manual/C/cref.html

>
> 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
 
Reply With Quote
 
 
 
 
Richard Heathfield
Guest
Posts: n/a
 
      03-13-2008
Richard said:

> Richard Heathfield <> writes:
>
>> jacob navia said:
>>
>>> Richard Bos wrote:

<snip>
>>>>
>>>> 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.
>>>>
>>>> Richard
>>>
>>> You are just telling lies.

>>
>> "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
>> <fr93d2$bpq$>
>>
>> It's hard to see how Richard Bos is misrepresenting you.

>
> 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.


>>> You are then, a liar.

>>
>> Richard Bos and I don't always see eye to eye (in fact, I believe I'm in
>> his killfile), but he strikes me as being an honorable man, and he is
>> most certainly *not* a liar. You owe him an apology. But don't you worry
>> about that - just add it to the (rather high and unstable) pile.

>
> 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?

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      03-13-2008
Richard wrote:

> santosh <> writes:
>
>> WANG Cong wrote:
>>
>>> On Wed, 12 Mar 2008 15:43:22 -0700?Zach wrote?
>>>
>>>> What are the best websites (or HTML or PDF free books available for
>>>> download and if so where) for learning C?
>>>>
>>>
>>> I recommend The C Book, which is available at:
>>> http://publications.gbdirect.co.uk/c_book/

>>
>> This isn't suitable for a complete beginner though. IME it's even
>> harder than K&R2 for someone new to programming.

>
> 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.

 
Reply With Quote
 
Richard
Guest
Posts: n/a
 
      03-13-2008
Richard Heathfield <> writes:

> Richard said:
>
>> Richard Heathfield <> writes:
>>
>>> jacob navia said:
>>>
>>>> Richard Bos wrote:

> <snip>
>>>>>
>>>>> 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.
>>>>>
>>>>> Richard
>>>>
>>>> You are just telling lies.
>>>
>>> "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
>>> <fr93d2$bpq$>
>>>
>>> It's hard to see how Richard Bos is misrepresenting you.

>>
>> 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


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.
 
Reply With Quote
 
Richard
Guest
Posts: n/a
 
      03-13-2008
santosh <> writes:

> Richard wrote:
>
>> santosh <> writes:
>>
>>> WANG Cong wrote:
>>>
>>>> On Wed, 12 Mar 2008 15:43:22 -0700?Zach wrote?
>>>>
>>>>> What are the best websites (or HTML or PDF free books available for
>>>>> download and if so where) for learning C?
>>>>>
>>>>
>>>> I recommend The C Book, which is available at:
>>>> http://publications.gbdirect.co.uk/c_book/
>>>
>>> This isn't suitable for a complete beginner though. IME it's even
>>> harder than K&R2 for someone new to programming.

>>
>> 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.


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.
 
Reply With Quote
 
Bartc
Guest
Posts: n/a
 
      03-13-2008

"Richard Bos" <> wrote in message
news:...
> santosh <> wrote:
>
>> Zach wrote:
>>
>> > On Mar 12, 7:13 pm, jacob navia <ja...@nospam.com> wrote:
>> >>
>> >> You can download my tutorial, and the compiler that goes with it.
>> >> It is an easy system to install (6MB download, 30 second install)
>> >> and I try to explain things from the ground up.
>> >>
>> >> http://www.cs.virginia.edu/~lcc-win32
>> >
>> > I use a Linux OS.

>>
>> You can still use lcc-win32 (and it's executables) under WINE in Linux.

>
> 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.

--
Bart


 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      03-13-2008
Richard Heathfield wrote:
> jacob navia said:
>
>> Richard Bos wrote:
>>> santosh <> wrote:
>>>
>>>> Zach wrote:
>>>>
>>>>> On Mar 12, 7:13 pm, jacob navia <ja...@nospam.com> wrote:
>>>>>> You can download my tutorial, and the compiler that goes with it.
>>>>>> It is an easy system to install (6MB download, 30 second install)
>>>>>> and I try to explain things from the ground up.
>>>>>>
>>>>>> http://www.cs.virginia.edu/~lcc-win32
>>>>> I use a Linux OS.
>>>> You can still use lcc-win32 (and it's executables) under WINE in Linux.
>>> 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.
>>>
>>> Richard

>> You are just telling lies.

>
> "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
> <fr93d2$bpq$>
>
> 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?

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
 
Reply With Quote
 
Richard
Guest
Posts: n/a
 
      03-13-2008
"Bartc" <> writes:

> "Richard Bos" <> wrote in message
> news:...
>> santosh <> wrote:
>>
>>> Zach wrote:
>>>
>>> > On Mar 12, 7:13 pm, jacob navia <ja...@nospam.com> wrote:
>>> >>
>>> >> You can download my tutorial, and the compiler that goes with it.
>>> >> It is an easy system to install (6MB download, 30 second install)
>>> >> and I try to explain things from the ground up.
>>> >>
>>> >> http://www.cs.virginia.edu/~lcc-win32
>>> >
>>> > I use a Linux OS.
>>>
>>> You can still use lcc-win32 (and it's executables) under WINE in Linux.

>>
>> 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'.


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.
 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      03-13-2008
Zach said:

> On Mar 13, 2:56 am, Richard Heathfield <r...@see.sig.invalid> wrote:
>> Zach said:
>>
>> > What are the best websites (or HTML or PDF free books available for
>> > download and if so where) for learning C?

>>
>> > Is this a good site:
>> >http://www.space.unibe.ch/comp_doc/c_manual/C/cref.html

>>
>> 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.


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.)

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[I'm learning C]: Learning to use ucontext Andrey Popp C Programming 5 01-31-2012 01:05 AM
Learning C and Learning Make/Configure/Building/Linking Hal Vaughan C Programming 7 03-21-2006 05:07 PM
e-learning, (collaborative learning environment) collinm Java 1 09-08-2005 09:52 PM
Learning about SMS technology... VM Wireless Networking 2 07-02-2004 02:36 PM
learning VHDL Vilvox VHDL 5 07-20-2003 08:59 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57