Please create an account to participate in the Slashdot moderation system


Forgot your password?
Programming Books Media IT Technology

The New C Standard 400

derek_farn writes "At a very late stage Addison Wesley decided not to publish my book, 'The New C Standard: An economic and cultural commentary'. Now that the copyright issues have been sorted out I am making the pdf freely available. You can download the pdf (mirror 1). The organization is rather unusual in that the commentary covers each sentence of the C Standard (actually the latest draft of C0X, excluding library) one by one (all 2022 of them). One major new angle is using the results from studies in cognitive psychology to try and figure out how developers comprehend code. The aim being to try and produce some coding guidelines that reduce costs (ie, reduce the time needed and bugs created). The book also contains the results of lots of measurements (over 400 figures and tables) in an attempt to back the arguments being made -- another unusual feature since most software related books don't publish any figures to back up what they say. Other subsections discuss common implementations and differences between the latest draft standard and C90/C++. More background on the project is available from the Inquirer.
This discussion has been archived. No new comments can be posted.

The New C Standard

Comments Filter:
  • by killproc ( 518431 ) on Friday July 08, 2005 @10:36AM (#13013328)
    This seems to be an interesting topic. I'm sure you could sell a few copies on Amazon...
  • by DenDave ( 700621 ) on Friday July 08, 2005 @10:45AM (#13013406)
    So maybe it is a guideline to hobby C coders, new learners, anyone who doesn't use C as professional??

    I think there is a target audience, perhaps you don't fall in the category but that doesn't mean that everyone who dabbles with C is Uber-Geek..

  • by mbessey ( 304651 ) on Friday July 08, 2005 @10:45AM (#13013407) Homepage Journal
    Good grief. I can see why the publisher bailed on this. I wonder how much they would have had to charge for it?

  • "The New" (Score:4, Insightful)

    by hey ( 83763 ) on Friday July 08, 2005 @10:52AM (#13013465) Journal
    I don't know if I trust a style guide with "The New" in the title. Nothing stays new forever.
    What about when the next version of C comes out?
    You'll have to go back a revise the title! Why not do it right the first time and call it "C90/C++ Style" or something.

    Maybe times when cleaning up other people's files I have run into files with "new" in the name... dated years ago. A sure sign it can be deleted.
  • by Kupek ( 75469 ) on Friday July 08, 2005 @10:58AM (#13013506)
    Computers don't comprehend code, they just run it. Comprehension is an entirely different act than execution. While we build up our comprehension one line (or word) at a time, we're still using our recollection of all previously related code to understand what this new piece of code does. And then, once we think we understand what's going on, I think we often mentally throw out the code itself, and just remember what it does.
  • by ekephart ( 256467 ) on Friday July 08, 2005 @11:02AM (#13013549) Homepage
    Right, or someone like me, who is young yet fairly competent with C. As a style guide/commentary I see no harm in Mr. Jones sharing his insights. What college grad wouldn't benefit from the teachings of experience.
  • by Anonymous Coward on Friday July 08, 2005 @11:02AM (#13013554)
    and haven't read the book yet, but based on first impression would you trust a book on standards if the layout of the book itself doesn't seem to follow a publishing standard - besides the pdf file format.

  • by Anonymous Coward on Friday July 08, 2005 @11:05AM (#13013575)
    Insight perhaps? In this day and age you are still told "this is how you do it" without being explained the reasoning behind it (the train of thought). You are just supposed to blindly accept it. This approach may have worked better before, when people were used to being dictated their thoughts, and because many people of this older generation teach the new, this way of thinking is passed on to us, because that's how they learned it.

    Disclaimer: I got the PDF about a month ago and have just skimmed through it once. ;)
  • by museumpeace ( 735109 ) on Friday July 08, 2005 @11:07AM (#13013598) Journal
    My occasional run-ins with languages go back to the days of BLISS and kicking around the Strawman and Ironman RFPs. I think there is a lot of value in a work like this for CS professors and software CTOs and maybe some flavors of project technical leads but at 1600 pages, not many of the rest of us would run out to buy it. ACM would seem a likely home for such a reads like one of their Computing Surveys articls that got out of hand. [any book with > 1400 reference citations is definitely in the academic tome category...not sure I can fault AW's decision as a purely business decision. ON the other hand, the contents here are a musty treasure and I downloaded it immediately. I am grateful for this.]
    Also, choosing to make deep commentary on the suitability of a computer language as a tool for solving problems but then going light on the dominant OO languages is just too big an omission. e.g. on pg 24:
    Your author's experience with many C developers is that they tend to have a C is the only language worth knowing attitude. This section is unlikely to change that view and does not seek to. Some knowledge of how other languages do things never hurt.

    There are a few languages that have stood the test of time, Cobol and Fortran for example. While Pascal and Ada may have had a strong influence on the thinking about how to write maintainable, robust code, they have come and gone in a relatively short period of time. At the time of this writing there are six implementations of Ada 95. A 1995 survey[571] of language usage found 49.5 million lines of Ada 83 (C89 32.5 million, other languages 66.18 million) in DoD weapon systems. The lack of interest in the Pascal standard is causing people to ask whether it should be withdrawn as a recognized standard (ISO rules require that a standard be reviewed every five years). The Java language is making inroads into the embedded systems market (the promise of it becoming the lingua franca of the Internet does not seem to have occurred). It is also trendy, which keeps it in the public eye. Lisp continues to have a dedicated user base 40 years after its creation. A paper praising its use, over C, has even been written.[398]

    The references for the other languages mentioned in this book are: Ada,[625] Algol 68,[1347] APL,[634] BCPL,[1113] CHILL,[636] Cobol,[614] Fortran,[620] Lisp[630] (Scheme[693]), Modula-2,[626] Pascal,[619] Perl,[1375] PL/1,[613] Snobol 4,[504] and SQL.[621]
    Since we all mostly program in OO paradigms these days, the author's perspectives on C++, though they would lengthen an already long book, should have been prominently featured instead of downplayed.
  • by MatD ( 895409 ) on Friday July 08, 2005 @11:08AM (#13013603)
    You could have published your book yourself through booksurge, and sold it on At least that way, you'd actually get payed for all the work you did on it.
  • Re:Again...? (Score:3, Insightful)

    by Skye16 ( 685048 ) on Friday July 08, 2005 @11:11AM (#13013628)
    it shouldn't be visible outside of this for loop. I'd be very unhappy if it was.
  • by hungrygrue ( 872970 ) on Friday July 08, 2005 @11:29AM (#13013745) Homepage
    Yea, C is a dead language. Which explains why it is also the most widely used programming language, and why there are more lines of code in active use than any other programming language.
  • by Anonymous Coward on Friday July 08, 2005 @11:39AM (#13013829)
    C has a lot of shortcomings, like being only weakly-typed, etc.

    Maybe somebody should write a book once about why people should switch away from C to more modern languages.

    You may view such things as shortcomings. I view them as power. Power that can be used for good or for ill.

    Modern languages are all about protecting the programmer from having power. They limit the programmer, tying him or her down. This was done because so many programmers are idiots, true, but never forget that the problems modern languages were meant to solve are all people problems, not computer problems.

    It is people that seem to need object oriented structures, because the language needs to help protect the programmers from their failure to organize data structures in a sensible way and communicate that structure to other programmers. People that seem to require strongly-typed languages, to prevent their errors of inattention while they write code. But all these features are unknown to the CPU -- they've all been stripped away in the compiler, and reduced back to the purity of sequential code. A purity that most programmers can't handle. A purity that C comes closest to (besides assembly, of course).

    As a programmer working professionally for nearly 20 years now, I find it unutterably sad that so many new programmers are let out of colleges having so little idea of how computers actually operate. They're not programmers anymore -- they're a priesthood who poke at the black boxes in certain ways and the boxes "magically" do what they're supposed to. They have as little idea of what's going on as a 5-year-old playing with a gyroscope (and I apologize to any really bright 5-year-olds out there for the comparison).

    The reduction of the use of C in our profession marks the decline of real knowledge in the average programmer.
  • by The_Wilschon ( 782534 ) on Friday July 08, 2005 @11:48AM (#13013907) Homepage
    maintainability and enhanceability, at least, are entirely dependent on the quality of the programmer. I'm working on extending a package here at work, most of which is written in java. It is very poorly organized and I'm being forced to completely rethink the design. If it were well designed, I ought to be able to copy a couple of files and change some constants and be done. (the extension is nothing more than adding a new version of a particular custom electronics board while continuing to use the old board as well.)

    Using java does not automagically give you all of these benefits. In the hands of a competent programmer, they may be easier to acheive with java. However, in the hands of an incompetent programmer, the best you might get would be portability and mobility. That is, as long as you stick with virtual machines and class libraries from one vendor.

    There is no silver bullet.
  • by mariox19 ( 632969 ) on Friday July 08, 2005 @11:57AM (#13013977)

    Not counting the citations at the end, the book is 1,577 pages of "guidelines." Who's got that kind of time for a hobby? Who, having a job as a programmer, even has the time to read a book like that?

    How about somebody writing a book called The New Writing Standard for Books on Programming? Most of the programming books I own are unecessarily long winded, but this book takes the cake!

  • Some thoughts (Score:4, Insightful)

    by mnmn ( 145599 ) on Friday July 08, 2005 @11:58AM (#13013993) Homepage
    I havent read the book. But some thoughts on that post:

    The aim for C should not simply be to reduce the time spent on code, the simplistic economic view. Leave that to Java. C is for a clear and thorough understanding of the code's execution, more so than C++. The execution flow can very clearly be seen in this structured language which does not try to be smart or do things behind the wall in the compiler. C is brutal and raw, therefore low level and powerful. Leave it to that. C is great for kernel level programming, drivers and embedded systems, and other places where you get anal about control over whats happening. C is awesome when you need to mingle the code with assembly in tight spots and still keep things readable.

    Please do not turn it into Java. Programmers who need to spend less time can just use Visual Basic or equivalents.

    I like the idea of commenting on all parts of the standard. But you said you used a cognitive analysis of some sort. More so than that, I'd look for comments from experienced developers, maybe people who worked on various kernels and drivers, integrated various languages with C, developed C libraries and worked on a hundered-file projects.

  • Re:Again...? (Score:3, Insightful)

    by tomhudson ( 43916 ) <> on Friday July 08, 2005 @12:13PM (#13014152) Journal
    ... which brings us to the obvious question - why can't they fix it (slashcode) so that we can insert code samples properly?

    in php its no big deal to make sure that anything you stuff in a db is safe - just do an $valueToStore = htmlentities($valueFromPoster). So either do the same in perl, or convert to php.

  • by Franciscan ( 720329 ) on Friday July 08, 2005 @12:28PM (#13014287) Journal
    Talmudic? Exactly. Here is a prodigious mind at work. A fascinating book, interesting perhaps only to the very small sub-set of human beings who have the following interests: (i) heavily interested in C (ii) not at all interested in C++ (iii) into scholarly discussions of human intellectual processes, metrics, studies, and quantifiable discourse on subjects dear to the heart of a language lawywer. (iv) wants detailed line by line commentary on the C standard. If I were the technical editor in charge of reviewing his book, I'd have a hard time making a case that there are a lot of people who want to read this book out there. If I really wanted to piss the author off, I'd suggest he try to get it published as "C99 for Dummies". Warren
  • by smose ( 877816 ) on Friday July 08, 2005 @01:14PM (#13014738)

    The common thread, as I read it:

    In the hands of a competent programmer... you get something usable. the hands of an incompetent programmer... you get crap.

    There is no silver bullet.

    It sounds to me like the silver bullet is competence, which is acquired through a combination of aptitude, training, and experience. Silver bullet methodologies attempt to negate the importance of aptitude by relating experience into best practices for training. Silver bullet languages attempt to negate the importance of aptitude by making the languages more robust against stupidity. Yet, in the hands of the inept, silver bullets invariably embed themselves in the nearest available foot.

    Some people just don't get it, whatever "it" is.

  • by groomed ( 202061 ) on Friday July 08, 2005 @01:24PM (#13014827)
    Christ you're an insufferable prat. And I say that not to insult you, but to inform you, lest it had escaped your notice.

    Do you honestly believe that any of what you just said hasn't occurred to the original poster? A veteran of almost 20 years?

    This discourse is so tired and worn-out that its only purpose is to serve as joke fodder on the Internet. And this is how it's been for ages, all the way back to when the first "Real Programmers don't eat quiche" jokes were being forwarded across Bitnet.
    Let me quote Dijkstra:
    Functional programming, structured programming, logical programming, constraints programming, p-code systems, object oriented programming, iterative development, patterns, open source development, pair programming, Extreme programming, managed code: each of these was heralded as the sine qua non of software development at its inception, only to get bogged down in messy detail once people actually started to build real-world systems with them. Bits and pieces survive here and there and percolate up in newer languages and designs, until every hint of the original glamour has vanished and they become just another fixture for pigeons to shit on.

    And this is how progress is made, slowly and erratically, like a blind man groping about in the dark.

    Fred Brooks was right: there is no silver bullet.
  • Re:Author comments (Score:2, Insightful)

    by Anonymous Coward on Friday July 08, 2005 @02:32PM (#13015410)
    "Dead tree version" is a waste of words.

    Why can't you just say "paper version"? It's called PAPER. Get with the times.
  • by Clod9 ( 665325 ) on Friday July 08, 2005 @03:07PM (#13015687) Journal
    I thought others must be exaggerating, but they're not. This really does win the prize for long-winded writing.

    It's no wonder they didn't publish it, it's impenetrable. Not worthless, but just too detailed. It needs some completely different organization to carry the quantity of information it has.

    My guess is, he set it all down and they probably asked him to reorganize it, and he balked, and instead offered what he had up in PDF form to us. Editors really do a valuable service, one that's missing from what you'll see here.

  • by Anonymous Coward on Friday July 08, 2005 @03:12PM (#13015728)
    If you leafed through it at all, you'd see that the pages are about 1/3rd the standard published book height. so, 500-800 normal printed pages is more like it.

    It reads well, it's a useful book, and the shorter pages make it appear uncluttered.

    I'm just amazed - a guy puts this much time and attention into what looks to be a useful book, and GIVES IT AWAY FREE, then all anyone on Slashdot does is moan and whine.

  • by Iffy Bonzoolie ( 1621 ) <iffy@xarbl e . o rg> on Friday July 08, 2005 @03:22PM (#13015840) Journal
    Well, you aren't really giving the same info twice: First you are declaring that littleBoy is a reference to a ThermonuclearBomb. Second, you are pointing that reference at a new ThermonuclearBomb. But your example is very simplistic so it seems redundant. Perhaps your heirarchy looks like this:

    NuclearBomb inherits Bomb
    AtomBomb inherits NuclearBomb
    HydrogenBomb inherits NuclearBomb

    Bomb littleBoy = new AtomBomb();

    Now littleBoy is declared as a reference to any kind of bomb. You are then assigning specifically an AtomBomb to it.

    Adding all sorts of language shortcuts because you don't want programmers to type as much is inelegant. It makes the language harder to learn and read. Part of the elegance of Java is the eschewing of fancy syntactic candy-coated shortcuts in favor of a regular, predictable syntax.

  • by Anonymous Coward on Friday July 08, 2005 @06:03PM (#13017164)
    They're alive you dumbass.

    Allah yehfazum wa yitawil umrom!

    (May God keep them and lengthen their lives)

    Say amen.

  • by Col Bat Guano ( 633857 ) on Saturday July 09, 2005 @09:52AM (#13020276)
    You may view such things as shortcomings. I view them as power. Power that can be used for good or for ill.

    Modern languages are all about protecting the programmer from having power. They limit the programmer, tying him or her down. This was done because so many programmers are idiots, true, but never forget that the problems modern languages were meant to solve are all people problems, not computer problems.

    No, it was done because most programmers are people, and most people aren't 100% perfect robots that get everything right all the time. Have you never suffered from out out of bounds error in an array? Just specifying checks for this in a langauge -helps- you, not hinder you. The amount of work you don't have to do chasing down problems that pop up a long way away from the source of the problem is amazingly less, when the program tells you where it (you!) went wrong.

    Languages that protect you don't have to be seen as the enemy.

In 1869 the waffle iron was invented for people who had wrinkled waffles.