views:

217

answers:

8

I ask this question because the international standardization subcommittee for programming languages, or ISO/IEC JTC1/SC22 Programming languages, states on this page:

http://www.open-std.org/JTC1/SC22/WG14/www/standards

that Technical Corrigendum 3, the latest one, was published in 2007. Now I take it that this means the C language it self was changed and that the books and tutorials pre-2007 may contain outdated information. Please correct me if I am wrong.

Thanks, Adam

+1  A: 

This may be true, but that doesn't mean you shouldn't use resources from before them. It just means you should take what they say with a grain of salt.

Standard-changes generally do not affect the core ideas of the language itself, they just affect the specifics. So if you are just learning about the language in general, i.e. how to code simple things, getting a feel for the flow of the code, etc., you should be fine. I keep around a few of my dad's reference and textbooks from the mid-90's, and they haven't led me astray yet...

Of course, if you want to know specific technical information, or are releasing code for general use, you should probably read a little from the recent docs, yes.

Chris Cooper
+2  A: 

Some compilers don't even approach any compatibility with C99.

ANSI (C89) and even K&R C is going to stick around. C99 just cleans up a few rough spots and acknowledges that compilers can do more work for you.

Yann Ramin
+3  A: 

The Technical Corrigenda aren't changes to the language. They're simply corrections to the standard, the errata. For instance,

  1. Page 15, 5.1.2.3 In paragraph 12, last line in the code fragment, change: expressions to: expression

That particular example is from Technical Corrigendum 2, but it shouldn't be any different for the 3rd. So I would say books before 2007 are completely reliable with regards to Technical Corrigendum 3. Besides, most books aren't written strictly based on the standard anyway, and are likely to have more errors of their own than errors propagated from errors in the standard.

Nick Lewis
So these corrections are just in terms of the written/printed standard. No changes to the code itself. I just need to have this verified to the point of absolute truth.
J3M 7OR3
You can find the full text at http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1235.pdf to determine for yourself if anything in it is important or not.
Nick Lewis
+1  A: 

No, as the latest C standard is ISO/IEC 9899:1999 (C99) from 1999, and the latest version of the Single UNIX Specification, version 3, which is the same as IEEE Std. 1003.1 ("POSIX") was created in 2004.

Michael Aaron Safyan
+2  A: 

Yes, no, maybe; but mostly no.

You need the base 1999 standard, and you need the technical corrigenda. The technical corrigenda are deltas - changes to the base standard. So, you need some material from before 2007 simply to get to the effective standard as of 2007.

Additionally, the corrigenda are generally very fine details. Most books won't cover the language at a depth that warrants distinguishing between the corrigenda and the base standard.

So, I would not discard books such as 'C: A Reference Manual' even if they predate the the 2007 version of the standard. There may be some good C books written or updated since 2007; I have not been in the market for such books for a while. But there are a number of excellent books written prior to 2007 that are well worth keeping.

Nevertheless, it is an excellent idea to be aware of the official standard - for that, I commend you.

Jonathan Leffler
+8  A: 

When learning C, should one only refer to resources published from 2007 onward?

God, no.

  • The single best resource for learning C is the 2nd (ANSI C) edition of Kernighan and Ritchie, published in 1988.

  • The second best resource for learning is Peter Van Der Linden's Expert C Programming: Deep C Secrets, published in 1994.

  • For C99 and beyond, I like Harbison and Steele's 5th edition for reference and the Dinkumware online library reference.

Norman Ramsey
So if I want to learn C correctly I should probably learn from a resource that teaches C99 which is the current standard of the C language. Correct me if I am wrong.
J3M 7OR3
Norman Ramsey
MSVC is still on c89. Good luck avoiding that platform.
Nick
Why would anyone use MSVC for compiling C? It doesn't even conform to pre-C99 C standards; for instance `printf` is gratuitously incompatible. For this one particular platform, much better C compilers are available.
R..
+1  A: 

You'd need to look at the Corrigendum to see what had changed to determine that, but I doubt even the authors of the latest books will have bothered! The changes are most probably, as the title implies, technical, and will have no bearing at all on how you write your code.

The ISO standards documents are primarily intended as as a definition for the purposes of compiler implementation. Much of it is has no bearing on how one writes code in C. As a practitioner, you seldom need to know the intimate details of the ISO standard except to win pointless arguments and score points on StackOverflow ;). Moreover most compilers run several years behind the ISO standard, and in the case of C, support for even C99 is not provided. Microsoft VC++ for example supports only ISO C90 (ANSI C89), and support for newer versions is not planned - ever - presumably because it is primarily a C++ compiler, and C99 begins a diversion from C++ causing mostly needless incompatibility.

You are in fact probably better off maintaining C89 compliance in order to get the widest portability and compiler support. C99 features are probably safe to use when and if they are absorbed into C++ so motivating wider compiler support. You have to wonder in whose interest anyone is even still working on C standards?

Clifford
Thank you Clifford. That basically answers my question but if anyone disagrees then please comment and explain. I will wait a while and if there is no disagreement to this answer then I will mark it as my choice for best answer.
J3M 7OR3
+1  A: 

If you intend to program using C at professional level, you need to now how was the language in the past (not very different, but there is differences). The main reason is that sooner or later you will have to deal with legacy code. You could also need to use some outdated compiler, many of them are not fully standard compliant (and not fully compliant can be a large margin).

kriss