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.
Thinly Veiled Job Request (Score:2, Interesting)
Your book is a style guide
Re:Thinly Veiled Job Request (Score:5, Insightful)
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..
Re:Thinly Veiled Job Request (Score:3, Insightful)
At over 1600 pages?! (Score:5, Insightful)
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!
Re:At over 1600 pages?! (Score:2)
Further, it's 160 pages into the book before you get the the first statement from the C standard. It covers everything from code defect lifetime to 44 pages on the psychology of human characterists. Stick to the topic, geez.
Re:At over 1600 pages?! (Score:3, Insightful)
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 w
Re:At over 1600 pages?! (Score:3, Funny)
And IIRC John Harrison (the Chronometer guy) wrote multi-page paragraphs, so some georgian and victorian writers can get fairly lengthy :-)
Re:Thinly Veiled Job Request (Score:2)
I haven't R'dTFB (not being insane enough to download a book-length PDF linked off the newest story on /.) but it's not obvious that that's so. The book is supposedly using a novel approach to maximizing code readability and comprehensibility,
Re:Thinly Veiled Job Request (Score:2)
Only took me a few minutes over my DSL connection. Actually reading this thing is more problematic. It's 1600-odd pages, and consists of a section-by-section (in some places, sentence-by-sentence) commentary on the C standard. There's no PDF bookmarks or other navigation aids. Apparently you're supposed to print out the whole damn thing and read it side-by-side with the standard! Kind of arrogant to assume that any
Re:Thinly Veiled Job Request (Score:2, Insightful)
Disclaimer: I got the PDF about a month ago and have just skimmed through
Re:Thinly Veiled Job Request (Score:2)
If we follow your logic, books like Code Complete are useless because we should already know this stuff before we need it. (huh?)
Glad your brain is that big.
Me, I rather fully appreciate this all too rare level of detail being made available. C should not be a black art, there is no reason for it to be.
As for your statement about the appropriateness of even knowing/using C, I simply must protest. ALL of the good programmers I know have a background that includes C, whether they program
Re:Thinly Veiled Job Request (Score:2)
I find your argument a little weird. Nobody should write books about things their target audience should already know? "Should" and "do" are two different things. That's what keeps writers in business!
Re:Thinly Veiled Job Request (Score:2, Funny)
Do'h!
C is far from dead (Score:2)
(And yes, I know about Forth, etc)
Re:C is far from dead (Score:2)
But if C needs 1600 pages of book to explain how to write reliable maintainable code in it, perhaps it's past time we killed it.
Why not self publish? (Score:3, Insightful)
Re:Why not self publish? (Score:2)
When you consider that all both of the likely purchasers probably live in the same basement, AW's decision might be seen as a bow to reality.
Less smart-assly, there is always Wikipedia.
I, for one, would be interested in reading it, in all 1600 pages, ~8MB of its glory. But that much information begs to be introduced in smaller chunks, and I'm
Why would you use this? (Score:5, Funny)
Re:Why would you use this? (Score:5, Funny)
Re:Why would you use this? (Score:2)
Come on, use something a bit better...
Maybe SNOBOL or SPITBOL. And of course, there's always Ada83 or PL/1!
Re:Why would you use this? (Score:2)
Re:Why would you use this? (Score:2)
Re:Why would you use this? (Score:2, Interesting)
Re:Why would you use this? (Score:2, Informative)
Re:Why would you use this? (Score:3, Insightful)
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 specif
Re:Why would you use this? (Score:4, Insightful)
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.
Re:Why would you use this? (Score:4, Insightful)
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. 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:Why would you use this? (Score:3, Insightful)
Re:Why would you use this? (Score:2)
can anyone set up a .torrent ? (Score:2)
cheers
Re:can anyone set up a .torrent ? (Score:5, Informative)
[tamucc.edu] http://puffin.tamucc.edu/cbook1_0a.pdf.torrent [tamucc.edu]
Re:can anyone set up a .torrent ? (Score:2)
Mirror of pdf here (Score:5, Informative)
Author comments (Score:5, Informative)
People could try ordering from Amazon [amazon.com], the ISBN number is 0201709171. Perhaps Addison Wesley [awprofessional.com] will change their mind if enough order are received.
Did you consider.... (Score:5, Interesting)
I used to be a development editor (10-15 years ago) - a real one; i.e. a software developer recruited to improve developer-level books, not a editor carrying the title. I would have been interested in providing up-front assistance to you and helping you get it ready for someone else. Most of the non-textbook (IDG, Que, SAMS, etc.) publishers prefer to have things come in chapter-by-chapter so things can be directed along the way, but with feedback prior to submittal, you could have gotten around that. You could have made some money that way.
Re:Did you consider.... (Score:3, Interesting)
I agree. Having done a few myself, it seems that most monolithic tomes that come it have problems making it through the process, generally because the authors are too emotionally invested in their work to accept criticism and editing. That's anathema to the publishing world, where at LEAST three re-writes are the norm. You could get away with it 5 or 6 years ago, when publishers were starving to publi
Re:Did you consider.... (Score:3)
I have no affiliation with Cafepress besides having bought a couple of t-shirts from them.
Re:Did you consider.... (Score:5, Informative)
Right on! You can get a run of 1000 copies of a soft cover book printed by someone like BookMasters [bookmasters.com] 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 [pmdapplied.com]; seems to be working out well so far.
[/plug]
attaboy (Score:2, Interesting)
Re:attaboy (Score:2)
One Thousand Sixteen Pages? (Score:5, Insightful)
-Mark
Actually....One Thousand Six Hundred and Sixteen (Score:4, Informative)
1616 (Score:4, Funny)
Re:1616 (Score:2)
Re:Actually....One Thousand Six Hundred and Sixtee (Score:2)
The latest Harbison & Steele is only 560 pages long.
the original K&R: 228 pages
K&R 2nd ed: 272 pages (also uses thicker paper)
Yeah, I know. (Score:2)
-Mark
Re:One Thousand Sixteen Pages? (Score:2)
Re:One Thousand Sixteen Pages? (Score:2, Funny)
From the back of K&R: "C is not a big language, and it is not well served by a big book."
I guess K&R must be rolling over in their graves (or soon will).
Re:One Thousand Sixteen Pages? (Score:2)
"The New" (Score:4, Insightful)
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.
Interesting outlook (Score:3, Interesting)
I believe that developers comprehend code just like a computer, one line at a time. We store things in memory (short-term memory) and "run" them through our minds, simulating what the computer might do. Of course, our human syntax checkers can sometime don't catch, but the logic is there.
I've always thought that there must be a better way to write high-level code than writing a large code using snippets of simple logic. Of course, we can only write code similarily to the way our minds work. When we solve problems, we just don't think about it and it happens, we run through several scenarios, if-then situations, and logic tests before we come to conclusions.
The better question is how to get a computer to produce code autonomously by asking it the final objective. For example, it would be nice to have the computer figure out the "how" as opposed to us programming it in.
Re:Interesting outlook (Score:5, Insightful)
Re:Interesting outlook (Score:2)
Re:Interesting outlook (Score:2)
This makes sense. I remember that e-mail that asks you to read:
Teh qicuk bowrn fox jmups oevr teh dog.
and magically, we know what it is. There's no deciphering of letters or rearranging. We know what it is because we don't actually read the words, we just read the structure (the first and last letter intact).
Re:Interesting outlook (Score:2)
Re:Interesting outlook (Score:3, Informative)
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 [ppig.org] is an entire field of study which attempts to understand everything from simple code comprehension to team dynamics in software engineering groups.
Re:Interesting outlook (Score:2)
------------------
I think you're completely off here. Computers have no concept of the end state of a code snippet. Humans work exactly the opposite of computers in most cases: we visualize the final desired stat
I'm not an estheticist... (Score:2, Insightful)
I'm waiting for D (Score:5, Funny)
Re:I'm waiting for D (Score:3, Informative)
C0X (Score:5, Funny)
Nice to have on the bookshelf...for a few of us (Score:4, Insightful)
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: 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.
Re:Nice to have on the bookshelf...for a few of us (Score:2, Funny)
Around here that's known as a "trigger"...
shoulda used booksurge (Score:3, Insightful)
Dupe??? (Score:2)
Ain't no K&R (Score:2)
Good thing this isn't the first book about C or
it would never take off.
You don't need new standards (Score:5, Interesting)
Before modding me down, think about it. Any programming language is about solving problems, and problems you solve today are different from the ones someone had back in the days of C creation. Moreover, the ways you deal with programming changed as well. IT industry needs new languages, including low-level and compiled ones.
Re:You don't need new standards (Score:2)
In C, you can do that. Even if the solution is to invent another language compiled by a C program. Or to embed assembly code in your C code.
Re:You don't need new standards (Score:4, Interesting)
C also suffers from lack of flexibility. Try implementing a Java-style class system in C; although you can make something that works the same, using it will always be more cumbersome. Because of this, C will always be pretty low-level, it is just not adaptable enough to be used for really high-level things.
On the other hand, C isn't ideal for low-level programming either. Try writing properly tail recursive [wikipedia.org] functions in C, or try composing a function call. Or, do something with the registers in your CPU.
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.
Re:You don't need new standards (Score:5, Interesting)
I thought about it.
You first declared that we need a new language based on the assumption that we are solving different problems from a decade ago. (C99 was released about that long ago, and GCC supports much of the C99 spec).
Yet, thinking about it, you didn't tell us how problems are different from a decade ago.
Nor did you tell us how these problems present difficulties in the upcoming C0X spec.
The amazing thing about C is that it has survived several 'languages of the year'. It obviously has some advantages. It seems to me that C is a proven tool in the programmer's workshop. It doesn't solve all problems, but no tool does. However, it solves a lot of problems very well.
The Book's WWW homepage (Score:5, Informative)
Availability through LULU (Score:5, Informative)
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).
I will publish your book (Score:2, Interesting)
If interested I will provide you my contact info.
request for user-submitted reviews (Score:2)
Some thoughts (Score:4, Insightful)
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.
Pretty Damn Impressive (Score:4, Interesting)
It probably would have gotten a lot more love during editing by the publisher, as, IMHO, it's fairly difficult to approach and digest in its current form. Maybe I just don't get it yet, but it does seem to suffer a bit due to its organization.
That said, the information in here is absolutely enthralling. I went over a few of the more subtle parts of the standard that I know fairly well, and I was impressed. The explanations are good, but what I really find compelling are the examples, historical anecdotes, references to different machines and architectures, and juxtapositions with other languages. You can tell that this guy knows this stuff, but more importantly, he's *lived* it.
The comments about this book not being useful to a "good C programmer" completely miss the mark. A good C programmer -- one that has a true love for programming -- will most likely find this book captivating.
Manifestation of liturgical commentary. (Score:4, Interesting)
Re:Manifestation of liturgical commentary. (Score:2, Insightful)
eShall (Score:2)
Now that the copyright issues have been sorted out (Score:4, Funny)
Now that the copyright issues have been sorted out...
As I was reading this sentence, my heart stopped and my mind jumped for joy. I thought the RIAA/MPAA/etc. had finally given up, congress had rolled back copyright terms, and the GPL was finally successfully tested in court.
Then I read the rest... *sigh* oh well.
1983 called... (Score:3, Funny)
Why Addison-Wesley rejected this (Score:5, Interesting)
I'm up to page 132, and so far, it's an introductory cognitive psychology text. A bad one.
There are 1616 pages of this drivel. Even for someone interested in programming language design, this is a painful read.
There's room for a good book in this area, but this isn't it. A more useful approach might be to start from Amit Yoran's statement that "About 95% of software bugs come from 19 common, well-understood" programming mistakes", and evaluate language designs against that.
19 known problems cause most bugs (Score:4, Informative)
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.
1616 pages (Score:3, Funny)
Mother of God (Score:3, Funny)
But seriously, good work dude
"Sir, none of our techniques are breaking the prisoner"
"I was worried about this, they must have trained him on The New C Standard"
Re:Again...? (Score:3, Informative)
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 vario
Re:Again...? (Score:2)
Re:Again...? (Score:2)
Re:Again...? (Score:3, Informative)
for(int i = 0; i < MAX_COUNT; i++)
Re:Again...? (Score:3, Insightful)
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.
Re:Again...? (Score:2)
If you want to write sharp brackets on some programming message board that allows HTML tags, use the "<" for less-than, and ">" code for greater-than. These will show up as sharp brackets in the post, yet will not interfere with the HTML rendering & parsing.
Re:Again...? (Score:3, Informative)
Using <, >, and &, along with consistent use of the Preview button, you can quote what you need to get it to work.
Know thy tools.
Re:Again...? (Score:2)
Re:Again...? (Score:2)
Today, as in the olden days, this:
i MAX_COUNT, i++
would fail to compile.
Re:Again...? (Score:3, Insightful)
Re:Again...? (Score:2)
Then don't use any version of Visual C++ before .NET (7.0). You'll be very unhappy.
Not Again... (Score:5, Funny)
Re:Again...? (Score:2)
C++ style comments (most compilers accept already, make it part of the standard)
declarations anywhere, not just at code block start.
The new C++ style scoped for.
New data types like _Bool, _Complex, _Imaginary
Some others probably....
The biggest new thing is probably the restrict keyword. First, any new keyword has the possibility of breaking old code, so once could say that C0x is not fully backwards compatible with all former code.
Then actually getting yro
Re:Cool but to what point? (Score:3, Insightful)
Re:Encryption / Protection (Score:2)