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.
Good luck to you too. Youre clearly a knowledgeable and experienced programmer, and being a knowledgeable/experienced programmer means you are probably able to write code that is minimal on bugs, fast, and effective. But what is the purpose of this book? It clearly isnt a commentary; the reference on your homepage to a blog entitled coding guidelines seems more appropriate: the book used the word shall so much when I tried to count the amount Adobe Reader hung for 2 minutes.
Your book is a style guide: a reference of background information and pointers how best to code, and know whats going on. A good C programmer will know this info already (or be on their path there), as the only reason for knowing C today is to interact on a close level with the machine, or to know exactly how things are handled, otherwise theyd be mad not to use a higher level language. A knowledgeable programmer does not need dictating to.
So Im curious, for whom do you intend this book to be most useful for (the book most certainly is useful if someone needed a reference, but given my overriding interpretation of it as a style guide for people who dont need one, it seems to be lost without an audience).
This seems to be an interesting topic. I'm sure you could sell a few copies on Amazon...
When you die, on your deathbed, you will receive total consciousness. So I got that goin' for me, which is nice.
C is over with already, geez. Slow, cumbersome, and nobody has a compiler for it. You should be switching to Java by now. It's fast, portable, and the JVM is everywhere. The Novell JVM is the fastest. Dennis Ritchie's time is past. Let the dinosaur turn into oil already and upgrade to the technology that will take us into the 22nd century and beyond. JAVA!
There is another mirror of the pdf here thanks to the folk at mirrordot.
...going to another publisher?
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.
Not really much more to say than that. Sorry you couldn't get it published conventionally. Writing's hard, though, so it's really dead cool of you to give it away.
Good grief. I can see why the publisher bailed on this. I wonder how much they would have had to charge for it?
-Mark
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.
1616 pages....
- AMW
That's the number of the beast multiplied by 2.426! Incredible!
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.
One major new angle is using the results from studies in cognitive psychology to try and figure out how developers comprehend code.
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.
IGB: More fun than eating oatmeal!
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.
I don't think this C-thing is going to catch on. :)
"I'd rather be a lightning rod than a seismometer." -Ken Kesey
It seems that some men love C0X, but most men want nothing to do with C0X. The men that like C0X say there's nothing like the feel of the thick C0X standard in your hands.
"I would say that 99 per cent of what my father has written about his own life is false." - L. Ron Hubbard Jr.
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.
SLASHDOT: news for people who can't concentrate on work or have no life at all and got tired of yelling back at the TV.
You could have published your book yourself through booksurge, and sold it on Amazon.com. At least that way, you'd actually get payed for all the work you did on it.
Since when did operating systems become a religion?
Sure, here ya go.
http://puffin.tamucc.edu/cbook1_0a.pdf.torrent
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
it shouldn't be visible outside of this for loop. I'd be very unhappy if it was.
What you really need is a new language.
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.
No. This is obviously the NEW C standard they've been talking about. I haven't read the article, but clearly they've loosend up on punctuation. Also, any comparisons to directives starting with MAX must automatically default to a "less than" comparison.
"I'm not impatient. I just hate waiting." - My Dad
The book's homepage can be found here: http://www.knosof.co.uk/cbook/cbook.html
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.
People could try ordering from Amazon, the ISBN number is 0201709171. Perhaps Addison Wesley will change their mind if enough order are received.
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).
I work for a publisher and would like to speak to you about publishing your book.
If interested I will provide you my contact info.
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!
quiquid id est, timeo puellas et oscula dantes.
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.
"Give orange me give eat orange me eat orange give me eat orange give me you." -Nim Chimpsky
I've only been skimming it for a little bit now, but this book seems extremely 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.
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.
At a glance, this is impressive not so much for content as for format. In essence this book is a Talmudic http://en.wikipedia.org/wiki/Talmud breakdown of interpretation.
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.
Using <, >, and &, along with consistent use of the Preview button, you can quote what you need to get it to work.
Know thy tools.
1983 called and it wants its 'new' standard back...
All your base are belong to us!
The common thread, as I read it:
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.
I got bored just reading the slashdot article about this book. No wonder Addison Wesley decided not to publish it.
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.
Mmm, this'll be nice for benchmarking my printer.
Direct away from face when opening.
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.
Wow, if you are thrilled by language specifications, they you will shit your pants at the bonus 80 pages of experimental psychology background!
;)
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"
It's 10 PM. Do you know if you're un-American?