K&R2 Still good?

R

rajiv.battula

Hey everyone,

I am a Java programmer, somewhere between novice to advanced. I wanted
to know if it is still recommended to read "The C Programming
Language" 2nd Edition? This edition was released in 1988, it is now
2007, almost 20 years. Also, since it is so old, is there some
supplemental tutorial recommend to go along with it? Thanks for your
advice.

Rajiv Battula
 
S

santosh

Hey everyone,

I am a Java programmer, somewhere between novice to advanced. I wanted
to know if it is still recommended to read "The C Programming
Language" 2nd Edition? This edition was released in 1988, it is now
2007, almost 20 years. Also, since it is so old, is there some
supplemental tutorial recommend to go along with it? Thanks for your
advice.

The book remains an excellent introduction to C. Keep in mind that C99
hasn't yet been implemented completely and widely and probably never
will. After you go through K&R2, and do all the exercises, you'll be
proficient enough to read and understand the Standard itself, (or a
draft of it), and work out the details of C99 and it's extras.

Here are some resources:

Books:
======

1. The C Programming Language Second Edition by Kernighan and Ritchie
2. C: A Reference Manual by Harbison and Steele
3. C Unleashed by Heathfield, Kirby et al.
4. Expert C Programming by Peter Van der Linden

Online tutorials:
=================

Steve Summit's C notes:
<http://www.eskimo.com/~scs/cclass/>

Tom Torf's C resources:
<http://cprog.tomsweb.net/>

Also Steve Summit maintains the very useful C FAQ:
<http://www.c-faq.com/>

There's also a clc "wiki":
<http://clc-wiki.net/>

Other resources include:

<http://www.lysator.liu.se/c/>
<http://www.dinkumware.com/manuals/>
<http://www-ccs.ucsd.edu/c/>
<http://www.open-std.org/jtc1/sc22/wg14/>
<http://www.knosof.co.uk/cbook/cbook.html>
<http://www.cpax.org.uk/prg/portable/c/index.php>
 
R

Rajiv Battula

The book remains an excellent introduction to C. Keep in mind that C99
hasn't yet been implemented completely and widely and probably never
will. After you go through K&R2, and do all the exercises, you'll be
proficient enough to read and understand the Standard itself, (or a
draft of it), and work out the details of C99 and it's extras.

Here are some resources:

Books:
======

1. The C Programming Language Second Edition by Kernighan and Ritchie
2. C: A Reference Manual by Harbison and Steele
3. C Unleashed by Heathfield, Kirby et al.
4. Expert C Programming by Peter Van der Linden

Online tutorials:
=================

Steve Summit's C notes:
<http://www.eskimo.com/~scs/cclass/>

Tom Torf's C resources:
<http://cprog.tomsweb.net/>

Also Steve Summit maintains the very useful C FAQ:
<http://www.c-faq.com/>

There's also a clc "wiki":
<http://clc-wiki.net/>

Other resources include:

<http://www.lysator.liu.se/c/>
<http://www.dinkumware.com/manuals/>
<http://www-ccs.ucsd.edu/c/>
<http://www.open-std.org/jtc1/sc22/wg14/>
<http://www.knosof.co.uk/cbook/cbook.html>
<http://www.cpax.org.uk/prg/portable/c/index.php>

Thanks for the resources, I have seen Steve Summit's FAQ but not the
notes or any of the other great links. Had a question, if C99 is a
standard why don't compilers implement it? Is it because it's features
are hard to implement?
 
M

Mike Wahler

Had a question, if C99 is a
standard why don't compilers implement it? Is it because it's features
are hard to implement?

The way I see it, it's because there is (so far) not
much demand for it.

-Mike
 
F

Flash Gordon

Rajiv Battula wrote, On 07/10/07 17:43:

Thanks for the resources, I have seen Steve Summit's FAQ but not the
notes or any of the other great links. Had a question, if C99 is a
standard why don't compilers implement it? Is it because it's features
are hard to implement?

Well, *some* compilers do implement it (more strictly some
implementations, since the library is part of the implementation but
often separate from the compiler).

There have been various discussions here on why C99 has taken a long
time to implement. There was a strong demand for the original standard
because before then it was hard to write portable code as all compilers
behaved differently. With C99 there was not the same demand since we
*already* had a portable language.
 
S

santosh

Had a question, if C99 is a standard why don't compilers implement it?
Is it because it's features are hard to implement?

Most of the additions are not particularly hard to implement. There have
been repeated debates about the possible reasons for C99's slow
acceptance by posters far more knowledgeable than me on the subject. A
quick Google Groups search of this group and comp.std.c will turn up
many of these interesting discussions.

A reasonable view seems to be that many of C99's features were not
really in demand by the programming community. In parallel the rise of
C++ attracted many of the implementors and programmers who would have
otherwise put their efforts into C99. Absence of wide availability
seems to have acted as a kind of "negative feedback loop" and turned
away yet more developers.

A few commercial compilers like Comeau and some Standard libraries like
Dinkunware do claim full conformance. However the total lack of
interest shown by Microsoft and the rather reluctant support by gcc
have been important obstacles in C99 widespread acceptance.
 
C

Chris Hills

Had a question, if C99 is a standard why don't compilers implement it?
Is it because it's features are hard to implement?

Most of the additions are not particularly hard to implement. There have
been repeated debates about the possible reasons for C99's slow
acceptance by posters far more knowledgeable than me on the subject. A
quick Google Groups search of this group and comp.std.c will turn up
many of these interesting discussions.

A reasonable view seems to be that many of C99's features were not
really in demand by the programming community. In parallel the rise of
C++ attracted many of the implementors and programmers who would have
otherwise put their efforts into C99. Absence of wide availability
seems to have acted as a kind of "negative feedback loop" and turned
away yet more developers.

A few commercial compilers like Comeau and some Standard libraries like
Dinkunware do claim full conformance. However the total lack of
interest shown by Microsoft and the rather reluctant support by gcc
have been important obstacles in C99 widespread acceptance.
[/QUOTE]

Irrespective of Microsoft most of the major compiler makers for targets
other than the Pc desktop, where C is still the main language have not
bothered with C99 either.
 
R

Rajiv Battula

writes







Irrespective of Microsoft most of the major compiler makers for targets
other than the Pc desktop, where C is still the main language have not
bothered with C99 either.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ (e-mail address removed) www.phaedsys.org\/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

I see, so there is little demand for C99. Well, thanks for the input
and advice everyone. I guess I will buy K&R2 after all.
 
T

Tor Rustad

Hey everyone,

I am a Java programmer, somewhere between novice to advanced. I wanted
to know if it is still recommended to read "The C Programming
Language" 2nd Edition? This edition was released in 1988, it is now
2007, almost 20 years.

To my mind, K&R2, is one of the best programming books ever written, and
C89 is what most people still use today.

Get it... now! :)
 
T

Tor Rustad

santosh wrote:

[...]
Here are some resources:

Books:
======

1. The C Programming Language Second Edition by Kernighan and Ritchie
2. C: A Reference Manual by Harbison and Steele
3. C Unleashed by Heathfield, Kirby et al.
4. Expert C Programming by Peter Van der Linden

This is a FAQ, see Q 18.10.

[3] Received only a "recommended with reservations" by ACCU.
http://accu.org/index.php/book_reviews?url=view.xqy?review=c002280&term=advanced+c


and [2] and [4] are not for beginners.
 
R

Richard Heathfield

[This article contains a review of a review about "C Unleashed". I must of
course register an interest, since I was the lead author on that book, so
you should read this article with that in mind. Nevertheless, I haven't
actually received any income from sales of the book for some years, and I
doubt very much whether that situation will change, no matter what I write
here. Consequently, I think that the time is right to answer the review in
detail, which I can't recall doing before.

Is this article a defence of the book? Yes, it is, although I am being as
objective as I can be. But is this article an attempt to protect or extend
a revenue stream? No, it isn't. I'm too pragmatic to fool myself that
anything I say here will have any effect on my income from the book. In
any case, caveat lector.]

Tor Rustad said:
santosh wrote:

[...]
Here are some resources:

Books:
======

1. The C Programming Language Second Edition by Kernighan and Ritchie
2. C: A Reference Manual by Harbison and Steele
3. C Unleashed by Heathfield, Kirby et al.
4. Expert C Programming by Peter Van der Linden

This is a FAQ, see Q 18.10.

[3] Received only a "recommended with reservations" by ACCU.
http://accu.org/index.php/book_reviews?url=view.xqy?review=c002280&term=advanced+c

Very true. Francis has never forgiven the authors for writing a book about
C instead of C++. :)

Seriously, the reservations he had were/are:

1) only one short chapter on C99.

This is of course quite true. The chapter in question was written by Peter
Seebach, who was a member of ISO at the time the book was published (and
still is, for all I know). In 1999, the C community (or at least that part
of it that is voluble on Usenet) was quite optimistic about C99, and so it
is not unreasonable to complain that C99 was under-represented in CU.
Eight years on, I can't help wondering whether C99 is actually given a bit
too much space, given that implementors have all but ignored it.

2) "many of the topics covered in this book are no longer the natural
domain of C".

Perhaps. But my own view is rather different. I think of programming
languages as representing ways of thinking about programming, and we have
different languages because we think in different ways. To someone for
whom C fits his or her mindset very well, the topics covered in the book
/are/ the natural domain of C. To those for whom other languages fit their
mindset better, obviously they will see those other languages as being
more suitable. Horses for courses.

3) "some of the co-authors seem to have a limited perspective. The chapter
on dealing with dates is a case in point."

An innate sense of diplomacy prevents me from commenting openly about this
point.

4) "The level of assumed reader expertise varies wildly from chapter to
chapter."

Yes, it does! In my own chapters, I took the view that the reader
understood the basic syntax of the language, and was sufficiently familiar
with C to be able to do things like split a program into multiple source
files, but had probably learned C the way many of us did - either ad hoc,
or from a programming teacher who had not bothered to learn the language
properly him- or herself. That was why I spent a little time attempting to
correct some common misconceptions.

5) "ISO C (and I do wish the authors would remember that that is what we
should call it.)"

Yes, it does kind of read as if we tossed a coin every time we mentioned
the standards body: "heads, ANSI; tails, ISO". Oops. (We didn't *actually*
do that, I promise! It just wasn't one of the things we considered
important enough to sort out in advance.)

Those were pretty much the only negative comments about the book. The rest
of the review was reasonably positive.
and [2] and [4] are not for beginners.

Neither is [3]!
 
R

Richard

santosh said:
1. The C Programming Language Second Edition by Kernighan and Ritchie

Excellent. Best tutorial approach of ANY technical book IMO.
2. C: A Reference Manual by Harbison and Steele

A reference and not for the new C programmer IMO.
3. C Unleashed by Heathfield, Kirby et al.

Not printed anymore afaik. Also I wouldn't recommend it for a new C
programmer. It is disjoint in that it is the work of a few professional
programmers all singing from different song sheets. A good reference
mind you and certainly informative.
4. Expert C Programming by Peter Van der Linden

Excellent. I would recommend this with K&R2 for any budding C
programmer. This is a fun book to read and deals with real issues.
 
R

Richard Heathfield

Richard said:
Not printed anymore afaik.
Correct.

Also I wouldn't recommend it for a new C programmer.

Neither would I.
It is disjoint in that it is the work of a few professional
programmers all singing from different song sheets.

Much as I would like to disagree with you, I can't.
A good reference mind you and certainly informative.

I agree with every word you have said here, but I still defend your right
to say it.
Excellent. I would recommend this with K&R2 for any budding C
programmer. This is a fun book to read and deals with real issues.

I'm less enthusiastic than most clc-ers about this book, although I won't
deny that it's an entertaining romp. (And how often can you say that about
a book on computer programming?)
 
D

Default User

Richard said:
Richard said:


Correct.


It's often available from libraries, for instance both my company
library and the local public library have copies.




Brian
 
S

santosh

Richard Heathfield wrote:

Tor Rustad said:
santosh wrote:

[...]
Here are some resources:

Books:
======

1. The C Programming Language Second Edition by Kernighan and
Ritchie
2. C: A Reference Manual by Harbison and Steele
3. C Unleashed by Heathfield, Kirby et al.
4. Expert C Programming by Peter Van der Linden
and [2] and [4] are not for beginners.

Neither is [3]!

Well, neither is [1]. K&R assume previous exposure to basic programming.
In fact most beginners seem to have a rather hard time with it,
particularly with solving the exercises.
 
T

Tor Rustad

Richard Heathfield wrote:
[...]
Tor Rustad said:
santosh wrote:

[...]
Here are some resources:

Books:
======

1. The C Programming Language Second Edition by Kernighan and Ritchie
2. C: A Reference Manual by Harbison and Steele
3. C Unleashed by Heathfield, Kirby et al.
4. Expert C Programming by Peter Van der Linden
This is a FAQ, see Q 18.10.

[3] Received only a "recommended with reservations" by ACCU.
http://accu.org/index.php/book_reviews?url=view.xqy?review=c002280&term=advanced+c

Very true. Francis has never forgiven the authors for writing a book about
C instead of C++. :)

I'm not going to defend the ACCU review, some valid point was given, but
I do think the little C99 coverage, made it drop a category, which IMO
was rather unfair.
and [2] and [4] are not for beginners.

Neither is [3]!

It depends on the chapter, some topics was advanced, but not covered in
depth. The book would have been more interesting, if some chapters had
been dropped, and others had greater technical detail.

IIRC, no systems programming, and a very weak coverage of interesting
topics/chapters like optimization and encryption. I also slept through
the CGI and TCP/IP chapters. <g>
 
R

Rajiv Battula

Richard Heathfield wrote:

[...]


Tor Rustad said:
santosh wrote:
[...]
Here are some resources:
Books:
======
1. The C Programming Language Second Edition by Kernighan and Ritchie
2. C: A Reference Manual by Harbison and Steele
3. C Unleashed by Heathfield, Kirby et al.
4. Expert C Programming by Peter Van der Linden
This is a FAQ, see Q 18.10.
[3] Received only a "recommended with reservations" by ACCU.

Very true. Francis has never forgiven the authors for writing a book about
C instead of C++. :)

I'm not going to defend the ACCU review, some valid point was given, but
I do think the little C99 coverage, made it drop a category, which IMO
was rather unfair.
and [2] and [4] are not for beginners.
Neither is [3]!

It depends on the chapter, some topics was advanced, but not covered in
depth. The book would have been more interesting, if some chapters had
been dropped, and others had greater technical detail.

IIRC, no systems programming, and a very weak coverage of interesting
topics/chapters like optimization and encryption. I also slept through
the CGI and TCP/IP chapters. <g>

Why is that old books like, Effective C programming, are still
recommended (not trying to bash this book by the way)? I thought
computer books were supposed to be the latest and greatest? I am
guessing the answer is that computer "language" don't CHANGE as fast
as say, Operating Systems?
 
R

Richard Heathfield

Rajiv Battula said:

Why is that old books like, Effective C programming, are still
recommended (not trying to bash this book by the way)?

Because, in the olden days, books were very often written by People Who
Knew What They Were Talking About. That rarely happens any more. Now, most
books are written by People Whom The Publisher Doesn't Have To Pay Very
Much.
I thought computer books were supposed to be the latest and greatest?

Why did you think that?
I am guessing the answer is that computer "language" don't CHANGE as fast
as say, Operating Systems?

The underlying operating systems don't change all that quickly either,
actually. What tends to change fastest is the user interface - because
that's the trendy bit.

The question you have to ask yourself is this: which do you want to do?
Explore the transient delights of the latest trendy language or
protocol.... or learn how to write computer programs properly? If the
latter, then - whilst it's not *impossible* for good new books to appear
on occasion - you will normally do better to reach for the classics. For
example, "The Art of Computer Programming", "Algorithms + Data Structures
= Programs", and "The C Programming Language" - all should be either on
your bookshelf or open on your desk.
 
F

Friedrich Dominicus

Richard Heathfield said:
Rajiv Battula said:



Because, in the olden days, books were very often written by People Who
Knew What They Were Talking About. That rarely happens any more. Now, most
books are written by People Whom The Publisher Doesn't Have To Pay Very
Much.
Well there are exceptions to the rule. But I guess the publishers want
to keep their authors short... And well it also seem as if the authors
have to play for the rules of the publisher otherwise they are out.
Why did you think that?
This is really an interesting question ;-)

The underlying operating systems don't change all that quickly either,
actually. What tends to change fastest is the user interface - because
that's the trendy bit.

The question you have to ask yourself is this: which do you want to do?
Explore the transient delights of the latest trendy language or
protocol.... or learn how to write computer programs properly? If the
latter, then - whilst it's not *impossible* for good new books to appear
on occasion - you will normally do better to reach for the classics. For
example, "The Art of Computer Programming", "Algorithms + Data Structures
= Programs", and "The C Programming Language" - all should be either on
your bookshelf or open on your desk.
I'd add a few to this. Secure Coding for C and C++, Writing Secure
Code, Secure Programming Cookbook, Code Complete and books about
Software development in the large are still worth a lot...

Regards
Friedrich
 
C

Charlton Wilbur

RB> Why is that old books like, Effective C programming, are still
RB> recommended (not trying to bash this book by the way)? I
RB> thought computer books were supposed to be the latest and
RB> greatest? I am guessing the answer is that computer "language"
RB> don't CHANGE as fast as say, Operating Systems?

Because the old books, or at least the ones that have remained in
print, focus on what really matters about programming. There were
just as many bad books then as there are now, but the good books from
20 years ago have survived, while the bad books have been largely
forgotten.

It's the same reason that the only authors from the 1870s that anyone
has ever heard of are the good ones -- there was just as high a
proportion of garbage then as now, but time has filtered out the bad
ones.

Charlton
 

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

Forum statistics

Threads
474,263
Messages
2,571,062
Members
48,769
Latest member
Clifft

Latest Threads

Top