Beta

×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

The New C Standard

Zonk posted about 9 years ago | from the meet-the-new-boss dept.

Programming 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.

cancel ×

400 comments

Sorry! There are no comments related to the filter you selected.

Re-inventing PL/1 (-1, Troll)

Anonymous Coward | about 9 years ago | (#13013322)

PL/1 has all the stuff C has and more ... in 1964.

Re:Re-inventing PL/1 (-1, Offtopic)

Anonymous Coward | about 9 years ago | (#13013337)

Don't you mean PL/I?

Re:Re-inventing PL/1 (0, Offtopic)

$RANDOMLUSER (804576) | about 9 years ago | (#13013400)

If you want PL/1, you know where to find it.

Re:Re-inventing PL/1 (0, Offtopic)

$RANDOMLUSER (804576) | about 9 years ago | (#13013779)

Offtopic? Offtopic?? Offtopic???

Sigh [catb.org]
And agin. [mcgill.ca]
And again. [hacker-dictionary.com]

Thinly Veiled Job Request (2, Interesting)

Uber Banker (655221) | about 9 years ago | (#13013324)

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 [coding-guidelines.com] 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).

Sorry (0)

Uber Banker (655221) | about 9 years ago | (#13013357)

That sounded unduely critical.

It is a great effort, but I'm curious as to your motivation (other than a job ;-P)?

Re:Thinly Veiled Job Request (5, Insightful)

DenDave (700621) | about 9 years ago | (#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..

Re:Thinly Veiled Job Request (3, Insightful)

ekephart (256467) | about 9 years ago | (#13013549)

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.

Re:Thinly Veiled Job Request (1)

Otter (3800) | about 9 years ago | (#13013528)

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.

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, right? Is the result (you've read the book, IIUC) no different from conventional C hacker wisdom?

Re:Thinly Veiled Job Request (2, Insightful)

Anonymous Coward | about 9 years ago | (#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. ;)

Re:Thinly Veiled Job Request (1)

GeckoX (259575) | about 9 years ago | (#13013812)

Chicken or egg man?

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 in VB/C#/Java Whatever. It is proven to be highly beneficial to know what's going on under the hood.

I've seen _way_ too many 'programmers' that do not have this background and suffer hugely from it when it matters.

Re:Thinly Veiled Job Request (1)

fm6 (162816) | about 9 years ago | (#13013876)

A good C programmer will know this info already ...
So what about bad C programmers? God knows there's enough of those!

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!

Why not self publish? (3, Insightful)

killproc (518431) | about 9 years ago | (#13013328)

This seems to be an interesting topic. I'm sure you could sell a few copies on Amazon...

Re:Why not self publish? (1)

smitty_one_each (243267) | about 9 years ago | (#13013453)

From The Inquirer link:
I did not know until almost crunch time that it was on the limit of what non specialist printers can handle, in terms of number of pages
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 currently savoring Knuth's TAoCP, which might offer some ideas about how to instantiate hardcopies.

Re:Why not self publish? (0)

Anonymous Coward | about 9 years ago | (#13013912)

Good point, wikibooks may be able to get him more exposure as well.

Again...? (0)

creimer (824291) | about 9 years ago | (#13013329)

Do we need another C Standard? I thought ANSI C was good enough for all your programming needs.

Re:Again...? (3, Informative)

saider (177166) | about 9 years ago | (#13013415)

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".

Re:Again...? (0)

Anonymous Coward | about 9 years ago | (#13013494)

for(int i = 0; i MAX_COUNT, i++ )
I think you need a less than sign and a ; instead of a comma there

Not Again... (5, Funny)

uberdave (526529) | about 9 years ago | (#13013694)

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.

Re:Again...? (1)

tomhudson (43916) | about 9 years ago | (#13013512)

for(int i = 0; i MAX_COUNT, i++ )
... don't think that compiles ... (hint - you're missing a <)
for(int i = 0; i < MAX_COUNT, i++ )

Re:Again...? (1)

Stibidor (874526) | about 9 years ago | (#13013542)

And a comma is not the same thing as a semi-colon. ;)

Re:Again...? (2, Informative)

Swamii (594522) | about 9 years ago | (#13013625)

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++)

Re:Again...? (1)

slavemowgli (585321) | about 9 years ago | (#13013516)

Not just that, the new standard also seems to allow you to write "i MAX_COUNT" without having to include a comparison operator! :)

Re:Again...? (1, Informative)

Anonymous Coward | about 9 years ago | (#13013537)

for (int i=0; i<MAX_COUNT; ++i)
{...
}

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

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

Re:Again...? (2, Insightful)

Skye16 (685048) | about 9 years ago | (#13013628)

it shouldn't be visible outside of this for loop. I'd be very unhappy if it was.

Re:Again...? (1)

RailGunner (554645) | about 9 years ago | (#13013801)

it shouldn't be visible outside of this for loop. I'd be very unhappy if it was.

Then don't use any version of Visual C++ before .NET (7.0). You'll be very unhappy.

Re:Again...? (1, Interesting)

Anonymous Coward | about 9 years ago | (#13013730)

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

Depends on the standard, and how compliant your compiler is to the standard.

If the standard doesn't specify then it's up to the compiler writer; most will probably make it the same as the current scope (which will strike most programmers as wrong).

Odds are the spec requires that the scope be only within the loop, so then it's up to the compiler to actually be compliant to the spec.

There are numerous compilers that fail to live up to specs they allegedly comply to. MS Visual C++ 6.0 for instance -- you can do the above in C++ code, but the variable's scope is the same as the parent function. Bloody annoying. Fixed in 7.0 at least.

Re:Again...? (1)

saider (177166) | about 9 years ago | (#13013662)


Sorry about the typos. The comparison was there, I just forgot that Slashcode filters it out. I'll chalk the comma mistake up to lazy fingers.

Re:Again...? (1)

amightywind (691887) | about 9 years ago | (#13013834)

Today, as in the olden days, this:

i MAX_COUNT, i++

would fail to compile.

Why would you use this? (5, Funny)

Anonymous Coward | about 9 years ago | (#13013341)

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!

Re:Why would you use this? (5, Funny)

satan666 (398241) | about 9 years ago | (#13013446)

Puh-leaze! Java-this and Java-that. Why not use a language that is designed for speed: COBOL

Re:Why would you use this? (1)

sconeu (64226) | about 9 years ago | (#13013499)

COBOL? COBOL???

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? (1)

SpryGuy (206254) | about 9 years ago | (#13013797)

You haven't lived until you've coded in BLISS! Seriously!

Re:Why would you use this? (1)

dorkygeek (898295) | about 9 years ago | (#13013457)

I don't know if this is should really be modded funny.

Yes, C compilers are readily available for lots of systems, but managed computation should be the way to go for future applications, at least on the user level.

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.

Anyways, was this book typeset with Word? It looks quite quirky...

Re:Why would you use this? (1)

crow_t_robot (528562) | about 9 years ago | (#13013470)

please die

kthxbyegg

Re:Why would you use this? (0, Flamebait)

dorkygeek (898295) | about 9 years ago | (#13013629)

Just because you don't know how to program Java, you don't have to blame others for using Java.

Re:Why would you use this? (0)

Anonymous Coward | about 9 years ago | (#13013739)

Similarly, just because you only use X and haven't used 10 other superior languages, doesn't mean X is the best for every job. Troll.

Re:Why would you use this? (-1, Troll)

Anonymous Coward | about 9 years ago | (#13013904)

No kidding. When fucktard there figures out what pointers are, he'll change his tune. Just because you're the proud holder of the "most welts requiring surgery after a game of dodge ball" award at your junior high doesn't mean you should work with computers. Pottery can be a lucrative career, or you might consider professional homosexuality. Talk to your guidance counselor.

Re:Why would you use this? (0)

Anonymous Coward | about 9 years ago | (#13013682)

Oh grasshopper, maybe your junior high C 101 teacher said "C sucks because it is weakly typed," but you haven't the first clue what that means, do you? Come back when you have to start shaving in 10 more years.

Re:Why would you use this? (4, Insightful)

Anonymous Coward | about 9 years ago | (#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.

Re:Why would you use this? (0)

Anonymous Coward | about 9 years ago | (#13013577)

I care about startup time a lot.

Java != fast.

And I care about memory usage.

Java != efficient.

(same is more or less true for c#/.NET too).

Re:Why would you use this? (1)

dorkygeek (898295) | about 9 years ago | (#13013758)

Do you also care about

  • security
  • stability
  • enhanceability
  • maintainability
  • portability and
  • mobility?

I for one, do so, that's why I head with Java.

If you don't, simply forget me.

Re:Why would you use this? (3, Insightful)

The_Wilschon (782534) | about 9 years ago | (#13013907)

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.

Re:Why would you use this? (0)

Anonymous Coward | about 9 years ago | (#13013637)

Maybe you don't use a TV or an iPod or a refrigerator or a washing machine or any of those thousands of things (except a PC) in this world that get powered by electricity. Or the whole bunch of people who design these things are so dumb that they have chosen to implement embedded software for all these in C/assembly language and not in the glorious Java language. As they say, if you have a hammer... If you are using Java then you wonder why don't the whole world use a web server for a refrigerator. --Hemanth P.S.

Re:Why would you use this? (1, Informative)

Anonymous Coward | about 9 years ago | (#13013672)

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.

Re:Why would you use this? (1)

hungrygrue (872970) | about 9 years ago | (#13013719)

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.
C is the most commonly used language period.

Re:Why would you use this? (0)

Anonymous Coward | about 9 years ago | (#13013893)

C is the most commonly used language period.

As this is at least the second time you've made this statement in the thread, I feel I must correct you. In terms of total lines of code, it's a well-known fact that COBOL is the most commonly used language. I'm reasonably sure C is a fairly distant second.

If you're going to heckle people, at least get your facts straight.

Re:Why would you use this? (1)

anthm (894202) | about 9 years ago | (#13013804)

Please bear with me because it took a great deal of discipline to choose kind words for my reply. You must resist the urge to compulsively say the first thing that comes into your mind especially when your words will be seen by many thousands of people. The statement that C is slow and has no compiler is a dead giveaway that you have no idea at all what you are talking about. It may look nice to see your words in print and all but you must realize that it is a moot point to try and compare C to Java because Java is a language designed to run on any platform and in most cases the Java Implementation itself is written in C. Take Linux for instance, The entire operating system it 100% C, every UNIX variant is like a big living breathing C environment including Sun Solaris where Java was born. So you see, you are welcome to appreciate Java but keep in mind that C is the low level language that just about every other programming language is written in. So to summarize, Everything you do in Java is in turn calling C or C++ code which then calls the operating system's system call. Therefore you should avoid saying things like Java is faster or better than C or the next person that replies may not be so civil.

Re:Why would you use this? (2, Interesting)

hungrygrue (872970) | about 9 years ago | (#13013822)

The sad thing is that half of the "l33t hax0r" kiddies here probably took this seriously. My theory is that after a few revisions, Java will become a perfectly usable language. The poor design decisions will be fixed and the JVM will be eliminated. The result will be a fast compiled language with an elegant syntax. Of course they they will have just recreated C at that point, so I guess it will never actually happen.

Because... (2, Funny)

crow_t_robot (528562) | about 9 years ago | (#13013345)

...you don't have any cool graphics on your cover page.

Re:Because... (-1, Flamebait)

Anonymous Coward | about 9 years ago | (#13013602)

LOL. That sig. Terrible.

can anyone set up a .torrent ? (1)

for_usenet (550217) | about 9 years ago | (#13013364)

Just a handful of comments, and the links are already not responding. Can anyone seed a torrent and provide that ?

cheers

Coming in at over 200 kb/sec! (0)

Anonymous Coward | about 9 years ago | (#13013487)

Just downloaded it from the mirror at over 200 kb/sec, no need for a torrent. It's only 7.5 Meg anyway.

Re:can anyone set up a .torrent ? (1)

slavemowgli (585321) | about 9 years ago | (#13013713)

It's all on mirrordot.

Mirror of pdf here (5, Informative)

derek_farn (689539) | about 9 years ago | (#13013370)

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

Author comments (4, Informative)

derek_farn (689539) | about 9 years ago | (#13013819)

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 [amazon.com] , the ISBN number is 0201709171. Perhaps Addison Wesley [awprofessional.com] will change their mind if enough order are received.

  • Information on typos. Please keep sending these to me. I am keeping a log [knosof.co.uk] of these so that writers of grammar checkers have some real world data.

Did you consider.... (5, Interesting)

Anonymous Coward | about 9 years ago | (#13013383)

...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.

Re:Did you consider.... (2, Interesting)

mmaddox (155681) | about 9 years ago | (#13013492)

...publishers prefer to have things come in chapter-by-chapter so things can be directed along the way...

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 publish anything and everything tech-related, but that time is long-gone.

How much editing did you get? How far did you get before notification?

Re:Did you consider.... (2)

mopomi (696055) | about 9 years ago | (#13013703)

You could also consider "self-publishing", as well as creative commons. . . Something like http://cafepress.com/ [cafepress.com] , which sends you a check for anything over their costs - some profit for themselves. You determine the price, AND you continue to own the copyright, so you can still provide free downloads of the PDF, if you like.

I have no affiliation with Cafepress besides having bought a couple of t-shirts from them.

attaboy (2, Interesting)

aendeuryu (844048) | about 9 years ago | (#13013394)

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.

Re:attaboy (1)

TheRaven64 (641858) | about 9 years ago | (#13013568)

Another thing that's nice to see is the authors of books that are out of print releasing PDF versions for download. I have recently read Practical Filesystem Design and The UNIX Haters' Handbook in PDF form. Both of these were out of print when I tried to get hold of copies, and both were available for download from the authors' web sites.

One Thousand Sixteen Pages? (4, Insightful)

mbessey (304651) | about 9 years ago | (#13013407)

Good grief. I can see why the publisher bailed on this. I wonder how much they would have had to charge for it?

-Mark

Actually....One Thousand Six Hundred and Sixteen (3, Informative)

Rolan (20257) | about 9 years ago | (#13013438)

1616 pages....

1616 (4, Funny)

mnemonic_ (164550) | about 9 years ago | (#13013462)

That's the number of the beast multiplied by 2.426! Incredible!

Re:1616 (1, Interesting)

Anonymous Coward | about 9 years ago | (#13013545)

Actually I've found a nice pattern in the number 1616/666:

calc.exe gives 2,4264264264264264264264264264264

Amazing, 426 is repeating itself!

Re:1616 (1)

galen (24777) | about 9 years ago | (#13013717)

Ack! It's the Repeating Decimal of the Beast! The end is nigh!

Re:1616 (1)

elhaf (755704) | about 9 years ago | (#13013632)

Well, the other [religionnewsblog.com] number of the beast is 616, so it's that plus a thousand.

Re:One Thousand Sixteen Pages? (1)

ekephart (256467) | about 9 years ago | (#13013648)

That's not that bad. I have several programming books with 1500 pages give or take.

Re:One Thousand Sixteen Pages? (1)

jejones (115979) | about 9 years ago | (#13013768)

Hey, that's a couple of hundred pages less than the average C++ book, and there are lots of those on the shelves.

"The New" (3, Insightful)

hey (83763) | about 9 years ago | (#13013465)

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.

Re:"The New" (0)

Anonymous Coward | about 9 years ago | (#13013862)

I run into files with "new" all the time too. I end up having to manually "delete" them.

Interesting outlook (2, Interesting)

LegendOfLink (574790) | about 9 years ago | (#13013467)

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.

Re:Interesting outlook (4, Insightful)

Kupek (75469) | about 9 years ago | (#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.

Re:Interesting outlook (1)

porcupine8 (816071) | about 9 years ago | (#13013644)

I haven't read the book, so I have no clue whether it goes into this. But it's well-known in the field of cognition right now that experts process information within their fields very differently from the way novices process it. A common example is that a chess master can memorize a chess board setup in a few seconds, because their brain automatically breaks it down into useful chunks (moves, etc), whereas a novice has to memorize it piece by piece and has a lot more trouble. That's a pretty basic example that only involves memorizing, but the whole thing extends much further. Experts approach problem-solving within their field in a more intuitive way than novices, and of course what this involves changes in every field.

It would be interesting to see an analysis of how expert computer programmers process code vs how novices do it, with a focus on moving people from novice to expert status. What you describe sounds possible for just reading code, but the more important side is taking the idea of what you want the computer to do and then translating it into the code. I'm betting that expert programmers go about this MUCH differently from novices.

Re:Interesting outlook (1)

LegendOfLink (574790) | about 9 years ago | (#13013755)

So, are you saying that an experienced coder will not look at the "code", but the structure?

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 (2, Informative)

fcw (17221) | about 9 years ago | (#13013712)

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 [ppig.org] 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.

Re:Interesting outlook (1)

TBone (5692) | about 9 years ago | (#13013754)

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 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 state, and begin building the code to reach that state, one line at a time.

Object-orientedness is a way to do what you suggest - write large codebases without requiring the build-one-line-at-a-time approach - but somewhere in there, the code that lets you do in one object method what you would have had to do in 100 lines, is written in 100 lines - you just don't see it publically. RAD tools aid in this goal, too, giving prebuilt frameworks so that you don't have to start with the egg, you can start with a chicken and just cook it. But at some time, someone wrote those hundreds of lines.

Until computing reaches a new paradigm, we're stuck with the step-by-step code that we have to write now. Maybe when we get to quantum computing or something where the code doesn't break down to "If A then B else C", we'll have to break into a new method of programming, but until then, it's line by line for us.

Possibly because.... (-1, Troll)

eldavojohn (898314) | about 9 years ago | (#13013530)

Your publisher had problem printing this possibly because environmentalists screamed and begged for some sanity. I bet this book was a direct violation of the Kyoto treaty, they just had to make sure Bush wasn't going to sign it and then they went ahead with the printing of this book.

Thank you very much for making it available in PDF format, it's a great reference, the next 2000 free hours I have, I'll be sure to take a crack at reading it.

Cool but to what point? (0, Troll)

Anonymous Coward | about 9 years ago | (#13013540)

A huge book for a dead language. C# is where its at now.

Re:Cool but to what point? (3, Insightful)

hungrygrue (872970) | about 9 years ago | (#13013745)

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.

I'm not an estheticist... (2, Insightful)

Anonymous Coward | about 9 years ago | (#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.

I'm waiting for D (4, Funny)

winkydink (650484) | about 9 years ago | (#13013558)

I don't think this C-thing is going to catch on. :)

Re:I'm waiting for D (2, Informative)

Umbral Blot (737704) | about 9 years ago | (#13013636)

Wait no more [digitalmars.com]

Re:I'm waiting for D (0, Redundant)

zephc (225327) | about 9 years ago | (#13013646)

your await has completed! [digitalmars.com]

Wait no more! (1, Redundant)

JordanH (75307) | about 9 years ago | (#13013710)

The D Programming Language! [digitalmars.com]

And when you're done with that you could move on to E [erights.org] and F [fortran.com] ....

Encryption / Protection (0)

Anonymous Coward | about 9 years ago | (#13013566)

The .pdf file is not protected from cut/paste or modification in any way. I would expect this is not a good way to release this type of document. It could untimately lead to corrupted/modified versions with the author's name on them.

C0X (4, Funny)

zephc (225327) | about 9 years ago | (#13013587)

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.

Re:C0X (0)

Anonymous Coward | about 9 years ago | (#13013827)

The men that like C0X say there's nothing like the feel of the thick C0X standard in your hands.

Flattering, but I am not a gay!

Alan

Nice to have on the bookshelf...for a few of us (3, Insightful)

museumpeace (735109) | about 9 years ago | (#13013598)

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 book...it 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.

Re:Nice to have on the bookshelf...for a few of us (1, Funny)

Doctor Memory (6336) | about 9 years ago | (#13013665)

where is the Karma Reset button

Around here that's known as a "trigger"...

shoulda used booksurge (3, Insightful)

MatD (895409) | about 9 years ago | (#13013603)

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.

Dupe??? (1)

advocate_one (662832) | about 9 years ago | (#13013615)

I'm suffering from a sense of Deja Moo... I'm sure I saw this last month...

Re:Dupe??? (1, Informative)

Anonymous Coward | about 9 years ago | (#13013748)

> 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 [slashdot.org]

Ain't no K&R (1)

hey (83763) | about 9 years ago | (#13013641)

Some lacking the elegance of the K&R book.
Good thing this isn't the first book about C or
it would never take off.

You don't need new standards (5, Interesting)

GamblerZG (866389) | about 9 years ago | (#13013658)

What you really need is a new language [digitalmars.com] .

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.

mirror 2 (0)

Anonymous Coward | about 9 years ago | (#13013738)

extra mirror for slashdot effect http://www.stopaol.com/files/pdf/cbook1_0a.pdf [stopaol.com]

Availability through LULU (5, Informative)

ewilts (121990) | about 9 years ago | (#13013895)

Have you considered making the book available through http://www.lulu.com/ [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).
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?
or Connect with...

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>