Slashdot Mirror


The New C Standard

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.

19 of 400 comments (clear)

  1. Mirror of pdf here by derek_farn · · Score: 5, Informative

    There is another mirror of the pdf here thanks to the folk at mirrordot.

  2. Re:Again...? by saider · · Score: 3, Informative

    This is ANSI C. It gets refreshed every so often to incorporate some changes. One of the easiest changes to spot is the following...

    for(int i = 0; i MAX_COUNT, i++ )

    In the olden days, you'd have to declare i before using it in the code. The newer standards let you declare variables at their first use. This serves to clean up the code a little and also lets the programmer see what type it is without having to scroll up to the top of the function.

    There's lots of other little changes like that in the various "standards".

    --


    Remember, You are unique...just like everyone else.
  3. Actually....One Thousand Six Hundred and Sixteen by Rolan · · Score: 3, Informative

    1616 pages....

    --
    - AMW
  4. Re:Again...? by Anonymous Coward · · Score: 1, Informative

    for (int i=0; i{...
    }

    Missing '<'
    Comma instead of Semi-colon
    Incomplete statement

    The bonus question is: what is the lifetime/visibility/scope of 'i'?

  5. Re:can anyone set up a .torrent ? by mwilliamson · · Score: 4, Informative
  6. Re:Again...? by Swamii · · Score: 2, Informative

    The GP undoubtedly put a less-than operator in there, but Slashdot tried to interpret that as an html tag. And as another poster mentioned, it should be

    for(int i = 0; i < MAX_COUNT; i++)

    --
    Tech, life, family, faith: Give me a visit
  7. Re:I'm waiting for D by Umbral+Blot · · Score: 2, Informative
  8. Re:Why would you use this? by Anonymous Coward · · Score: 1, Informative

    C is by far the most commonly used programming language in the embedded systems world. Right now there are more embedded systems programming projects (and jobs) than their are conventional PC programming jobs. Thus, knowing C is a good thing.

  9. The Book's WWW homepage by nadamsieee · · Score: 4, Informative

    The book's homepage can be found here: http://www.knosof.co.uk/cbook/cbook.html

  10. Re:Interesting outlook by fcw · · Score: 2, Informative
    I believe that developers comprehend code just like a computer, one line at a time.

    Only novice programmers do this; experienced programmers have richer mental models, and many more ways of comprehending code. There's a lot of research on this already.

    The psychology of programming is an entire field of study which attempts to understand everything from simple code comprehension to team dynamics in software engineering groups.

    The better question is how to get a computer to produce code autonomously by asking it the final objective.

    "Programming by Example" languages do this, as do declarative ones.

    For example, it would be nice to have the computer figure out the "how" as opposed to us programming it in.

    That's what domain-specific languages, such as SQL, have been doing for a generation. Even HTML is like that -- it describes some content and structure, and it's up to the browser to do the heavy lifting of presenting it to the user, and letting them interact with it.

  11. Re:Dupe??? by Anonymous Coward · · Score: 1, Informative
    > I'm suffering from a sense of Deja Moo... I'm sure I saw this last month...

    I thought so too... but couldn't see it on the list of old articles in the Developers section. It turns out we saw this as a comment in another thread...

    http://slashdot.org/comments.pl?sid=152597&thresho ld=1&commentsort=0&tid=192&tid=188&mode=thread&pid =12806613#12807826

  12. Author comments by derek_farn · · Score: 4, Informative
    I have been receiving two kinds of email:
    • Requests for a dead tree version of the pdf. I have invested the possibility of self publishing. The problem is that these companies are not set up for high page counts (1,616) and an A4'ish page size (ok, and self-publishers are currently offering a less than stunning deal; the ROI is small).

      People could try ordering from Amazon, the ISBN number is 0201709171. Perhaps Addison Wesley will change their mind if enough order are received.

    • Information on typos. Please keep sending these to me. I am keeping a log of these so that writers of grammar checkers have some real world data.
  13. Availability through LULU by ewilts · · Score: 5, Informative

    Have you considered making the book available through http://www.lulu.com/? It's a print-on-demand service that allows people an easy way to get a properly bound printed copy of your book, and for you optionally to get some money for your efforts. No cost to you to get set up either.

    No, I don't work for lulu or have any financial connections to them. I just know one of the guys that works there (Jeremy Hogan, formerly from Red Hat).

    --
    .../Ed
  14. Gotcha by Anonymous Coward · · Score: 1, Informative

    Gotcha... Modded as interesting... Ever heard about rational numbers? ;)

    The decimal expansion of a rational number is eventually periodic (in the case of a finite expansion the zeroes which implicitly follow it form the periodic part). The same is true for any other integral base above 1. Conversely, if the expansion of a number for one base is periodic, it is periodic for all bases and the number is rational.

  15. Re:Why would you use this? by scotch · · Score: 1, Informative

    You don't know what you are talking about.

    --
    XML causes global warming.
  16. Re:Did you consider.... by tcopeland · · Score: 4, Informative

    > You could also consider "self-publishing"

    Right on! You can get a run of 1000 copies of a soft cover book printed by someone like BookMasters for $5K or so, even for a monster like this one. Just stick with a 4 color cover and black/white in the text. And if you can charge $40 or so for this tome, you can cover your printing costs after selling only 150 copies.

    [plug]
    That's what I'm doing with PMD Applied; seems to be working out well so far.
    [/plug]

  17. Re:Again...? by Thuktun · · Score: 2, Informative

    ... which brings us to the obvious question - why can't they fix it (slashcode) so that we can insert code samples properly?

    Using &lt;, &gt;, and &amp;, along with consistent use of the Preview button, you can quote what you need to get it to work.

    Know thy tools.

  18. Re:You don't need new standards by 2901 · · Score: 2, Informative
    And then there's the syntax of the language. Try writing a parser that can correctly parse any valid C program. Or try to write a program that does transformations on C programs, both reading and writing C code.

    If that kind of thing matters to you, you should look at Common Lisp. The built-in programmable parser is powerful enough to parse all CL programs and is configured to do so by default. Defining source-to-source transformations with DEFMACRO is an important technique

  19. 19 known problems cause most bugs by Animats · · Score: 3, Informative
    I've been trying to get that information. Yoran said that when he was head of the National Cyber Security Division at the Department of Homeland Security. He quit shortly thereafter, and his replacement is a TV producer. At this point, it's not even clear that there is a National Cyber Security Division at DHS. It's no longer in their table of organization.

    Apparently, there were objections from Microsoft when DHS started to point out that Microsoft was the problem. What's left of the "National Cyber Security Division" actually seems to be CMU's CERT plus a front man, Andy Purdy, in Washington.