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.

400 comments

  1. Thinly Veiled Job Request by Uber+Banker · · Score: 2, Interesting

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

    1. Re:Thinly Veiled Job Request by DenDave · · Score: 5, Insightful

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

      --
      -if at first you don't succeed, stay the heck away from paragliding.
    2. Re:Thinly Veiled Job Request by Otter · · Score: 1
      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?

    3. Re:Thinly Veiled Job Request by ekephart · · Score: 3, Insightful

      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.

      --
      sig
    4. Re:Thinly Veiled Job Request by Anonymous Coward · · Score: 2, Insightful

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

    5. Re:Thinly Veiled Job Request by GeckoX · · Score: 1

      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.

      --
      No Comment.
    6. Re:Thinly Veiled Job Request by fm6 · · Score: 1
      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!

    7. Re:Thinly Veiled Job Request by iminplaya · · Score: 0, Redundant

      Man! Good thing I read the thread first. I almost posted this: "What about us really horrible C programmers? Maybe this will help me pick up the pieces and sweep up the ashes..." When I saw yours just in time. Whew, beat the redundant mod by that much.

      --
      What?
    8. Re:Thinly Veiled Job Request by iminplaya · · Score: 2, Funny

      (Score:0, Redundant)

      Do'h!

      --
      What?
    9. Re:Thinly Veiled Job Request by fm6 · · Score: 1
      ...not being insane enough to download a book-length PDF linked off the newest story on /.
      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 anybody would go to that much trouble just read your rants.

      Another example of PDF abuse. If you're going a large work available online, you need to make it browseable. You can make PDF files browseable, though usually a set of HTML pages works much better. (HTML would be particularly appropriate in this case, with hundreds of short topics.) But generating browseable PDF and HTML both require foresight, planning, a bit of work, and consideration for the needs of your readers.

    10. Re:Thinly Veiled Job Request by kenji_watanabe · · Score: 1

      Your book is a style guide: a reference of background information and pointers how best to code

      Did you even skim the pdf before posting? While it does include a coding guidelines section with each section, it also has a commentary section, language and standard comparision, etc... For example, when was the last time you read a style guide went into a lengthy discussion on the probability of floating point errors based on implementation. Given your current position, Knuth and Strang produce texts that are useless as they are not a cookbook for produce {latest widget} in {latest language}.

      Your post does raise the more interesting question of finding the the soul of computer science.

    11. Re:Thinly Veiled Job Request by WaterBreath · · Score: 1

      But generating browseable PDF and HTML both require foresight, planning, a bit of work, and consideration for the needs of your readers

      Considering it was openly stated that this was a sort of "last resort" method of publishing, I think it's an understandable first step the author. The author put a lot of effort into publishing this as a book, expecting it would be published as a book. I can understand not wanting to duplicate the effort. But I do think that your recommendations should be taken under consideration, and the author should keep this a "living" document, with a continued effort to make it more digestible in the medium it now occupies.

    12. Re:Thinly Veiled Job Request by Anonymous Coward · · Score: 0

      for whom do you intend this book to be most useful for

      You have a call from the Department of Redundancy Department calling for you on lines 2, 5 and 7.

    13. Re:Thinly Veiled Job Request by Anonymous Coward · · Score: 0

      If you read TFA at http://theinquirer.net/?article=24092 then you will figure out that this post and book is not a desperate cry-out for a job. This guy definitely knows his stuff about C and I'm grateful that he's allowing us to download his PDF for free. The content looks to be very interesting!

    14. Re:Thinly Veiled Job Request by swimmar132 · · Score: 1

      Those are the only reasons to know C?

      How about having the ability to extend, modify, and maintain the gazillion of programs out there that are written in C?

    15. Re:Thinly Veiled Job Request by erydo · · Score: 1
      ...the book used the word shall so much when I tried to count the amount Adobe Reader hung for 2 minutes.
      Almost all of the instances of 'shall' are from direct quotations of the standard; your implication 'his' overuse of the word is misleading.
    16. Re:Thinly Veiled Job Request by im_thatoneguy · · Score: 1

      Perhaps it shall be used as a manual for CRobots?
      http://www.geocities.com/crobots32/index.html

    17. Re:Thinly Veiled Job Request by KutuluWare · · Score: 1
      the book used the word shall so much when I tried to count the amount Adobe Reader hung for 2 minutes.


      Did you take into account the fact that the book quotes the entire ISO C99 standard, for which the word "shall" has a specific meaning? And which uses the word "shall" to describe a large number of requirements for a conforming implementation?
    18. Re:Thinly Veiled Job Request by jericho4.0 · · Score: 1
      I've met several programmers who only know Java. Many of them can write great code. But they all have been guilty of statements that show a uncertainty about how a computer actually works, and that seems deeply wrong.

      The death of C has been greatly exagerated, and there's a very good reason for that.

      --
      "A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
    19. Re:Thinly Veiled Job Request by MacBorg · · Score: 1

      I'd say its aimed at people like me: learning C for personal gain (and scientific use) who love to have good reference books floating around. I'll take a look.

    20. Re:Thinly Veiled Job Request by __aaclcg7560 · · Score: 1

      I'm in that boat. I tooked all the available Java courses because the local community college wasn't offering C/C++ for a three year period. So I know how to program and put an application together. I'm now learning C/C++ and I'm having the hardest time understanding some concepts because Java "fixes" a lot of the issues in C/C++. Some of the C/C++ stuff I can understand for bare metal programming, but I'm having a hard time using it for application programming. Is it possible to be fluent in both?

    21. Re:Thinly Veiled Job Request by Anonymous Coward · · Score: 0

      According to the article, he wrote it over several years.

      Hardly the model to follow if it was, as you suggest, a thinly veiled job request. (Personally, I think you're a loon if you think that.)

    22. Re:Thinly Veiled Job Request by The+Clockwork+Troll · · Score: 1
      the only reasona for knowing C today is to interact on a close level with the machine
      Bullshit. As anyone who's interviewed for a coding job in the past 20 years can tell you, the real reason to know C is because it's the gold standard language for reversing strings.
      --

      There are no karma whores, only moderation johns
  2. Why not self publish? by killproc · · Score: 3, Insightful

    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.
    1. Re:Why not self publish? by smittyoneeach · · Score: 1
      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.
      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    2. Re:Why not self publish? by Anonymous Coward · · Score: 0

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

    3. Re:Why not self publish? by AuMatar · · Score: 1

      for something like this, I think you want wikisource.org, not wikipedia. Of course, for that the author needs to be willing to release it under the GFDL, with no invariant clauses.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    4. Re:Why not self publish? by jericho4.0 · · Score: 1

      I've spent some time browsing wikisource recently. It's a shame that it's not nearly as rich as wikipedia. Maybe they should be merged (or wikipedia should hype it) so as to encourage 'pedia editors to add sources. Too many vanity pages, as it is....

      --
      "A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
    5. Re:Why not self publish? by AuMatar · · Score: 1

      The wiki foundation itself has way to many wikis right now. We have wikipedia, wiktionary, wikibooks, wikisource, and a fledgling wikiversity. The first 2 end up getting all the love. Wikibooks comes in 3rd, but it has major problems in achieving its stated goal (its to write textbooks and instructional books, but they end up reading like wikipedia entries, not text books). I'm not entirely sure why wikibooks and wikisource are separate. Wikiversity is struggling to get off the ground. And half these things are widely unknown. I think Wiki Foundation is in desperate need of some organization and focusing of resources.

      ANd yes, I am trying to help, by writing my own wikibook. I will probably end up trying to do a wikiversity class when my life is a little more predicatble.

      --
      I still have more fans than freaks. WTF is wrong with you people?
  3. Again...? by __aaclcg7560 · · Score: 0

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

    1. 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.
    2. Re:Again...? by Anonymous Coward · · Score: 0

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

    3. Re:Again...? by tomhudson · · Score: 1
      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++ )
    4. Re:Again...? by slavemowgli · · Score: 1

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

      --
      quidquid latine dictum sit altum videtur.
    5. 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'?

    6. Re:Again...? by Stibidor · · Score: 1

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

    7. 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
    8. Re:Again...? by Skye16 · · Score: 2, Insightful

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

    9. Re:Again...? by saider · · Score: 1


      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.

      --


      Remember, You are unique...just like everyone else.
    10. Re:Again...? by Anonymous Coward · · Score: 1, Interesting

      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.

    11. Re:Again...? by RailGunner · · Score: 1
      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.

    12. Re:Again...? by amightywind · · Score: 1

      Today, as in the olden days, this:

      i MAX_COUNT, i++

      would fail to compile.

      --
      an ill wind that blows no good
    13. Re:Again...? by cant_get_a_good_nick · · Score: 1

      Some of it is to get some lessons from ANSI C++:
      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 yrou head around it. This is a new keyword to help give information about pointers and what they may alias (multiple pointers to the same variable). Compilers have difficulty with certain optimizations becasue they can never guarantee aliasing. With restrict, you're trying to give it hints. I'm sure this will be a cause of bugs in code for years.

    14. Re:Again...? by tomhudson · · Score: 2, Insightful
      ... 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.

    15. Re:Again...? by Swamii · · Score: 1

      But what if the intent of the poster was to write an html tag (which is more often the case than not)?

      If you want to write sharp brackets on some programming message board that allows HTML tags, use the "&lt;" for less-than, and "&gt;" code for greater-than. These will show up as sharp brackets in the post, yet will not interfere with the HTML rendering & parsing.

      --
      Tech, life, family, faith: Give me a visit
    16. Re:Again...? by jrumney · · Score: 1
      Today, as in the olden days, this:

      i MAX_COUNT, i++

      would fail to compile.

      Even with with this #define?

      #define MAX_COUNT No code is complete without a #define like that! I'm surprised you didn't think of this possibility yourself.
    17. Re:Again...? by Anonymous Coward · · Score: 0

      > why can't they fix it (slashcode) so that we can insert code samples properly?

      That's what <ecode> is for.

      But seriously, you could have just stopped after "why don't they fix slashcode". Slash is unmaintained. Do not expect further functionality from it, ever.

    18. Re:Again...? by bladesjester · · Score: 1

      I remember that problem. There is code to fix that, but seeing random programs crash as a pointer wandered happily through system memory, re-writing random stuff.

      It was amusing in retrospect, but I thought I was going to have a heart attack trying to figure out what was wrong with my code (because it worked perfectly in Solaris) since there was nothing wrong with my code lol

      --
      Everything I need to know I learned by killing smart people and eating their brains.
    19. 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.

    20. Re:Again...? by tomhudson · · Score: 1

      ecode doesn't indent properly - they have it screwed up intentionally to prevent the page-widening trolls (same as inserting spaces at random)

    21. Re:Again...? by lgw · · Score: 1

      'i' is introduced in the main flow, *not* in the body of the for loop. It should be (and is) visible everywhere in the containging block, just as if the "int i" had been on the previous line. This is handy in the common case where you want to know what 'i' was when the loop exited.

      In any case, only a block introduces a new scope, and the declaration is outside the for block, so it makes sense that it's in the larger scope.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    22. Re:Again...? by Frank+T.+Lofaro+Jr. · · Score: 1

      Use "Extrans (html tags to text)" and Slashdot automatically does the conversion to entities.

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

      Of course, you can't do any HTML that way, so if you need HTML tags, you need to use a different option and do the entities yourself, like this:

      &amp;
      &lt;
      &gt;

      Don't forget the semicolon, people!

      --
      Just because it CAN be done, doesn't mean it should!
    23. Re:Again...? by doomdog · · Score: 1

      It isn't code that fixes it - just a simple compiler command line switch:

      /Zc:forScope (See the MSDN Documentation)

    24. Re:Again...? by Bill+Dog · · Score: 1
      Technically you can, by checking "Disable language extensions" in the C/C++ project settings (removes the /Ze ("extensions") compiler switch and adds /Za ("ANSI")). But then neither MFC nor the Standard C++ Library work. MFC pre-dates the standard, and was written correctly for its time -- for example, the C++ FAQ Lite's item on for-loop scoping includes the line:
      The following code used to be legal, but not any more, since i's scope is now inside the for loop only: ...
      Have no idea why P. J. Plauger's Standard C++ Library implementation relies on MS extensions (or doesn't compile cleanly on VC++ 6's strictest warning level, for that matter).

      Anyways, there's the #define hack that's the standard workaround for the for-loop scoping issue.
      --
      Attention zealots and haters: 00100 00100
    25. Re:Again...? by Kuros_overkill · · Score: 1

      lets the programmer see what type it is without having to scroll up to the top of the function. I thought that was what Hungarian notation was for. i, j, k, x, and y where always assumed to be ints

  4. Why would you use this? by Anonymous Coward · · Score: 5, Funny

    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!

    1. Re:Why would you use this? by satan666 · · Score: 5, Funny

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

    2. Re:Why would you use this? by dorkygeek · · Score: 1

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

      --
      Windows is like decaf - it tastes like the real thing, but it won't get you through the day.
    3. Re:Why would you use this? by sconeu · · Score: 1

      COBOL? COBOL???

      Come on, use something a bit better...

      Maybe SNOBOL or SPITBOL. And of course, there's always Ada83 or PL/1!

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    4. Re:Why would you use this? by Anonymous Coward · · Score: 0

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

    5. Re:Why would you use this? by dorkygeek · · Score: 0, Flamebait

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

      --
      Windows is like decaf - it tastes like the real thing, but it won't get you through the day.
    6. Re:Why would you use this? by Anonymous Coward · · Score: 0

      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.

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

    8. Re:Why would you use this? by Anonymous Coward · · Score: 0

      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.

    9. Re:Why would you use this? by hungrygrue · · Score: 1
      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.
    10. Re:Why would you use this? by Anonymous Coward · · Score: 0

      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.

    11. Re:Why would you use this? by dorkygeek · · Score: 1

      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.

      --
      Windows is like decaf - it tastes like the real thing, but it won't get you through the day.
    12. Re:Why would you use this? by SpryGuy · · Score: 1

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

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
    13. Re:Why would you use this? by anthm · · Score: 1

      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.

    14. Re:Why would you use this? by hungrygrue · · Score: 2, Interesting

      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.

    15. Re:Why would you use this? by Anonymous Coward · · Score: 4, Insightful

      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.

    16. Re:Why would you use this? by Anonymous Coward · · Score: 0

      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.

    17. Re:Why would you use this? by The_Wilschon · · Score: 3, Insightful

      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.

      --
      SIGSEGV caught, terminating

      wait... not that kind of sig.
    18. Re:Why would you use this? by satan666 · · Score: 1

      I might need to re-evaluate my initial position. ADA might just beat COBOL. But ADA does not have the cool COBOL syntax.

      I mean look at the this example:

      C: a++;
      COBOL: ADD Num1, Num1 GIVING Result

      Hah! Which would you choose? Me? COBOL BABY!!!

    19. Re:Why would you use this? by Anonymous Coward · · Score: 0

      I am pretty sure I read some stats saying otherwise, at least when you move out of the embedded space. From what I remember, VB is the most used language. Think business application and non-programmer doing some programming.

    20. Re:Why would you use this? by dorkygeek · · Score: 1

      If you would use your eyes or some other replacement device to read my post, you would have seen that I clearly stated for what kind of jobs I promoted Java to be used.

      But hey, if people don't use their brains, what can I do.

      --
      Windows is like decaf - it tastes like the real thing, but it won't get you through the day.
    21. Re:Why would you use this? by plover · · Score: 1
      I prefer the ISO's standard object-oriented version of COBOL:
      9000-ADD-ONE-TO-COBOL.
      --
      John
    22. Re:Why would you use this? by 70Bang · · Score: 1



      Hey!

      Despite coming up through the ranks as a mainframe systems programmer, I made a lot of money with COBOL, SNOBOL, and PL/I!

      (systems people who could outcode applications coders were pretty valuable because they could do both [systems and applications])

      PL/I is not a bad language. I would daresay most /. people who are good (not just like to) C and Pascal/Delphi programmers could pick up PL/I pretty fast and make it do anything they want it to.

      The primary purpose SNOBOL would have in today's coding world would be for those who can't learn PERL. It (SNOBOL) is not a tough language to learn, either.

      BLISS anyone?

      One of the biggest shortcomings of a lot of programmers (now) is the languages they have restricted themselves to: for the most part - C, C++, Visual Basic|VBA, Delphi, Java, PERL, perhaps LISP, and now, the .NET languages. This isn't meant to be comprehensive, so a response of "I know <x>, so there." The point isn't in finding exceptions. It's in learning diversity. What's the point in knowing two or three languages which are so close to each other in syntax & purpose they become Twin Sons of Different Mothers? (why do you need a collection of screwdrivers when you could have a screwdriver, a pair of pliers, a hammer, etc.?)

      Obviously, there's not much of a market outside of those languages, but some of the older languages provide ideas or techniques you can "steal" and use elsewhere.

      It's no different than other OSes|platforms. Commands, sub-architectures, software, etc. can be swiped and used on "modern" systems. You want to see a broad repertoire of functions? Check out IBM's AS (Application System)

      p.s. The punctuation-challenged can pretend OSes was typed as OS's (gag).


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

      You don't know what you are talking about.

      --
      XML causes global warming.
    24. Re:Why would you use this? by 0xABADC0DA · · Score: 1

      If you care about startup time, use gcj and get the startup time of C code.

      And I don't get it how people can say they "care about memory usage" so Java is out. Memory allocation in Java is one pointer increment. Big-Oh of one instruction. In almost all cases C is worse for heap allocation, in performance and space efficiency (since it cannot move allocations that are in use to compact them). C wins on stack-based variables and large arrays. Which one has better memory usage depends on the software you are writing.

    25. Re:Why would you use this? by plover · · Score: 1

      Since it's somewhat apparent from your writing that English isn't your first language (I mean no offense as you write quite well,) it appears that you also missed that the original poster was not being serious. It was very obvious to most of us that he was telling a joke.

      --
      John
    26. Re:Why would you use this? by Anonymous Coward · · Score: 0

      I think a smart person such as yourself should be able to recognize a joke aimed at the more knowledgeable crowd LMFAO.

      Geez... Anyone that took that post seriously is either a dyed in the wool (yet sadly ill informed) java fanatic, has no sense of humor at all, or is probably oblivious to even moderately obvious sarcasm.

      Amazing... Take the rest of today off... you need it.

      l8,
      AC

    27. Re:Why would you use this? by Anonymous Coward · · Score: 0

      EXCELLENT Point. Excellent Reply.

      I would only add, that C is a mid-level language. Not quite Assembly Language, but not quate a high level language.

      Almost 100% Of linux is written in C except for "code that switches the CPU from ring 0 to rings 1 or 2 or that manipulates the MMU must be done in assembler." ( from kernel books, its said that this comprises less than 15% ) "Linux kernel contains an estimated 15% assembler code witch is considered very low and very ... I've being told that even printf was written in assembler."

      You also should point out that ALMOST EVERY UNIX DISTRUBUTION COMES WITH A C COMPILER, and c compiling can be distrubuted. "distcc is a program to distribute compilation of C, C++, Objective C and Objective C++ code between several machines on a network."

    28. Re:Why would you use this? by dorkygeek · · Score: 1
      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.

      I agree with you that design is key when it comes to maintainability and enhanceability. But my point is that the object-orientation of Java supports you in creating good designs. Designs, which cannot be done using C, unless you go all the way down and simulate object-orientation (which, in fact, a lot of projects do, see e.g. evolution). But then I ask myself: why should I bother using C, if I am going to mimic an OOP language anyway, so I can directly go and use something like C++, Java or C# (of course, you shouldn't use C++ if you want to easily have mobility).

      Of course, you can also go and write your programs in the good ol' monolithic, unmodularised way, using Java. Then, of course (apart from mobility and security), you could go as well with C.
      --
      Windows is like decaf - it tastes like the real thing, but it won't get you through the day.
    29. Re:Why would you use this? by dorkygeek · · Score: 1
      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.

      Sorry, but this argument is plain wrong! Following your logic, we should all use assembly language, because this gives us greatest power, and if we get it right or not only depends on our programming skills.

      You seem to forget that at the end of the 60'ies, there was something called the software crisis. Let me quote Dijkstra:

      The cause of the software crisis is that the machines have become several orders of magnitude more powerful! To put it quite bluntly: as long as there were no machines, programming was no problem at all; when we had a few weak computers, programming became a mild problem, and now we have gigantic computers, programming has become an equally gigantic problem.
      You cannot solve all problems by blaming the skills of people!
      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.

      Must be bad universities, I for one had the luck to attend a lot of very good and deep courses about system programming, computer architecture and digital design. And besides of that: universities are not there to train programmers, they are there to create scientists (guess why it's called 'computer science'). If you want programmers, you better go and look for them in vocational schools!

      People should get over it that programming with C once has to come to an end. Research is moving forward rapidly, increasing the levels of abstraction of program representation more and more. There are a lot of things to gained by this, consider more easily provable code, etc.!
      --
      Windows is like decaf - it tastes like the real thing, but it won't get you through the day.
    30. Re:Why would you use this? by 0xABADC0DA · · Score: 1

      maintainability and enhanceability, at least, are entirely dependent on the quality of the programmer

      Change a constant in Java and if it is going to break something more often than not you get an error telling you exactly where the problem was and what the call stack was. In C it's not so unusual that you can't even get the call stack (with gdb) because it has been trashed, leading to a long process of stepping through various functions one line at a time.

      In Java when you know a lot more for certain. If you have a reference to an object you know what types it could be, that it has been initialized by a constructor, that it isn't simultaneously co-located with other objects, etc. In C/C++ you don't, so when things go bad (because of a lame developer or code rot or whatever) they can go much worse. Somebody casts a char *buf returned from gets into a Config object with the comment 'read config from stdin'. And it works, kinda...

      The reason why there is a obfuscated C contest is because C code doesn't even have to look like what it does. Obfuscated Java looks like what it does, so you just have to follow the steps not figure out what those steps are. Java is like a tide that raises all boats for maintainability and enhanceability, even the crappy ones, where C is like an anchor always trying to drag the project down into the depths.

    31. Re:Why would you use this? by dorkygeek · · Score: 1

      C'mon, just another C zealot, aren't you? I know exactly what weakly typed, strongly typed, type safety, type systems, higher order programming etc. means (at least, that's my bread and butter). But I don't need to publicly brag about that.

      And just to reply to this other fucktard (which he likes to call other people): I know what pointers are, but you obviously don't know what Java or C# or any other object-oriented and type safe language is. Passing of complex types in Java is entirely reference oriented. The difference to pointers is that you can't do arithmetic on the references, which you may consider a show stopper, but I consider increased security.

      If you just cannot go without pointer arithmetic, I would advise you to use C#, where you can switch to unsafe mode, and then perform all the ugly stuff you ever wanted to do (but don't whine to me if your program breaks, fucktard!! He he he... :) ).

      Oh yes, and to all you "C is the one and only" zealots outthere: consider e.g. the following statement made by John Hughes at the beginning of the functional programming era:

      As software becomes more and more complex, it is more and more important to structure it well. Well-structured software is easy to write, easy to debug, and provides a collection of modules that can be re-used to reduce future programming costs. Conventional languages place conceptual limits on the way problems can be modularised.

      PS: sadly, we never had any real programming classes in high school, they all thought that web design would be all you need in your entire life...

      PPS: About shaving, there you might be right though, it's now nearly a week since I've shaved the last time, must look horrible by now (fortunately, people around here are used to it).
      --
      Windows is like decaf - it tastes like the real thing, but it won't get you through the day.
    32. Re:Why would you use this? by Anonymous Coward · · Score: 0

      I can port a 200+ line COBOL program to a 25-line C program.

      Redo your calculations with a proper weighting for the inefficiency of COBOL, and you'll find C is much more prevalent.

    33. Re:Why would you use this? by Anonymous Coward · · Score: 0

      Wasn't sasser writting in VB (Viral Basic)?

    34. Re:Why would you use this? by shish · · Score: 1

      Or rather than wait, you could use C# now...

      --
      I mod down anyone who says "I will be modded down for this", regardless of the rest of their comment
    35. Re:Why would you use this? by MindStalker · · Score: 1

      In fact I believe all C++ compilers will compile C. Anyone care to correct me on this?

    36. Re:Why would you use this? by dorkygeek · · Score: 0
      Geez... Anyone that took that post seriously is either a dyed in the wool (yet sadly ill informed) java fanatic, has no sense of humor at all, or is probably oblivious to even moderately obvious sarcasm.
      Do me a favor and apply some logic to your comments the next time before you post!

      You say that the joke was about C. I.e. Java was favored and C was being thrashed. That's correct. But then you go on and say that Java fanatics were offensed by this post as well. Now that's where your logic fails. Since Java was favored, the Java guys cannot feel attacked, because it was C which was being made fun of. Q.E.D.

      --
      Windows is like decaf - it tastes like the real thing, but it won't get you through the day.
    37. Re:Why would you use this? by caswelmo · · Score: 1

      Do you have any data to back that up? I've never seen a "weighted" measure of how much code is in the world.

    38. Re:Why would you use this? by lgw · · Score: 1

      Smalltalk was the only *real* object oriented language, the rest are faking it. :P

      Real men program in machine code - with a disk sector editor, no wussy text editors! (I actually used to fix bugs this way in test code, because it would take an hour to recompile, no joke.)

      --
      Socialism: a lie told by totalitarians and believed by fools.
    39. Re:Why would you use this? by 0xABADC0DA · · Score: 1

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

      That's true, but sometimes less is more. Java took away a lot of features from C++, like multiple inheritance, templates, structures, etc and the result is a better language. It's the same way in real life a person isn't allowed to do anything they physically could do according to the rules of the Earth Simulator that we run in because it would be chaos that ultimately leads to some byzantine order, like some huge C project gone bad.

      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.

      No that's not it at all, it's because they have no use for the power they are missing. The benefits far outweight the costs. If you look at "Frontier House" you see people spending all day doing things that take us seconds, like buying a stick of butter instead of churning it for hours. It's the same with assembly, sure you *could* have it automatically relocate live objects in memory like Java does, but all your code would have to live with a lot of the same restrictions (not xor'ing the next/previous addresses into one to save space, not using non-stack space as a stack, etc). So you often end up with the same thing, but just doing it the *really* hard, slow way.

    40. Re:Why would you use this? by lgw · · Score: 1

      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.

      The wisest words I've seen on programming on Slashdot! That doesn't mean modern languages are for the weak, by any means, as coding speed is ususally important, but you *don't* need a modern programming language to do things the Right Way with a low-level language, you don't even have to be that careful, with modern techniques.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    41. Re:Why would you use this? by Anonymous Coward · · Score: 0

      It saddens me that anyone could have been hit so hard and so many times with the stupid stick. Where was the department of family services? Terri Schiavo could teach you a few things, very young and stupid one. Have you ever even HEARD of pubic hair? Linux is NOT 100% C. It includes C++, Assembler, Pascal, and others. There isn't enough time in a day to point out the countless other errors, mistruths, misunderstandings, and other displays of your complete lack of all knowledge and intelligence in that fucking retarded post of yours. Please go jump off the nearest bridge while you're wearing concrete shoes and jeans with pockets full of lead. Fucktard.

    42. Re:Why would you use this? by groomed · · Score: 3, Insightful
      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.
    43. Re:Why would you use this? by lgw · · Score: 1

      I care about all of those things, but C++ delivers for me. As a bonus, I also get to avoid the security and stability problems in the Java VM. Nothing like a memory leak in the VM itself to make for a fun time.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    44. Re:Why would you use this? by tehshen · · Score: 1
      With older versions of C you can do stuff with comments:
      int a = 6//**/3;
      ;
      a is 2 in C, 6 in C++
      --
      Guy asked me for a quarter for a cup of coffee. So I bit him.
    45. Re:Why would you use this? by dorkygeek · · Score: 0
      Apart from the fact that the poster I am quoting did not realise the joke, I want to correct some things nevertheless.
      [...] 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.
      Yep, that's right. And now, guess in which language the operating system on which C was born was written? Yes, exactly, assembly language. You see, that's the trail in operating system development so far: first there were no operating systems at all, then came operating systems written in assembly language. People wanted to increase abstraction, and developed C. Back then, C was in the same situtation Java is in at the moment. It was considered impossible to write an operating system in C! Then people came and did it (in fact Dennis Ritchie), and hey, you can see the result today: most operating systems are written in C.

      There may be similar evolutions with regard to managed computation (of course, with some inherent problems concerning the bootstrapping of services needed by the language itself, to be sorted out first).

      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.

      U huuu, wait a minute: "C is the language that just about every other programming language is written in". Are you serious about that? I mean, a programming language cannot be 'written in another' language. A compiler could be written in some other language than the language it compiles, but not even that must be the case (hey guys, the bootstrapping problem of compilers has been solved decades ago). A program is always either compiled into machine code, or into some intermediate language (Java Bytecode, MSIL, P-Code, ...) which is then either interpreted or turned into machine code on the fly (by using a JIT).

      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.

      Nope! Everything we do is calling either some other Java Bytecode, or native (a.k.a. machine) code (or MSIL, if we manage to let Java interface with .Net)!

      --
      Windows is like decaf - it tastes like the real thing, but it won't get you through the day.
    46. Re:Why would you use this? by jhantin · · Score: 1

      The poor design decisions will be fixed and the JVM will be eliminated.

      I doubt either of those things will actually happen. Most of the standard library is a creeping horror from a security and extensibility standpoint, but the fundamental design hasn't changed noticeably since 1.1-- they've just heaped another cargo ship full of additional cruft into the standard runtime with each major release. Stack-based security with principals attached is clumsy, but it appears to be getting treated as the state of the art by both the Java and .Net camps. They both need to be hit with a capability and design pattern cluestick. I'd say to hit them with a COM stick, but they'd probably use the painful parts like object registries and reference counting, and miss the important lesson: abandon globals and statics, interfaces and parameters are the key.

      As for elimination of the JVM, it won't likely happen for a few reasons, most notably that even in a system which entirely precompiles to native code, the JVM is still the basis of the language's functionality specification. A C-like Java compiler can certainly produce correct code so long as the same program does the same thing as it would on a JVM. Also, dynamic loading in Java is specified in terms of JVM bytecode.

      The result will be a fast compiled language with an elegant syntax.

      LMAO! The syntax is about as elegant as C without a preprocessor. In such a fix, one becomes dependent on souped-up editors to churn out boilerplate code. Velocity works as a nice simple preprocessor; for more intricate macros JSE might be a better idea.

      I don't think Java should try to morph into C or C++. In my opinion the JVM is the strongest link in the chain; in exchange for a hit in startup time you get the speed of a compiled language, the flexibility of a symbolic interpreter and the safety of fully checked memory access rolled into one. It's probably not the best thing to build grep or wc on, but it's great for bigger things like daemons and windowed apps.

      --
      ...when you're writing a game...tweak the difficulty of "Easy" to something [your mother] can cope with. -- onion2k
    47. Re:Why would you use this? by Thaelon · · Score: 1

      Yeah this is real elegant:

      ThermonuclearBomb LittleBoy = new ThermonuclearBomb();

      Sure it's easier that malloc'ing but why do I have to tell give the compiler the same information twice? Why not wrap the damn constructor in a memory allocation call giving this:

      LittleBoy = new ThermonuclearBomb();

      --

      Question everything

    48. Re:Why would you use this? by Frank+T.+Lofaro+Jr. · · Score: 1

      X is not a language, it is an windowing system.

      --
      Just because it CAN be done, doesn't mean it should!
    49. Re:Why would you use this? by Lonewolf666 · · Score: 1

      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.

      There is a lot of truth in this, but I think C makes it a little too easy to shoot yourself in the knee by accident. Personally, I prefer languages that allow you to do anything but requires you to announce your intentions, for instance with explicit typecasts when you mix variable types that do usually not mix.
      Object Pascal comes pretty close to my ideals (it is a bit too fussy about allowed vs. illegal typecasts).
      Unlike C, Object Pascal is pretty good at throwing compiler errors in most situations that stem from confusing things. If you actually want to do the supposedly erroneus thing, there are usually mechanisms to get around the errors. Only pointer arithmetics in Object Pascal are a PITA, here you have to go through real contortions to get things done.

      --
      C - the footgun of programming languages
    50. Re:Why would you use this? by Anonymous Coward · · Score: 0

      (posted by dorkygeek)

      Christ you're an insufferable prat. And I say that not to insult you, but to inform you, lest it had escaped your notice.

      Yeah, I hate you too, but this is not to insult you, but to inform you, lest it had escaped your notice!

      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.

      Oh, this is just wonderful! :) You really have no idea how to make an argument. You've quoted Dijkstra, which I think is always a good thing, but let me ask you just one question: WHAT'S YOUR POINT???

      Dijkstra in the above quote said that the actual implementations of the concepts watered down the original idea. Please reread my posts: I've never ever stated that current implementations get the concepts 100% right. I only stated that current approximative implementations of higher level concepts are still better than a perfect implementation of a lower level concept.

      And that's what it is all about! Should we despise current languages just because they only implement the original concepts to 95% instead of 100%, and therefore stick to the old and antiquated languages (which do still have their rights in certain areas, mind you, I have never disputed that fact!)?

    51. Re:Why would you use this? by AuMatar · · Score: 1

      Of course C99 allowed // as a comment operator, so this is no longer true.

      C++ compilers in general can compile about 99% of C code. There's a small amount of features in C not in C++, or handled slightly differently. Generally you can get by withotu them, and when writing library code meant to eb staticly linked, its a good idea to try.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    52. Re:Why would you use this? by Anonymous Coward · · Score: 0

      YHBT. YHL.

    53. Re:Why would you use this? by snorklewacker · · Score: 1

      This is why:

      LittleBoy = new FissionBomb();
      do_some_research();
      Littleboy = new ThermonuclearBomb();

      Do you see the oops? This is fixed easily enough with a "var" keyword. You could even do something like:

      var LittleBoy: FissionBomb();

      Turns out Pascal isn't such a verbose language after all.

      --
      I am no longer wasting my time with slashdot
    54. Re:Why would you use this? by Anonymous Coward · · Score: 0

      Wow, where the hell did you go to school? Obviously they didn't teach you anything about programming languages or syntax, but it now also appears they failed at teaching you English as well! If I was you, and anybody else feel free to chime in here, I would march right up to the superintendent of that school and demand a refund. Holy Christ on the cross, you really need some help. Those last few hundred dodge ball smashes to your head has apparently jarred something loose. Maybe it was oxygen starvation when you got shoved in all those lockers, or perhaps a superwedgie gone awry. No matter what it was, the point is that you really should seek professional help.

    55. Re:Why would you use this? by CrazyTalk · · Score: 1

      No bluetooth. Less space than a Nomad. Lame.

    56. Re:Why would you use this? by Anonymous Coward · · Score: 0
      LittleBoy = new ThermonuclearBomb();

      Ouuchhh!!! You really have no clue what you are talking about!!

      ThermonuclearBomb (1) LittleBoy (2) = new ThermonuclearBomb() (3);

      (1) is the type of variable (2) . (3) then finally assigns an instance of the class ThermonuclearBomb to variable LittleBoy.

      How did you get the idea you could contract the assignment of an object of a certain class directly to a variable?? What type do you want the variable to have??? What if you want LittleBoy to be of supertype of ThermonuclearBomb???! It is quite apparent that you have never ever heard about the concepts of object-orientation in general and specifically not about polymorphism.

    57. Re:Why would you use this? by Com2Kid · · Score: 1
      • There is a lot of truth in this, but I think C makes it a little too easy to shoot yourself in the knee by accident. Personally, I prefer languages that allow you to do anything but requires you to announce your intentions, for instance with explicit typecasts when you mix variable types that do usually not mix.
      battle with the compiler, you have to declare things EXACTLY in the proper place, in the proper order, it is a BITCH. I honestly thinkt that the language has features that no one aside from the implementers are quite sure what they do.

      Now don't get me wrong, as long as you plan on staying away from OO, Ada95 is a WONDERFUL language. Code in it is VERY readable, and VERY obvious. The compiler even catches spelling errors of variable names! (Rather than C's approach which is to give you 50 "undeclared variable" errors.)

      Ada95 was written to do everything for you, but in the end, it makes YOU do everything exactly ITS way. Sure, if you master this one way of doing things, your productivity will go up. I have no doubt about it. Your code will be readable, easily debugged, and likely even pretty efficent. (Ada95's compiler is actually rather good in terms of code efficently, an array of 8 bools takes up 1 byte!)

      The thing here is, there are three ways to get around the "humans are too dumb to understand complex systems" problem:

      1. Make a language simple enough that there are not any really "complex" features built in (C).
      2. Make a language that handles the stupid little details for you, freeing up the programmer's mind to work on the more complicated problems that exist (Scheme, Java, C# to some extent).
      3. Make a B&D language that forces the programmer into one train of thought and one methodology of doing things (Ada).


      Of coures there is C++'s approach:


      • Make the programmer jump through a thousand hoops to use the features that they want, and break inexplicibly until they jump through the hoops just right.

    58. Re:Why would you use this? by sconeu · · Score: 1

      To be honest, PL/1 is one of the first languages I learned. It was the teaching language at good old wustl.edu, back in the early 80s (OK, it was PL/C, which was a PL/1 variant).

      CS135 anyone?

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    59. Re:Why would you use this? by groomed · · Score: 1
      You've quoted Dijkstra
      Oh man. I didn't quote Dijkstra. I quoted you quoting Dijkstra. Dijkstra never said those things.
      I've never ever stated that current implementations get the concepts 100% right.
      The point is that the concepts themselves aren't "100% right".
      Should we despise current languages just because they only implement the original concepts to 95% instead of 100%, and therefore stick to the old and antiquated languages (which do still have their rights in certain areas, mind you, I have never disputed that fact!)?
      The point is that the idea that things will get better if only we do X and Y is nonsense. Things do and will get better in the long run, but they do so because of the sacrifices made by talented and hard working people. Not because of some conceptual mirage.
    60. Re:Why would you use this? by pyrrhonist · · Score: 1
      Real men program in machine code - with a disk sector editor, no wussy text editors! (I actually used to fix bugs this way in test code, because it would take an hour to recompile, no joke.)

      That's why I do, "ed vmlinuz". The compression kinda screws with my head sometimes, but it's faster than unzipping it.

      --
      Show me on the doll where his noodly appendage touched you.
    61. Re:Why would you use this? by PythonCodr · · Score: 1

      Gee ... you mean you can't just say

      LittleBoy = ThermonuclearBomb()
      and have it do the right thing?
      *watches in horror as all his python code stops working...*

      You might want to have a look-see at more than one strongly-typed language to see how how you can actually deal such things... or maybe just start using a real programming language. ;-)

      J
    62. Re:Why would you use this? by Anonymous Coward · · Score: 0
      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.)

      This is EXACTLY why code ends up crufty. Some twit needs to add some new functionality and instead of doing some refactoring he copies two files and changes a couple constants, thereby ensuring that any bug that existed before now exists twice, and duplicating the same code all over the source tree.

    63. Re:Why would you use this? by Ulrich+Hobelmann · · Score: 1

      Exactly. COBOL is common, and it's business-oriented. Why waste your time using a language that's cryptic, and not focused on business? Add to that the fact that C is totally unportable (that's why we use Java, right? write-once, run anywhere)!

      You mean business? Then get a business language!

      (disclaimer: I've never even read a COBOL program)

    64. Re:Why would you use this? by Iffy+Bonzoolie · · Score: 2, Insightful

      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.

      -If

      --
      Run a pencil-and-paper RPG campaign with your far-off friends: Gametable!
    65. Re:Why would you use this? by MynockGuano · · Score: 1

      Dude, who needs data when you're discussing "well known fact[s]"? Get with the program!

    66. Re:Why would you use this? by zoefff · · Score: 1

      and then the question is how often or when?

      how often do you use Bomb littleBoy = new AtomBomb();?

      And more importantly, in what case would you like to do that?

      (did ask the java noob/script kiddie)

    67. Re:Why would you use this? by crucini · · Score: 1
      The reduction of the use of C in our profession marks the decline of real knowledge in the average programmer.

      Speaking just for Silicon Valley, I can't accept your gloom-and-doom scenario. C is very important right now. Even if a job does not involve C coding, C is often used as a measuring stick in the interview. I think a lot of people are using C to screen out the semi-skilled "web engineers" who arrived during the boom.

      OTOH, if you only know C, your opportunities are limited.

      OK, maybe you're right about the average programmer, but the number of programmers has increased. I'm not upset if there's a huge number of java-only programmers writing internal apps at insurance companies.
    68. Re:Why would you use this? by ConceptJunkie · · Score: 1

      Your sarcasm is quite lame. COBOL wasn't designed for speed, it was designed for high lines-of-code counts to satisfy productivity metrics.

      The true language designed for speed is: assembly.

      --
      You are in a maze of twisty little passages, all alike.
    69. Re:Why would you use this? by Iffy+Bonzoolie · · Score: 1

      Well, okay, so again the example is a little simplistic, and you HAD to go and expose the contrivance of it.

      So in the very specific situation when you are creating a local variable and assigning something you are instantiating to it unconditionally, as in the example above, there isn't any real reason to assign something you are instantiating to a supertype. But you could imagine this new contrived example:

      Bomb bomb;
      if (year < 1945)
      {
      bomb = new IncendiaryBomb();
      }
      else if (year < 1952)
      {
      bomb = new AtomBomb();
      }
      else
      {
      bomb = new HydrogenBomb();
      }

      bomb.asplode();


      When you detonate the bomb, you don't need to know what type it is. Hmm, how morbid...

      So, perhaps the simple unconditional assignment to a local variable case happens fairly often, but the proposed shortcut saves, what, a word that could be auto-completed in a decent editor? And is it worth damaging the consistency of the language?

      A language is made up of simple constructs - assignment, calling a function, declaring a variable... The beauty is when you put together all these simple operations into something more complex and useful! I think it's potentially dangerous to start providing more and more constructs that do the same thing in a different way - then you have lots of indistinct choices and people will choose differently. Then when it comes time to look at someone else's code, they may be utilizing strange language features that you never had to learn because they were redundant.

      -If

      --
      Run a pencil-and-paper RPG campaign with your far-off friends: Gametable!
    70. Re:Why would you use this? by Anonymous Coward · · Score: 0

      neither printf nor kprintf are writen in asm. Only mechanisms needed to access variable arguments are needed to be in asm, those too probably through inline asm or even compiler specific C functions.

    71. Re:Why would you use this? by sinserve · · Score: 1

      Wow, why did that get posted "anonymously"? I meant to click "no karma bonus" not "anonymous".

    72. Re:Why would you use this? by Anonymous Coward · · Score: 0

      Ugh, don't mention that nomenclature. At my school that was the first "systems programming" course everyone had to take. First we had to write an emulator for a ficticious CPU's instruction set. Then we had to write an assembler for it. We were all told don't take any other CS courses in the same semester as that one.

    73. Re:Why would you use this? by jericho4.0 · · Score: 1
      Your account is new so I'm going to assume you don't know that you are trolling. Saying "C has a lot of shortcomings, like being only weakly-typed, etc." without putting it in some kind of context is insulting. Some of us have experience (and reguarly use) many languages. But you'll have to pry my copy of "The C Programming Language" from my cold, dead fingers.

      --
      "A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
    74. Re:Why would you use this? by naasking · · Score: 1

      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.

      This is silly. There are two reasons that functional programming hasn't caught on:

      1. performance
      2. politics

      It has nothing to do with any inherent limitations of the paradigm. Performance is largely a thing of the past nowadays, but politics are still keeping many functional languages out of the running.

      I agree that there is no silver bullet for every situation, but the number of circumstances where C is still appropriate are diminishing.

      The only sure thing to get the job done (ie. the silver bullets) are intelligence and hard work. Everything you listed above can just help you get to that goal faster, and with less work. Seems like a good thing to me.

    75. Re:Why would you use this? by Bill+Dog · · Score: 1

      That's true, but sometimes less is more. Java took away a lot of features from C++, ...

      And that's why it sucks. Think of the Patriot Act -- I'm sure John Ashcroft would tell you "less (freedoms) is more". You may prefer the comfort of (the false illusion of security in) totalitarian-like control, but I like my freedom, in life and in coding. Expressiveness is what makes a better language, not dumbdownedness. Take away some major features and you've stripped considerable expressiveness.

      --
      Attention zealots and haters: 00100 00100
    76. Re:Why would you use this? by Bill+Dog · · Score: 1

      The reduction of the use of C in our profession marks the decline of real knowledge in the average programmer.

      Which commensurately marks the decline in real wages for the average programmer. Less knowledge/skills, less pay warranted.

      --
      Attention zealots and haters: 00100 00100
    77. Re:Why would you use this? by Jackmn · · Score: 1

      Being able to do that is the foundation of polymorphism for most c-style OO languages.

    78. Re:Why would you use this? by rp · · Score: 1

      "So many programmers are idiots."

      To many eyes, all bugs are shallow, as Eric Raymind wrote. But it works both ways. Put in front of a one million line program written by someone else, all programmers are idiots: it will take a while to understand the thing well enough to know where and how to make sensible changes. This is what stuff like strong typing was made for. Engineering, rather than the look-mommy-i-can-type-and-it-does-things-for-me 2000 line Perl script you and I spit out every once in a while. The continued use of C outside its original niche, and the inevitable stream of hioghest-urgency bugs that this generates, is clear proof of the immaturity of computer programming as an engineering discipline.

    79. Re:Why would you use this? by StarsAreAlsoFire · · Score: 1

      Oh man, you almost made me cry.

      Some of us have to deal with programs that were written in COBOL. Don't joke about that stuff man!

    80. Re:Why would you use this? by StarsAreAlsoFire · · Score: 1

      I use such things all the time. If you look at Xerces you will see it EVERYWHERE.

      (almost) Everything on the Xerces tree inherits from Node. You can do a bunch of useful stuff on any tree item without needing to figure out what actual type it is -- since all of the superclasses of Node use or override 'getLocalName()' you can call the function with confidence on any Superclass of Node which comes your way:

      Element
      ComplexType
      SimpleType
      Attribute

      and other which I don't recall.

      Another use which you don't hear about much in any computer class is that you can create a base class (or interface, if you want to force Superclasses to create their on instantiation), then you create a default implementation (often you will see 'MyClass' as the base and 'MyClassImpl' as the implementation.

      Then, when you realize what nappy code exists in MyClassImpl, you can create a new class called 'MyLessSuckyClassImpl' and modify your own base code to point to the new class. Any 'outsider' should have been using 'MyClass' and thus will never know that when he updated from version 0.9 to version 1.0 that an completely different class was actually being passed through his functions. Except that it crashes less often or is faster or something.

      This assumes the user has no business creating such classes on his own -- generally constructors would be given protected or private access for such cases, and a static 'createXX()' function inside the Class which returns a new instance of the proper superclass of itself. Consider the java.util.Calendar() class an example.

    81. Re:Why would you use this? by Floody · · Score: 1

      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.

      Nope! Everything we do is calling either some other Java Bytecode, or native (a.k.a. machine) code (or MSIL, if we manage to let Java interface with .Net)!

      And how do you suppose that the byte code or "native machine code" (translation: compiled C) interacts with the OS in order to actually perform i/o or present an interface to the user in any way at all? Magic beans, perhaps?

    82. Re:Why would you use this? by Floody · · Score: 1

      Then, when you realize what nappy code exists in MyClassImpl, you can create a new class called 'MyLessSuckyClassImpl' and modify your own base code to point to the new class. Any 'outsider' should have been using 'MyClass' and thus will never know that when he updated from version 0.9 to version 1.0 that an completely different class was actually being passed through his functions. Except that it crashes less often or is faster or something. This assumes the user has no business creating such classes on his own -- generally constructors would be given protected or private access for such cases, and a static 'createXX()' function inside the Class which returns a new instance of the proper superclass of itself. Consider the java.util.Calendar() class an example.

      Right, and this is precisely what is functionally wrong with java (there's also all the syntax goop, but that's a separate issue), although it is by no means limited strictly to java. The original developer of the base class(es) may have arbitrarily decided that he didn't want someone other than his contructors touching certain "internals" and thus used the horrid OOP concept of "protection" to prevent that.

      Contrast that with a dynmically typed language like python (and yes, I know much of python is just old syntactic tricks rehashed, but they are DAMN good old tricks) where one can not only access any and all attributes/methods/functions (really all the same thing) but can go even deeper and modify a "superclass" (using your parlance) such that it is no longer a superclass, but is instead attached to some other inheritance mechanism and thus all of its ancestors also gain the same inheritance; and it matters not the slightest who the "outsider" or the "insider" is.

      Of course, in reality, you would rarely ever need to do that in python, there are generally far simpler and more elegant ways of achieving precise dynamic behavior with pre-existing objects/classes/functions.

      I believe the buzzword du'jour for this is "aspect-oriented programming", no? Or perhaps a better truism is: "aspect-oriented programming" is what you end up needing when you don't have fully dynamic types and introspection.

    83. Re:Why would you use this? by Anonymous Coward · · Score: 0

      you are f!@#$ insane.

      c compilers are everywhere - you just need to be less ignorant.

      most of todays JVM's are written in C/C++ (sun's JVM and hotspot) so C is as needed today as it was long time ago - it is only the lazy idiotic programmer-wanna-bes the appear to propser in today's s/w industry.

      f!@#$ your c-- (i.e. java) and c_flat (i.e. c#)

      c/C++ is the truth that shall set you free.

    84. Re:Why would you use this? by kpp_kpp · · Score: 1

      i agree.

      all programmers should start with wiring 7400 series nand gates and work up from there.

      i don't think the modern humanized aspects of programming languages are inheritantly evil, but to start at that level and never comprehend what is going on across the wires is a mistake.

      http://www.kpsec.freeuk.com/components/74series.ht m

    85. Re:Why would you use this? by SeventyBang · · Score: 1



      Those aren't the same code.

      Make sure you know what you're talking about before you try to show off.

      First, you have two types of errors which would likely introduce cascading errors; i.e. one typo and the comiler doesn't recover - it continues to toss out crap like a freshman pledge who was forced to binge prune juice during hell week.

      Your mistakes not related to logic:

      1) Your code needs to be all uppercase.
      2) Your "sentence" didn't terminate with a period.

      ADD NUM1, NUM1 GIVING RESULT.

      Now for the logic error:

      These two statements aren't the same thing:

      C: a++;
      COBOL: ADD NUM1, NUM1 GIVING RESULT.

      This, however, is the same as the C statement:

      COBOL: ADD 1 TO NUM1.

      What your code does is this (algebraically):

      RESULT = NUM1 + NUM1.

      Now, if you want to pick on COBOL, try doing this: use a long WRITE statement, compile the source to assembler, then track down the location of that WRITE statement (use a literal string as part of the contents to be output to serve as a beacon). Depending upon the OS, compiler, version, and actual source, you may find a WRITE statement can easily exceed two (and frequently three) pages of assembler.

      In terms of a source::instruction ratio, this is a perfect example of COBOL's "genetic" inefficiency but doesn't mean it's a bad boy. COBOL isn't a bits-n-bytes language and attempting to compare it to a language which is, is probably the sign of someone who really doesn't understand what they're talking about.

    86. Re:Why would you use this? by StarsAreAlsoFire · · Score: 1

      erm... good for python?

      There are many things that are wrong with Java. This is not one of them. It is simply one of the differences between Java and other languages. *shrug*.

      Any programmer who does anything 'arbitrarily' is by definition a bad coder.

      Private and protected constructors make a lot of sense. If I am selling you a library of classes, and I want to do stuff that you should NOT be allowed to touch, I make it private. If you don't understand when to use them... well, bummer. It is hard to say -- you may or may not know what you are talking about. If you do, it doesn't show 100% in your text -- but there is enough there that I don't want to ignore you outright. You know the drill: it is simply very hard to tell from the limited amount we are willing to type ;~)

      The ability to create final methods and private constructors is there for a VERY good reason: so that a particular subclass of a superclass is 100% CERTAIN to behave in a certain fashion when a particular method is called. Private constructors allow for particular 'special' instantiation code to be run 100% every time.

      What you describe as modifying the superclass rather turns my stomach: it means that some idiot can come along and break my code. If a class constructor is declared protected, it should be for a good reason. You shouldn't be trying to 'unprotect' it. If you don't like that it is protected, make your own, or if it is open source figure out WHY they protected it.

      Also, protection prohibits 'viral' code from pretending to be a class of type 'x' and then doing something that 'x' would NEVER do -- like randomly delete files when someone calls 'toString()'. As a few of my programs do allow users to load 3rd party classes which extend my own code, this is somewhat important to me.

    87. Re:Why would you use this? by Anonymous Coward · · Score: 0

      Dude,

      You meant :
      Write-once, debug anywhere !
      That's Java .... ;)

    88. Re:Why would you use this? by Bake · · Score: 1

      Assuming the guy who wrote the C code wasn't a complete asshat and used reserved words in C++ as variable names in C. The words this, new and delete come to mind.

    89. Re:Why would you use this? by Col+Bat+Guano · · Score: 2, Insightful
      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.

    90. Re:Why would you use this? by Fartacus · · Score: 1

      Yeah! But you should really be advocating switching to C#, the better Java.

    91. Re:Why would you use this? by Floody · · Score: 1

      There are many things that are wrong with Java. This is not one of them. It is simply one of the differences between Java and other languages. *shrug*.

      Actually, I was referring more generally to the use of protected/private members (methods, attributes, whatever a given language calls them). Certainly, Java is not unique in the general theme.

      Private and protected constructors make a lot of sense. If I am selling you a library of classes, and I want to do stuff that you should NOT be allowed to touch, I make it private. If you don't understand when to use them... well, bummer. It is hard to say -- you may or may not know what you are talking about. If you do, it doesn't show 100% in your text -- but there is enough there that I don't want to ignore you outright. You know the drill: it is simply very hard to tell from the limited amount we are willing to type ;~)

      Why do you care how I extend your library to suit my own individual/corporate needs, of which you are likely completely unaware when coding the original library? Assuming I am in compliance with whatever licensing terms you have attached to the library, why on earth would it matter how I use it?

      This is not about arbitrary protection/privacy of class elements, it's about the simple unmistakable fact that no developer (or group of developers) is all knowing and can possibly forsee every single potential need/use that exists. Why would you want to limit another downstream developer? In the name of ego?

      What you describe as modifying the superclass rather turns my stomach: it means that some idiot can come along and break my code. If a class constructor is declared protected, it should be for a good reason. You shouldn't be trying to 'unprotect' it. If you don't like that it is protected, make your own, or if it is open source figure out WHY they protected it.

      No, it doesn't mean someone can break your code, it means someone can break their own code. Unless they (a) have your source and (b) have modified it, they cannot alter your code. They can only break their own.

      I do believe that a language should offer clear demarcation between "public" api elements and "private", however iron-clad enforcement of this is just silly and needlessly limiting.

      If someone is using your library in an unsupported fashion, the only reprocussion this has on you is that you don't have to support it. Other than that, I fail to see how it's really any of your business (or my business if I were the developer of said library).

      Also, protection prohibits 'viral' code from pretending to be a class of type 'x' and then doing something that 'x' would NEVER do -- like randomly delete files when someone calls 'toString()'. As a few of my programs do allow users to load 3rd party classes which extend my own code, this is somewhat important to me.

      This is a strawman argument. The given semantics of an OO language's inter-object calls should never be relied on to prevent trojaning. Cryptography is the correct technology to apply for ensuring that the code being executed is actually the intended code.

    92. Re:Why would you use this? by StarsAreAlsoFire · · Score: 1

      You are sincere and not being an ass, so I am happy to answer; these are all reasons of my own, and I don't think they should apply to everyone. They are just my own reasons.

      Why do you care how I extend your library to suit my own individual/corporate needs, of which you are likely completely unaware when coding the original library? Assuming I am in compliance with whatever licensing terms you have attached to the library, why on earth would it matter how I use it?

      This is not about arbitrary protection/privacy of class elements, it's about the simple unmistakable fact that no developer (or group of developers) is all knowing and can possibly forsee every single potential need/use that exists. Why would you want to limit another downstream developer? In the name of ego?


      These two paragraphs have basically the same answer: I protect methods that I don't want to have to support. It really is almost that simple. If I make a method/function public, it HAS to behave a particular way for all possible cases. But sometimes I don't feel like making sure I catch every single bloody thing that some idiot who thinks he's gods gift to programming may throw at it. And I promise, if 500 people use your code more than one of them will use it in some ungodly way that is 100% NOT SUPPORTED and blame you for it throwing some exception that took them five minutes to figure out.

      So the second paragraph of yours kind of answers the first: when I release a function that says it will take 'x' and return 'y' and will throw such-and-such exceptions if you give it bad data somehow, then I *have* to make sure it *always* does that. But if I protect the function, I can relaxe a lot, because *I* know *every single case* that will go into that function. It is a contract. In this sense literally, but in the general sense as well ('lalala function header is your contract with the developer lalala' you probably got the same thing in some class somewhere).

      No, it doesn't mean someone can break your code, it means someone can break their own code. Unless they (a) have your source and (b) have modified it, they cannot alter your code. They can only break their own.

      Sorta? I don't know. I would agree with you for anything I released open-source, as I would take a very relaxed view of bullet-proofing my code. I would be more likely to create a 'you should only be using this for 'x', and I promise it will work for 'x', but if you want to use it for 'y' just please look through the code and make sure it will work!

      But I don't, and will never, write an API like that for a closed-source package. Period.

      If someone is using your library in an unsupported fashion, the only reprocussion this has on you is that you don't have to support it. Other than that, I fail to see how it's really any of your business (or my business if I were the developer of said library).

      If it is public, people expect to be able to use it. And if they expect to use it, you as the developer have to assume that they will. Which means catching exceptions. Were it only exceptions, fine. But dealing with bad results and such. As a general rule, I don't make recursive functions public. I am very careful about functions which seem innocuous but can easily jump into infinite loops. To be 100% honest, any function which I slap together to make things work that I don't want to write doc for!

      In support of your argument for demarcation-without-dictatorship, I also hide very many functions which I admit COULD be useful to someone, but I hide them because they exist only to support some operation within a class wherein it resides. Random example: some quick sort that is highly optimized for the situation at hand, such as sorting by first-name/last-name. I may only need to do the sorting at one particular time, so I just dump the function in the body of the class that uses it. But nobody would expect to find a nice sort function in a GUI oriented class, so I make it private to avoid overloading t

    93. Re:Why would you use this? by Anonymous Coward · · Score: 0

      all programmers should start with wiring 7400 series nand gates and work up from there.

      You call nand gates low level? You're not a real programmer until you're constructing each atom, subatomic particle by subatomic particle, to build the transistors that compose those nand gates.

    94. Re:Why would you use this? by drxenos · · Score: 1

      The problem is garbage collection. This causes determinism to go out the window. If I am writing mission critical, real-time software, that can cause the program to miss some important hard dead-lines.

      --


      Anonymous Cowards suck.
    95. Re:Why would you use this? by LizardKing · · Score: 1

      how often do you use Bomb littleBoy = new AtomBomb();?

      This is known in the Java world as "coding to interfaces", but it is equally applicable to C++ and many other OOP languages. For example, say I write a class that has some data stored in a list like structure:

      public class Thing {
      List things = new ArrayList();

      public List getThings() {
      return things;
      }

      ...
      }

      Then I decide that I want to use a different list type, say a Vector that synchronises access to the data for me. All I have to is change one line in the class itself:

      List things = new Vector();

      Any code using the Thing class will continue to compile correctly, as it is only relying on the List interface.

    96. Re:Why would you use this? by dorkygeek · · Score: 0
      Your account is new so I'm going to assume you don't know that you are trolling. Saying "C has a lot of shortcomings, like being only weakly-typed, etc." without putting it in some kind of context is insulting.

      Yep, my account is new, but just because, after years of AC existence, I thought it might be a good idea to finally get myself an account.

      I didn't want to be insulting, but I wanted to make a case for managed computation (Java, C#, etc.). C is widely used today in the FLOSS community, even for projects to which one would be able to apply a higher-level concept than the one C implements.

      I never said anything against C, I just said that other approaches should be considered as well.

      Unfortunately, there seems to be an on-going heavy rejection on /. when oo languages like Java or C# are mentioned (accompanied by the usual myths).

      Don't get me wrong, but I think there are a lot of guys outhere who only know C and other classical imperative approaches, and since the Linux kernel is mainly written in C, they now think they are l33t because they know the 'holy language', and therefore defend it against every possible heretic. I, for one, think this is quite sad. People here love all the latest and greatest in applications and hardware (some of it quite unsubstantiated), but when it comes to programming languages, the crowds get out their biggest guns, and deny every possible advance, which has long been made by researchers in the academic field.

      But you'll have to pry my copy of "The C Programming Language" from my cold, dead fingers.

      No need for prying, I've got a copy of that book myself!

      --
      Windows is like decaf - it tastes like the real thing, but it won't get you through the day.
    97. Re:Why would you use this? by dorkygeek · · Score: 0
      And how do you suppose that the byte code or "native machine code" (translation: compiled C) interacts with the OS in order to actually perform i/o or present an interface to the user in any way at all? Magic beans, perhaps?

      Has it ever occured to you that 'compiled C code' is machine code as well? Machine code includes system calls (i.e. the kernel), dumbass!

      --
      Windows is like decaf - it tastes like the real thing, but it won't get you through the day.
  5. Because... by crow_t_robot · · Score: 0, Funny

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

  6. Sorry by Uber+Banker · · Score: 0

    That sounded unduely critical.

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

  7. can anyone set up a .torrent ? by for_usenet · · Score: 1

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

    cheers

    1. Re:can anyone set up a .torrent ? by mwilliamson · · Score: 4, Informative
    2. Re:can anyone set up a .torrent ? by slavemowgli · · Score: 1

      It's all on mirrordot.

      --
      quidquid latine dictum sit altum videtur.
    3. Re:can anyone set up a .torrent ? by derek_farn · · Score: 1
      I am writing up some stats on the number of downloads that occurred because of the /. story. I cannot find your email anywhere and posting a comment here is the only way I can think of to reach you.

      I am interested in knowing how many hits you received on your post of a torrent for my book's pdf file (thanks for creating one).

    4. Re:can anyone set up a .torrent ? by mwilliamson · · Score: 1
      Hi, I just sent you an email, but in case you didn't get it yet I'm showing 165 complete downloads on the bittorrent tracker.

      Parsing up the webserver logs, I've got 274 hits on the .torrent file.

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

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

  9. Did you consider.... by Anonymous Coward · · Score: 5, Interesting

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

    1. Re:Did you consider.... by mmaddox · · Score: 2, Interesting

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

      --

      What'dya mean there's no BLINK tag!?

    2. Re:Did you consider.... by mopomi · · Score: 2

      You could also consider "self-publishing", as well as creative commons. . . Something like http://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.

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

    4. Re:Did you consider.... by Fear+the+Clam · · Score: 1

      Stay away from Que. Their corporate mission statement appears to be to find the worst, most error-ridden trash they can find, break it up into 7 or 21 lessons, and let it loose on an unsuspecting public.

  10. attaboy by aendeuryu · · Score: 2, Interesting

    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.

    1. Re:attaboy by TheRaven64 · · Score: 1

      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.

      --
      I am TheRaven on Soylent News
  11. Re:Re-inventing PL/1 by $RANDOMLUSER · · Score: 0, Offtopic

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

    --
    No folly is more costly than the folly of intolerant idealism. - Winston Churchill
  12. One Thousand Sixteen Pages? by mbessey · · Score: 4, Insightful

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

    -Mark

    1. Re:One Thousand Sixteen Pages? by ekephart · · Score: 1

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

      --
      sig
    2. Re:One Thousand Sixteen Pages? by jejones · · Score: 1

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

    3. Re:One Thousand Sixteen Pages? by Anonymous Coward · · Score: 2, Funny
      (It's actually 1616 pages)

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

    4. Re:One Thousand Sixteen Pages? by nkh · · Score: 1

      Maybe I'm too naive but a lot of books have more than a thousand pages and don't cost the price of a kidney. For example the "Dragon book" has almost 800 pages. OTOH you're right for the price: the average programmer won't buy it if it's over-specialized and the price will sky-rocket, but it is not a matter of how many pages it contains, it's about what kind of info you can find inside.

    5. Re:One Thousand Sixteen Pages? by Anonymous Coward · · Score: 0

      Hey man, RTFB before posting

    6. Re:One Thousand Sixteen Pages? by Anonymous Coward · · Score: 1, Insightful

      They're alive you dumbass.

      Allah yehfazum wa yitawil umrom!

      (May God keep them and lengthen their lives)

      Say amen.

  13. Actually....One Thousand Six Hundred and Sixteen by Rolan · · Score: 3, Informative

    1616 pages....

    --
    - AMW
  14. 1616 by mnemonic_ · · Score: 4, Funny

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

    1. Re:1616 by Anonymous Coward · · Score: 1, Interesting

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

      calc.exe gives 2,4264264264264264264264264264264

      Amazing, 426 is repeating itself!

    2. Re:1616 by elhaf · · Score: 1

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

      --
      Six score characters.
      Brevity being wit's soul
      I have enough space.
    3. Re:1616 by galen · · Score: 1

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

    4. Re:1616 by Luke-Jr · · Score: 1

      438 is, actually.

      --
      Luke-Jr
  15. "The New" by hey · · Score: 3, Insightful

    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.

    1. Re:"The New" by Anonymous Coward · · Score: 0

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

  16. Interesting outlook by LegendOfLink · · Score: 2, Interesting

    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.

    1. Re:Interesting outlook by Kupek · · Score: 4, Insightful

      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.

    2. Re:Interesting outlook by porcupine8 · · Score: 1
      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.

      --
      Warning: Apple/Nintendo fangirl. Likes her electronics cute & cuddly. May be rabid.
    3. 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.

    4. Re:Interesting outlook by TBone · · Score: 1
      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.

      --

      This space for rent. Call 1-800-STEAK4U

    5. Re:Interesting outlook by LegendOfLink · · Score: 1

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

    6. Re:Interesting outlook by Anonymous Coward · · Score: 0

      We know what it is because we don't actually read the words, we just read the structure (the first and last letter intact).

      Epecxt taht it i'nst taht slpmie: uoitazilitn of eetagnold pgoloesarhy altnerappy rrednes txet mcuh mroe cnignellahg to cneherpmod, eevn wehn the iaitinl and fanil gemehpars are uehcuotnd.

    7. Re:Interesting outlook by mdmarkus · · Score: 1

      Err, even if i did look at all the lines of a function (or god help me, a file), i certainly don't comprehend on a line by line basis. Usually, i follow the changes of a small subset of the variables through all the functions (and files) of a system. We all comprehend through a toilet paper tube, but the line by line tube seems quite a bit more limiting...

    8. Re:Interesting outlook by budgenator · · Score: 1

      A while back Byte magazine had a theme issue about knowlege engineering; the biggest difference that they reported between an expert and a noob, was the expert had a greater ability to recognise what was important to the decisions he had to make and to ignore trivial data.

      --
      Apocalypse Cancelled, Sorry, No Ticket Refunds
    9. Re:Interesting outlook by tolkienfan · · Score: 2, Interesting
      Absolutely, we throw out the code.

      We constantly compare the actual written code with our understanding of the intent of the code. We also frequently read incorect code as if it were correct - assuming it matches our model.

      We do it with natural language too. Our mind fills in gaps, and silently corrects for syntax and grammer. It's a real bummer when you're proof-reading text, or diagnosing programs.

      The way in which we actually create code is much more complex than GP suggests.
      For a start we use different approaches to different problems. Most problems have been solved before, so it's a case of recalling an algorithm and applying it to the current context.
      When it comes to a problem we haven't solved before, we have to match it, or parts of it, to algorithms we know. This process is very sensitive to the manner in which it is described or understood.

      We seldom make great leaps, and actually invent something.

      If we knew exactly how the process worked, we'd already have coded programs to do it for us.

    10. Re:Interesting outlook by StormReaver · · Score: 1

      "I believe that developers comprehend code just like a computer, one line at a time."

      Coders that are responsible for a relatively minor program or portion of such a program may think this way. Developers who are developing, rather than just coding, cannot possibly succeed this way.

      Developers have to be able to think in terms of the big picture, even when coding a specific section of a program. Trying to develop a large application by focusing one line at a time is like trying to navigate around the world by only viewing the map in one-inch chunks. Both will get nowhere fast.

    11. Re:Interesting outlook by Anonymous Coward · · Score: 0

      A long time ago, (ok, 1998), I had an interesting lecture on learning styles in a Freshman engineering class.

      Computer Scientists are quite different from most other engineers, in that they tend to think globally, rather than on an iterative (as you say, line by line) basis. When understanding something, it is usually grasped all at once, rather than in small parts.

      Like most other engineers, they tend to work better from visual data rather than written instructions (say, they'd prefer a map to written directions).

      That being said, computers and the people who program them could not be more un-alike.

  17. Coming in at over 200 kb/sec! by Anonymous Coward · · Score: 0

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

  18. Cool but to what point? by Anonymous Coward · · Score: 0, Troll

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

    1. Re:Cool but to what point? by hungrygrue · · Score: 3, Insightful

      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.

    2. Re:Cool but to what point? by Anonymous Coward · · Score: 0

      You know, they used to say exactly the same thing about COBOL.

    3. Re:Cool but to what point? by Maximum+Prophet · · Score: 1

      It dead and gone but still, every decent implementation of any other language is written in C. Even the best assemblers are in C.
      On reusability: Show me any piece of Java code that is run more often on more machines in the world than printf()
      - Mike

      --
      All ideas^H^H^H^H^Hprocesses in this post are Patent Pending. (as well as the process of patenting all postings)
    4. Re:Cool but to what point? by Anonymous Coward · · Score: 0

      You know, they used to say exactly the same thing about your mama.

  19. I'm not an estheticist... by Anonymous Coward · · Score: 2, Insightful

    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.

    1. Re:I'm not an estheticist... by Anonymous Coward · · Score: 0

      That's what editors are for, silly.

  20. I'm waiting for D by winkydink · · Score: 4, Funny

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

    --

    "I'd rather be a lightning rod than a seismometer." -Ken Kesey

    1. Re:I'm waiting for D by Umbral+Blot · · Score: 2, Informative
    2. Re:I'm waiting for D by zephc · · Score: 0, Redundant
      --
      "I would say that 99 per cent of what my father has written about his own life is false." - L. Ron Hubbard Jr.
    3. Re:I'm waiting for D by Anonymous Coward · · Score: 0

      ask, and ye shall receive.

    4. Re:I'm waiting for D by GCP · · Score: 1

      Well, according to Walter, we still have a bit of a wait before it will be "1.0-worthy", but when it is it will be a HUGE improvement over working in C or C++ for those of us who (at least occasionally) need the benefits of C/C++ but are sick of gotcha-oriented programming.

      --
      "Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
    5. Re:I'm waiting for D by Ziviyr · · Score: 1

      Heh, get with the times.

      Amiga has had E since 1993. If you really want to go back and do D go ahead, but, wow, a bit late...

      --

      Someone set us up the bomb, so shine we are!
  21. Encryption / Protection by Anonymous Coward · · Score: 0

    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.

    1. Re:Encryption / Protection by InfiniteWisdom · · Score: 1

      The "encryption" and "protection" in a PDF is essentially worthless. They're little more than bits that can be set to tell the reader to prevent copy/paste or printing or whatever. It's only enough to stop the most clueless of people... and those people are unlikely to know how to modify and create a new PDF anyway.

    2. Re:Encryption / Protection by Anonymous Coward · · Score: 0

      "Advanced ebook Processor" from Elcomsoft removes those protections on every pdf I've ever seen. I use it all the time so I cut and paste and use text-to-speech.

    3. Re:Encryption / Protection by nxtw · · Score: 1
      It is definitely not worthless. For people that use PDF files for business purposes, an unmodifiable/copy prohibited PDF file gives them some security against modification and distribution of only parts of a document.

      While the technically adept can often get around these limitations, they are enough to keep most people from copying/modifying/printing.

    4. Re:Encryption / Protection by tepples · · Score: 1

      an unmodifiable/copy prohibited PDF file gives them some security against modification and distribution of only parts of a document.

      Wouldn't a digital signature be adequate protection against modification?

    5. Re:Encryption / Protection by nxtw · · Score: 1

      It does nothing to stop unauthorized printing/copying (by copying, I'm referring to the clipboard.)

  22. C0X by zephc · · Score: 4, Funny

    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.
    1. Re:C0X by Anonymous Coward · · Score: 0

      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

    2. Re:C0X by Anonymous Coward · · Score: 0


      I bet you are happy to clear-up that misunderstanding with the world, eh Alan? ;-)

  23. Nice to have on the bookshelf...for a few of us by museumpeace · · Score: 3, Insightful
    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.
    --
    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.
    1. Re:Nice to have on the bookshelf...for a few of us by Doctor+Memory · · Score: 1, Funny

      where is the Karma Reset button

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

      --
      Just junk food for thought...
    2. Re:Nice to have on the bookshelf...for a few of us by The_Wilschon · · Score: 1
      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]


      Ahhh LISP... When I first encountered it (in its incarnation as guile scheme), I thought "Wow, I have never seen a cleaner, more elegant language." My favorite feature is the treatment of functions as first-class objects. The only thing is, I think car and cdr ought to have names which more obviously reflect their function.
      --
      SIGSEGV caught, terminating

      wait... not that kind of sig.
    3. Re:Nice to have on the bookshelf...for a few of us by eclectro · · Score: 1

      I noticed that comment myself. But there are other books that deal with C++ coding style, one which was recently reviewed here on slashdot.

      It would have been interesting if he applied some of the cognitive analysis to OO, but that could have doubled the length of the book. Two volumes perhaps?

      In any event, I was paging through it, and already found some useful bibliographic references. Also, I find his prose very easy to read and straightforward.

      The other posts above dissing the book really go too far. There is a lot of useful information here.

      --
      Take the cheese to sickbay, the doctor should see it as soon as possible - B'Elanna Torres, "Learning Curve"
    4. Re:Nice to have on the bookshelf...for a few of us by snorklewacker · · Score: 1

      > The only thing is, I think car and cdr ought to have names which more obviously reflect their function.

      Common Lisp uses HEAD and TAIL. car and cdr are still in scheme.

      --
      I am no longer wasting my time with slashdot
  24. shoulda used booksurge by MatD · · Score: 3, Insightful

    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?
  25. Dupe??? by advocate_one · · Score: 1

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

    --
    Donald 'Duck' Dunn: We had a band powerful enough to turn goat piss into gasoline.
    1. 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

  26. Ain't no K&R by hey · · Score: 1

    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.

  27. You don't need new standards by GamblerZG · · Score: 5, Interesting

    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.

    1. Re:You don't need new standards by agurkan · · Score: 0, Troll
      ...and problems you solve today are different from the ones someone had back in the days of C creation

      Just like what we are saying today is different what our parents were saying, so let's throw away our languages and invent a new one for each generation. :-)

      --
      ato
    2. Re:You don't need new standards by blair1q · · Score: 1

      The problem is always the same: How do I make a computer do just what I want it to do?

      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.

    3. Re:You don't need new standards by Anonymous Coward · · Score: 0

      That's valid if your current language is English, or LISP. C can't say the things I want to say without getting bogged down in legalize.

    4. Re:You don't need new standards by eclectro · · Score: 1

      IT industry needs new languages, including low-level and compiled ones.

      Yes, that's why there are thousands of computer languages with a dozen more each year. And Job descriptions now want you to most of them.

      Maybe instead of a new language, maybe we need better programmers that don't produce bloat.

      Though I do think we need to move away from C/C++ to a more widespread functional language.

      --
      Take the cheese to sickbay, the doctor should see it as soon as possible - B'Elanna Torres, "Learning Curve"
    5. Re:You don't need new standards by GamblerZG · · Score: 1

      let's throw away our languages and invent a new one for each generation
      That's exactly what happens with human languages. Every generation invents new ways of saying things, so the language can encompass new concepts. Every generation forgets the words, which describe things that do not exist anymore. As Stanislav Lem noted in one of his "Ion Tichy" books, it would be extremely hard to write about modern world with the language of 18th century.

    6. Re:You don't need new standards by RAMMS+EIN · · Score: 3, Interesting

      Agreed, we need a new language. All this writing applications in C is no good. Just think about all the security flaws that could have been avoided if we used a language in which buffer overruns, format strings, pointer arithmetic, unsafe casts, and memory leaks just didn't exist.

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

      --
      Please correct me if I got my facts wrong.
    7. Re:You don't need new standards by dasunt · · Score: 4, 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.

      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.

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

    9. Re:You don't need new standards by RAMMS+EIN · · Score: 1

      Thanks for saying it. I didn't want to bring it up myself, to avoid getting into a penis fight about which language is really better. But CL is indeed a great language, and solves many if not all problems with C. For the record, I write most of my stuff in Scheme or Ruby these days.

      --
      Please correct me if I got my facts wrong.
    10. Re:You don't need new standards by Anonymous Coward · · Score: 0

      God damned! This "D is the answer" astroturfing campain never stops, does it?? For god's sake, let the D language speak for itself and stop astroturfing every programming language topic that comes up. If it is any good, people will use it. If not... Sheesh!...

    11. Re:You don't need new standards by GamblerZG · · Score: 1

      Yet, thinking about it, you didn't tell us how problems are different from a decade ago.

      So, you're coding the same stuff you were coding 10 years ago, and you're doing it the same way you were doing it back then?

      The amazing thing about C is that it has survived several 'languages of the year'.

      BASIC is still with us as well. And?

      It doesn't solve all problems, but no tool does.

      It's not about what problems can it solve (theoretically assembly language can solve anything). It's about how fast it solves them, how much headache it causes to developers and so on.

    12. Re:You don't need new standards by KidSock · · Score: 1

      What you really need is a new language.

      This is completely foolish. Using data structures and algorithms will never change and plain o'l vanilla C will always be great at that. In fact I would argue there's not much wrong with the C language itself. It's actually a really good languang. It's the standard C library that's starting to show it's age (e.g. malloc is far far to simple now) but you can mostly solve that problem in-house. It would be better if we separated the languange from the standar library. That would be a step in the right direction.

    13. Re:You don't need new standards by praxis · · Score: 1

      "theoretically assembly language can solve anything"

      Actually, assembly language can solve anything in practice.

    14. Re:You don't need new standards by Anonymous Coward · · Score: 0

      So, you're coding the same stuff you were coding 10 years ago, and you're doing it the same way you were doing it back then?

      Yes. The "way I did it back then" was reliable and efficient back then and is reliable and efficient today. Ain't broke. Room for improvement? Hell yes. That's why sticking to a tried and tested language means I can focus my effort on documentation, publishing, refactoring, code control, metaprogramming, code-generating tools, etc. Those areas have massive potential for improvements, possibly more than simply buying into a new language and starting from scratch.

    15. Re:You don't need new standards by pclminion · · Score: 1
      Just think about all the security flaws that could have been avoided if we used a language in which buffer overruns, format strings, pointer arithmetic, unsafe casts, and memory leaks just didn't exist.

      Or if more programmers were, you know, competant.

      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.

      This statement presumes that "high-level things" can only be easily implemented using a "Java-style class system." This indicates that it is you who suffers from a lack of flexibility, not the language.

      Try writing properly tail recursive functions in C

      You've never heard of 'goto'? Oh, that's right, you aren't "allowed" to use it because of something Dijkstra wrote in a paper decades ago (and which he wasn't even being 100% serious about). For dog's sake, you're talking about "low-level programming" here and you still forbid yourself the use of goto within a very specialized, well defined context?

      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.

      I'm just baffled by this comment. C is one of the simplest syntaxes among the popular compiled languages. A proper, complete recursive descent parser could be implemented in a day by a person versed in writing parsers. I'm curious as to what you think is so complex or hard about it.

    16. Re:You don't need new standards by Mr2001 · · Score: 1

      C is one of the simplest syntaxes among the popular compiled languages. A proper, complete recursive descent parser could be implemented in a day by a person versed in writing parsers. I'm curious as to what you think is so complex or hard about it.

      Here are a few examples of the difficulties in parsing C. Obviously it's not impossible to write a parser, but there are a lot of tricky cases that can bite you if you're not careful. One such example (described here) is this:

      (b)-(c)

      Does that say "subtract c from b", or does it say "negate c and cast it to b"? Depends on whether b is a typedef.

      --
      Visual IRC: Fast. Powerful. Free.
    17. Re:You don't need new standards by Mark+of+THE+CITY · · Score: 1

      do something with the registers in your CPU

      With some processors, registers are mapped into memory space, so you could access them with C pointers. Intel's old 8-bit micrcontrollers, for one.

      --
      The clearance system sounds logical. It is not. It is completely arbitrary. -- John Bolton
    18. Re:You don't need new standards by Anonymous Coward · · Score: 0

      The D programming language is grossly under specified and only runs on a subset of machines that C supports. I'm not even going to bother mentioning all the design decisions that I believe Walter Bright got wrong that keeps me from using D.

    19. Re:You don't need new standards by NutscrapeSucks · · Score: 1

      BASIC is still with us as well. And?

      Not really. BASIC is now Java with different keywords, while C is still pretty much C.

      --
      Whenever I hear the word 'Innovation', I reach for my pistol.
    20. Re:You don't need new standards by Anonymous Coward · · Score: 0
      um, you're both wrong.

      if something works in theory, but not in practice, then the theory is broken and is not a theory.

      theory and practice are the same thing. hypothesis and practice are different.

    21. Re:You don't need new standards by RAMMS+EIN · · Score: 1

      ``Just think about all the security flaws that could have been avoided if we used a language in which buffer overruns, format strings, pointer arithmetic, unsafe casts, and memory leaks just didn't exist.

      Or if more programmers were, you know, competant.''

      No. Even competent programmers make mistakes. Most of the features that cause problems in the above really aren't necessary - for example, you can get by just fine without pointer arithmetic.

      ``This statement presumes that "high-level things" can only be easily implemented using a "Java-style class system." This indicates that it is you who suffers from a lack of flexibility, not the language.''

      Sorry for being unclear there. I did not mean that you need a Java-style class system to do high level programming. I just used the Java class system as an illustration of something that can't really be implemented in C (and used conveniently in the same program). The "Because of this ..." part should refer to the "C suffers from lack of flexibility" part, not to the impossibility of implementing a Java-style class system.

      ``Try writing properly tail recursive functions in C

      You've never heard of 'goto'? Oh, that's right, you aren't "allowed" to use it because of something Dijkstra wrote in a paper decades ago (and which he wasn't even being 100% serious about). For dog's sake, you're talking about "low-level programming" here and you still forbid yourself the use of goto within a very specialized, well defined context?''

      As in, only within the same function, and you can't pass any parameters to it? No thanks, that isn't nearly good enough to implement proper tail recursion. Note that proper tail recursion eliminates all tail calls, not just the ones that call the same function.

      ``I'm just baffled by this comment. C is one of the simplest syntaxes among the popular compiled languages. A proper, complete recursive descent parser could be implemented in a day by a person versed in writing parsers. I'm curious as to what you think is so complex or hard about it.''

      HAHAHAHAHA!! C one of the simplest syntaxes, give me a break. Someone already pointed you to issues, so I'm not going to repeat that. I don't know if a recursive descent parser for C is even possible.

      As for your comparison to "popular compiled languages", I assume you mean C++, Java, and C#? Well, yeah, if you start by copying C's syntax, and then extend it, you aren't going to make it much better, are you? Most _other_ languages (those not imitating C syntax) I know are simpler, sometimes a lot.

      --
      Please correct me if I got my facts wrong.
    22. Re:You don't need new standards by PsychoBrat · · Score: 1

      Agreed; I've just spent the last few hours reading up on D, and I think I'll give it a shot! However, I have a couple of short questions that you might be able to answer. Firstly, are there plans for Phobos to fully implement (in some way) all major useful features of the standard C libraries, and secondly, do you know of any D interpreters planned or under development?

      --
      Invisible to moderators.
    23. Re:You don't need new standards by Anonymous Coward · · Score: 0

      Simpler languages, doesn't mean better tools. If a sintax is simple you'll surely find complexity on another level (ie, libraries, runtimes, etc).
      Computer languages are a compromise between machine efficiency and human understanding, no silver bullet, just use the best tool for the job at hand.
      C as the history shows, with his simple machine abstraction mindset is great for a lot of stuff, that's all.

    24. Re:You don't need new standards by sjlumme · · Score: 1

      And the sad thing is that CL is nowhere near NEW. In fact, I would say that the most interesting programming languages to study if you're interested in how using a better language can really improve software engineering, are Lisp (60s), Scheme (70s), OCaml/SML (80s), and Haskell (90s). Features in the so-called "academic" languages take time to trickle down in diluted forms into the mainstream, but much effort is now being made by their supporters to create workable and accessible development environments and library bindings, so that you can use metaprogramming, higher-order functions, polymorphic types and what-have-you to your advantage right now.

    25. Re:You don't need new standards by GamblerZG · · Score: 1

      I think you'd better ask these question on the D forum.

    26. Re:You don't need new standards by GamblerZG · · Score: 1

      Yes. The "way I did it back then" was reliable and efficient back then and is reliable and efficient today.
      When I recommend Firefox to people, they frequently say something similar to what you just said.
      "IE works fine for me, why switch? Instead of buying into new browser, I can install pop-up blockers, antivirus software and multitab plugins. Those areas have massive potential for improvements!!!"

    27. Re:You don't need new standards by Deven · · Score: 1

      The D programming language is grossly under specified and only runs on a subset of machines that C supports. I'm not even going to bother mentioning all the design decisions that I believe Walter Bright got wrong that keeps me from using D.

      Please do bother. This is the first time I've heard of this language, and I'm trying to decide if I should take an interest in it. From a quick glance, it looks pretty interesting, but if there's known problems with it, I'd like to know that up-front instead of having to discover them on my own after investing time and energy into it...

      --

      Deven

      "Simple things should be simple, and complex things should be possible." - Alan Kay

  28. Not Again... by uberdave · · Score: 5, Funny

    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.

    1. Re:Not Again... by Kloog · · Score: 2, Funny

      Hopefully they will soon apologize and bring back the old standard as "C Classic."

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

  30. Wait no more! by JordanH · · Score: 1, Redundant
    The D Programming Language!

    And when you're done with that you could move on to E and F....

    1. Re:Wait no more! by Anonymous Coward · · Score: 0

      and F [fortran.com]....

      Yeah, I remember using the F-word a LOT back when I had to maintain some Fortran code.

  31. mirror 2 by Anonymous Coward · · Score: 0

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

  32. Re:Re-inventing PL/1 by $RANDOMLUSER · · Score: 0, Offtopic
    Offtopic? Offtopic?? Offtopic???

    Sigh
    And agin.
    And again.

    --
    No folly is more costly than the folly of intolerant idealism. - Winston Churchill
  33. 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.
    1. Re:Author comments by Threni · · Score: 1

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

      I'd probably not download it until you'd posted an article about it to the Usenet group comp.lang.c. Some of the guys there are experts on C and the various standards and I respect their opinion. A warning though - they'll rip it apart if it looks like you're propogating programming mistakes! Perhaps someone would like to post the relevant link there today?

    2. Re:Author comments by Anonymous Coward · · Score: 0

      I'd probably not download it until you'd posted an article about it to the Usenet group comp.lang.c. Some of the guys there are experts on C and the various standards and I respect their opinion.

      RTFA. This guy is a (former?) UK delegate to the ISO C committee. He'll know his stuff.

    3. Re:Author comments by Anonymous Coward · · Score: 1, Funny
      the ISBN number is
      No. It is not a ISBN number. It is a ISBN, or ISB number. Do you also say ATM machine, NASA administration and PIN number?
    4. Re:Author comments by Anonymous Coward · · Score: 0

      It is a ISBN...

      No, it is not a ISBN number. It is an ISBN number. "I" is a vowel, and we have a form of the indefinite article for bridging to nouns that start with vowel sounds. Do you also say "I am an pedantic Nazi" and "my post is a ironic one?"

    5. Re:Author comments by Anonymous Coward · · Score: 2, Insightful

      "Dead tree version" is a waste of words.

      Why can't you just say "paper version"? It's called PAPER. Get with the times.

    6. Re:Author comments by deeny · · Score: 1

      Maybe you can contact one of the smaller presses in CS to see what they have. The other option is two physical volumes.

      If you do dead tree publish, though, you'll definitely need an index.

    7. Re:Author comments by dtfarmer · · Score: 1

      No. It is not a [sic] ISBN number. It is a [sic] ISBN, or ISB number. Do you also say ATM machine, NASA administration and PIN number?

      Well, I don't regularly comment on NASA, and imagine I would just use NASA, but...

      I do use my PIN number to get cash from the ATM Machine so I can go buy a DVD disc to play when I finish watching Navy NCIS on my DVR recorder. You'd probably never guess I'm a Microsoft MCSE, eh? Now, what was that ISBN number again?

      This post brought to you courtesy of the ADAA - Always remember the 5 D's of dodgeball...

    8. Re:Author comments by Envinyanta · · Score: 1
      It's technology slang, or jargon, like most of the unusual terms and ideas that have developed within the technology field as it's evolved from places like MIT and BBS's into the Internet at large. As for it being more or less efficient, that's not the point at all, but rather to add culture and personality to the words and terms used.

      See the term reference here: http://www.catb.org/~esr/jargon/html/D/dead-tree-v ersion.html

      And the whole jargon file listing here: http://www.catb.org/~esr/jargon/

      (Personally I think it's oddly fitting that, not only would geeks (myself included) develop quite a number of terms relating to the technical field, but then compile them into a dictionary reference with definitions)

    9. Re:Author comments by sinserve · · Score: 1

      "dead tree" expresses regret over printing something that is available for reading electronically. I personally feel terrible regret when I print something unnecessarily, and even more so when I fuckup a printing job and need to redo it.

    10. Re:Author comments by cgreuter · · Score: 1

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

      And, several pages articles later, we hear about Fundable. I'd think that be an ideal way to make sure you have 5000 orders before springing for a print run.

    11. Re:Author comments by Anonymous Coward · · Score: 0

      take the "wasted paper" and bury it. you can now feel good that you have taken carbon from the atmosphere and put it back in the ground, saving us from a small amount of global warming.

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

    1. Re:Gotcha by Anonymous Coward · · Score: 0

      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.

      This is why wikipedia sucks....

    2. Re:Gotcha by Anonymous Coward · · Score: 0

      What do you mean?

  36. I will publish your book by Roach · · Score: 2, Interesting

    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.

  37. C is far from dead by ^Z · · Score: 1

    There are lots of computers beyond PCs. Think about all this embedded stuff, 16-bit and 8-bit controllers, especially those that do real-time tasks. A friend of mine has just completed a pure C project of 11k lines for an automotive controller. This does not seem like a very big deal, but there are lots of such things. For their developers, C is a godsend, compared to assembler, and such a book a real boon.

    (And yes, I know about Forth, etc)

    --

    Computers make very fast, very accurate mistakes

    1. Re:C is far from dead by metamatic · · Score: 1

      Yes, C isn't dead.

      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.

      --
      GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    2. Re:C is far from dead by RealityMogul · · Score: 1

      So once somebody writes a 3200 page book on how to write maintainable C# code, can we kill that language?

    3. Re:C is far from dead by smittyoneeach · · Score: 1

      What percentage of languages are either:
      a) have at least one major implementation in C, e.g. CPython
      b) have a syntax borrowed heavily from C, e.g. JavaScript, or
      c) ensure that C extensions are readily integrated with them (a lot)
      No, Netcraft isn't confirming the death of C anytime soon.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    4. Re:C is far from dead by fyngyrz · · Score: 1
      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.

      No, no. Overboard length of an exposition on any particular subject isn't justification to kill the subject. It's justification to kill the author.

      --
      I've fallen off your lawn, and I can't get up.
  38. At over 1600 pages?! by mariox19 · · Score: 4, 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!

    --

    quiquid id est, timeo puellas et oscula dantes.

    1. Re:At over 1600 pages?! by telecsan · · Score: 1

      "Not counting the citations at the end, the book is 1,577 pages of "guidelines." "

      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.

    2. Re:At over 1600 pages?! by joshdick · · Score: 1

      No kidding. I'm on page 100, and I'm still not out of the Introduction.

    3. Re:At over 1600 pages?! by Anonymous Coward · · Score: 0

      don't forget writers get paid by amount of pages in the US

      the size of european books like this (especially german) is a lot smaller, but they're packed with hardcore information :)

    4. Re:At over 1600 pages?! by halber_mensch · · Score: 1

      You do realize that with fseek() you can move your read pointer without consuming data on the input stream; and thus skip past the introduction, right?

      But you'll have to man fseek, because I couldn't find anything about it in the book :(

      --
      perl -e "eval pack(q{H*},join q{},qw{70 72696e74207061636b28717b482a7d2c717b343 637323635363534323533343430617d293b})"
    5. Re:At over 1600 pages?! by lisany · · Score: 2, Funny

      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?

      1577 pages? Ever hear of Lord of the Rings?

    6. Re:At over 1600 pages?! by mariox19 · · Score: 1

      Yeah, and I've read it more than once. Call me crazy, but it's an easier read -- and I'm including the parts in elvish.

      --

      quiquid id est, timeo puellas et oscula dantes.

    7. Re:At over 1600 pages?! by Pollardito · · Score: 2, Funny
      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?
      if you don't have time, just wait for the 30 CD audio version
    8. Re:At over 1600 pages?! by Clod9 · · Score: 2, Insightful
      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.

    9. Re:At over 1600 pages?! by pommiekiwifruit · · Score: 2, Funny
      Well, that Donald Knuth guy still hasn't finished writing his book "The Art of Computer Programming" so he's got a way to go before getting the "gets side-tracked" award :-)

      And IIRC John Harrison (the Chronometer guy) wrote multi-page paragraphs, so some georgian and victorian writers can get fairly lengthy :-)

    10. Re:At over 1600 pages?! by jericho4.0 · · Score: 1
      "The Art of Computer Programming" has one of the highest signal to noise ratios I've ever seen.

      We should all give thanks, and wish Prof. Knuth the best of luck in finishing V.4 before 2050.

      --
      "A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
    11. Re:At over 1600 pages?! by dubious9 · · Score: 1

      I'm reminded of the adage:

      "Perfection is not when there is nothing left to add, but rather when there is nothing left to take away."

      Upon hearing this the c-book writer was enlightened.

      --
      Why, o why must the sky fall when I've learned to fly?
  39. request for user-submitted reviews by bcrowell · · Score: 1

    The book is listed here on The Assayer. User-submitted reviews would be appreciated!

  40. Some thoughts by mnmn · · Score: 3, Insightful

    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
    1. Re:Some thoughts by sillybilly · · Score: 1

      Yeah! What up with Basic these days? VB classic is dead, and VB.Net is C# in disguise, with the need to define "using system.standard.feature.math"-like things. The best feature of Basic was that it was, well, basic. Assembler, C and Basic were quite a good spectrum of programming languages, spanning all the needs of control over what happens vs. ease of programming.

      Java and .Net and all this object orientedness is a nice concept when you have to manage humongous projects, but they neither give you ease of programming that Basic had, nor the superb level of control that C has. As far as developing a massive system in C only, it works, look at Win32 API. As far as security and buffer overflows go, there should be ways to fix those without changing paradigms. Instead of C++++ (i.e. C#), we need a C----.

    2. Re:Some thoughts by renoX · · Score: 1

      C is grat for kernel programming?

      If that's the case, why did Linus made a tool to uncover type error in the kernel?

      I like C a lot, but it doesn't scale very much as shown by the bandaid that people invent when the programs get big..

    3. Re:Some thoughts by Anonymous Coward · · Score: 0

      sparse is not a band-aid. Its there because the kernel executes in many different contexts with the same code.

      No compiler can know about the various type safety issues with bus control and mtrr.

    4. Re:Some thoughts by renoX · · Score: 1

      Uh, last time I looked sparse wouldn't have been necessary if the kernel had been coded in Ada, but maybe I haven't looked closely enough..

    5. Re:Some thoughts by Anonymous Coward · · Score: 0

      How would Ada be able to know whether a function needs to be declared __init or __exit at compile time when that function is executed in multiple contexts?

      Should a given pointer be __user? How can Ada know that?

      Ada provides extensive compile time checking, but even it cant determine things like that. Only people and very domain specific tools (such as sparse) can do that.

  41. Pretty Damn Impressive by Anonymous Coward · · Score: 4, Interesting

    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.

    1. Re:Pretty Damn Impressive by mathgenius · · Score: 1

      Yes, it seems most of slashdot has missed the point, yet again.

      This book is a whopper, and a boon to free C-language tool-writers like me (the C standard itself is a reasonably pricey document).

      Simon.

    2. Re:Pretty Damn Impressive by Anonymous Coward · · Score: 0

      Thank God. Finally, someone says something
      good about the book. But, why did the moderators
      score it 0? Is it because it was anonymous?
      I have downloaded the big beast. Got to read it
      soon.

  42. not 100% C by Anonymous Coward · · Score: 0

    No its not - plenty of assembler in there, not all inlined in C code either. If you want a good scare, look at it sometime.

  43. we all mostly program in OO paradigms by Anonymous Coward · · Score: 1, Interesting

    we all mostly program in OO paradigms

    Uh. Got any proof?

    Take some inspiration from the book you just read: provide some proof and a reference.

    In fact, most programming remains function oriented.

    Sorry. Nice try, though.

    1. Re:we all mostly program in OO paradigms by museumpeace · · Score: 1

      You are asking a guy with a BS in physics for a MS thesis in some combination of Business Administration and CS.
      but I'll take a stab at it....

      If you are saying you belive we [i.e. most programmers who are actively devloping SW] think of software designs in terms of functional decomposition...well I just don't know how to prove anything about how people think but I would disagree. Thought is conducted with language and really sets the limits of what and how you concieve ideas...we have C++ and Java among others, for thought-tools. Once you have designed down to the methods on your objects, i.e. the function level, yes, tools are less important and you could write in Fortran or Assembler. You can do LOWER level thinking in a higher level tool. Heck, I wrote pidgen C++ [C++ would compile it but I was stuck with C thinking modes and I was not getting the milage of proficient C++ programmers "he speaks C++ with a thick C accent"] for a few years...actually took Java for me to get the religion. You can't do HIGHER level programming than your tool supports without some added set of practices or discipline.
      For instance, you could write a multithreading server in C using a bunch of Posix thread library calls sprinkled around your code but if you had to do it from scratch, you'd be done in days instead of weeks to start with the HttpServlet classes and just drop your handler method implementations into that....you'd only have to think explicitly about threads in one or two lines of code.
      I think programmers worked right to the limits of the common OO languages and started pushing for even bigger 7-league boots: patterns. The books that are selling well among programmers are also an indication of continuous evolution to higher and higher level constructs as the building blocks. We have patterns cookbooks for several of our OO languages now and those really do help adept programmers cover a lot of ground. Code reuse was and still is the holy grail of effective use of software engineer's time. Functional re-use is epitomized in Clib and RogueWave. If C libraries and Posix had really solved the reuse problem well and delivered high levels of reuse in code, why would we have pushed on to C++, Java and an O'Reilly zoo of others? Objects delivered, or at least did better and patterns promise to go beyond that, makeing objects more generic and reusable...and THAT is how you solve problems better and better, THAT is the evolution of our craft.
      The great classics of functional programming like Sedgwick's Algorithms tome were only the cookbooks for individual dishes, not the banquet that had to be delivered. And even that book got updated to OO with Algorithms in Java wherein, classes, not just methods, appear in the example code.

      --
      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.
    2. Re:we all mostly program in OO paradigms by Anonymous Coward · · Score: 0

      You are making a big assumption when you pretend that there's a progression of BETTER programming methods acros those years.
      Fact is some skills survive, some other simply vanishes, and believe me, after more than 25 years programming, quality, optimal resource usage, etc, etc are not that important.
      Computer history is bounded by computer success, the very same success that has trigered actual usage has also had a frozen effect on many areas, efectively starving progress.
      Programming is the sum of all those factors, no progression, just adaptation.
      Unfourtunately since Turing's days the complexity barrier is still there, no silver bullet.

    3. Re:we all mostly program in OO paradigms by museumpeace · · Score: 1

      ...you pretend that there's a progression of BETTER programming methods acros those years...
      Pretend? no, there are a lot of tools and standards and practices that we have now that are improvements over the way we used to do the work. And OO, though it is not one but a collection of improvements and it has arrived in its present form [analysis and design tools like Rational Rose, languages like C++] after many false starts and discarded techniques. "Pretend" may be a bit harsh but I certainly did not give the whole picture: improvement in methodologies has been anything but straight forward or smooth.

      ...Fact is some skills survive, some other simply vanishes,...
      definitely. I helped write an early 911 police dispatch system in the '70s. We wrote in assembler, 80,000 lines if I recall. Flowcharts and HIPO diagrams were the height of design expression. The schedule and staff turnover were nervewracking. We achieved up time by running two completely separate systems that shadowed each other...it was crude material by today's standards. Yet we delivered a system that ran at the required 99.999% uptime [no halts, freezes, crashes or missed events] within 1 month of first power-up at the police station. I have not been party to such a level of technical success since. [we also underbid the job by a factor of 4 :( ] We used a buddy system for initial code review and then structured walk-thru prior to submission to the build. The quality was simply excellent. The human side of the buisness, the fact that programmers are still people has been downplayed by much of the "progress" I extoll.

      --
      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.
  44. Re:Actually....One Thousand Six Hundred and Sixtee by biobogonics · · Score: 1

    1616 pages

    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)

  45. Manifestation of liturgical commentary. by blackest+sun · · Score: 4, Interesting

    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.

    1. Re:Manifestation of liturgical commentary. by Franciscan · · Score: 2, Insightful

      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

    2. Re:Manifestation of liturgical commentary. by photon317 · · Score: 1


      But there are some of us out there. I've only glanced through the PDF so far, mostly section 0, but also the commentary on the standard itself a little. Even with the PDF already in hand, I would buy this book for whatever it could cost to publish profitably. I'm not about to print and bind 1616 pages at home and be happy with it, and I will use this for reference (and, perhaps sadly, even read random sections in leisure time).

      While the book is clearly structured around the C Standard, it's value goes far beyond the C language. While I feel my C skills are still fairly sharp (as are my assembly skills), I spend about 90% of my coding time these days in Perl, and I still find the book to be something I would refer to at least weekly. To some degree this has to do with "Leaky Abstractions" (Joel on Software column from a while back). Even when I work in Perl, I work on very complex things, and invariably what lies underneath shines through Perl's leaky abstractions fairly often. On my most recent large Perl project, I've actually spent more time looking things up in "Advanced UNIX Programming" (which is entirely C-oriented) than any Perl book.

      Similarly, there are things in this book of value even to people who code only in Java (like the sections on floating point accuracy and hardware and the standards surrounding such stuff).

      Section 0, especially, could really almost survive as a seperate book on its own. It holds a number of interesting and insightful things, and is very broadly applicable to programming in general. It's 150 A4 pages in PDF, so it would be a rather thin book on its own, but still...

      I suppose I've wandered all over the map now. The point is, I'd buy this, and with the right marketing and book reviews and whatnot, I bet there's a decent-sized market out there who would also buy it, and I feel it's a shame it hasn't been published.

      --
      11*43+456^2
  46. Wait no more! by clenhart · · Score: 0, Redundant
  47. eShall by Doc+Ruby · · Score: 1

    Your book is a great mandate for a programmer to build a C programmer's editor that enforces all the rules. Emacs "c-farn-mode", anyone?

    --

    --
    make install -not war

  48. Please someone sell me a dead-tree version! by Anonymous Coward · · Score: 0

    From a FedEx-Kinko robot email...

    If the document you are sending is copyright or trademark protected in whole or in part, please note that FedEx Kinko's requires written permission from the copyright or trademark holder in order to reproduce copyright or trademark protected works.

    1. Re:Please someone sell me a dead-tree version! by Anonymous Coward · · Score: 0

      Not "free" to get a Kinko's hard copy:

      > $96 + tax to print 1 copy.
      > Binding options cost 2.99, 3.99, and 4.99
      > per book

  49. Re:Encryption / Protection (above is wrong) by Anonymous Coward · · Score: 0

    Sorry, FiniteWisdom, PDFs have a strong encryption option.

  50. Now that the copyright issues have been sorted out by Trinition · · Score: 3, 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.

  51. Yeah, I know. by mbessey · · Score: 1

    Apparently, the preview function isn't sufficient to save me from my typos.

    -Mark

  52. Re:Encryption / Protection (above is wrong) by InfiniteWisdom · · Score: 1

    Really? How do you read it without a key then?

  53. Re:Encryption / Protection (above is wrong) by Anonymous Coward · · Score: 0

    You don't read properly encrypted PDFs without a key unless you've figured out a way to crack 128-bit AES (see pages 93-95 of the PDF Reference, version 1.6).

  54. Re:Why not self publish? Lulu by AYeomans · · Score: 1

    See http://www.lulu.com/Lulu for an economical approach - you can choose to take royalties if you like.

    --
    Andrew Yeomans
  55. Slashcode filters partial HTML tags by mosel-saar-ruwer · · Score: 1

    Slashcode filters partial HTML tags [left tags, "<", and right tags, ">"], which, unfortunately, mathematics & C-geeks know as "less than" and "greater than" symbols.

    To get a "less than" symbol, you must use the "ampersand-l-t-;" notation; for a "greater than" symbol, use the "ampersand-g-t-;" notation.

    What the GP meant to display was

    for(int i = 0; i < MAX_COUNT, i++ )
    PS: Under Slashcode, HTML's "ampersand-pound sign-decimal number-;" notation doesn't work, either.

    1. Re:Slashcode filters partial HTML tags by Speare · · Score: 1
      Hey, dork, nice way to not get the joke. The thing is, you didn't even correct the other mentioned error, where the post had a comma instead of a semicolon.
      for(int i = 0; i < MAX_COUNT; i++ )
      Oh, and for anyone else out there who still wants to type code into slashdot for some obscure reason, just use the <ecode> tags and you don't have to fuck around with &lt;---&gt; notation at all.
      --
      [ .sig file not found ]
  56. (above is wrong) by InfiniteWisdom · · Score: 1

    What does that have to do with this? You can encrypt it with a one time pad if you want, and that still won't prevent anyone from modifying and redistributing copies.

  57. Re:Encryption / Protection (above is wrong) by petermgreen · · Score: 1

    yes stopping someone reading something without a key is easy enough but thats NOT the goal of a drm system.

    a drm system is meant to let you read it whilst not letting you copy/modify it. This is basically impossible to achive reliablly on an open system like the PC.

    --
    note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  58. 1983 called... by tundog · · Score: 2, Funny

    1983 called and it wants its 'new' standard back...

    --
    All your base are belong to us!
  59. John Searle agrees by Anonymous Coward · · Score: 0

    Comprehension is an entirely different act than execution.

    John Searle agrees.

  60. I think you've missed the boat by corngrower · · Score: 0, Offtopic

    There's already a 'Z' language.

  61. The silver bullet is competence by smose · · Score: 2, Insightful

    The common thread, as I read it:

    In the hands of a competent programmer... you get something usable.
    ...in 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.

  62. Minor correction to PHP comment by Zancarius · · Score: 1
    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.
    htmlentities() does nothing to ensure the string is DB safe--it only ensures that the string is "render safe" in HTML. If you want to make sure that a string is DB safe, look at the various database related *_escape_string() functions. Oh, and turn off magic_quotes_*--the entire notion behind magic quotes is incredibly ridiculous and only encourages new coders to write bad code (because they'll assume their strings are always quoted properly, even if incorrectly). Some links that might be of use:

    http://www.php.net/manual/en/security.database.sql -injection.php
    http://us3.php.net/manual/en/function.get-magic-qu otes-gpc.php
    --
    He who has no .plan has small finger. ~ Confucius on UNIX
    1. Re:Minor correction to PHP comment by tomhudson · · Score: 1

      I just use strtr to get rid of any suspicious characters, but thanx

  63. English is the most commonly used language. by Anonymous Coward · · Score: 0

    sorry.

  64. Surely the next language was supposed to be "P"? by Anonymous Coward · · Score: 1, Interesting

    IIRC 'b', and its replacement 'c', were both derived from BCPL, so the next in line should be 'p'.

  65. Thanks by Anonymous Coward · · Score: 0

    Thank you for your generosity and may The One bless and guide you to happiness in this life and the afterlife.

  66. this book is not good by ActionAL · · Score: 1

    thanks for writing one of the most convoluted programming books in history

    simplicity and elegance are definately not in this book

  67. Why is this happening? by plarsen · · Score: 0

    It doesn't make sense. Being intelligent putting this together and after that releasing it for free is a mystery for me. The work itself proves this is not made by a common person. And the whole thing contradicts itself. Alot of time is spent doing this, it is made by a person that really knows what he is doing. He could have spent his time doing something else. Perhaps he is not interested in making money, but sure he has braincells enough to create something else that really makes him do profit. It doesn't make sense to me. This is wierd for me, I don't understand people. I know that everything is not about money, but creating this and then release it for free because he can't make a company sell it is totally out of it. If he spent one thousand of time and intelligence in finding a better way to make use of this works, than he spent on creating it I am convinced he would have found a better way to make use of this work than giving it away for free and post an article to slashdot about it.

  68. Olsen's Standard Book of C Coding. by cabazorro · · Score: 1

    Yet, another standard for coding on C.
    Who needs this?
    How about changing the Title.
    "Olsen's Standard Book of C Coding."
    C: The expurgated version....
    P: (pause; politely) I'm sorry, I didn't quite catch that...?
    C: The expurgated version.
    P: (exploding) The EXPURGATED version of "Olsen's Standard Book of C
    Coding"?!?!?!?!?
    C: (desperately) The one without the MACROS!
    P: The one without the MACROS!!! They've ALL got the MACROS!! It's a
    Coding Standard, the MACROS, it's in all the books!!!
    C: (insistent) Well, I don't like them...they mess my debugging output.

    --
    - these are not the droids you are looking for -
  69. bored now... by h4x0r-3l337 · · Score: 2, Funny

    I got bored just reading the slashdot article about this book. No wonder Addison Wesley decided not to publish it.

  70. Re:Now that the copyright issues have been sorted by StormReaver · · Score: 1

    "...and the GPL was finally successfully tested in court."

    The GPL has been specifically enforced by a judge in at least the German court system. In the U.S. court system, even SCO eventually agreed to the legitimacy of the GPL in court filings to save its ass from IBM's countersuit. GPL violators in the United States have been hit with court injunctions to compel them to abide by its terms.

    The notion that the GPL needs to be tested in court is history, as it has been vindicated many times by actual court actions.

  71. Hope this book is better than by mzs · · Score: 1

    The Annotated ANSI C Standard. Any comments on this one from the comp.lang.c newsgoup yet?

  72. Why Addison-Wesley rejected this by Animats · · Score: 4, Interesting
    It's clear why Addison-Wesley rejected this. The author is a terrible writer. He has a fondness for run-on sentences, fails to use commas appropriately, and makes several grammatical mistakes per page.

    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.

    1. Re:Why Addison-Wesley rejected this by kallisti · · Score: 1

      I don't suppose you have a link to the 19 problems Mr. Yoran was referencing? That would be quite helpful to know.

  73. 1616 pages by St.+Arbirix · · Score: 2, Funny

    Mmm, this'll be nice for benchmarking my printer.

    --
    Direct away from face when opening.
  74. Khmm, triggers a bug in Acroread-5.09 by mi · · Score: 1
    Or is it just me? Open the file, press Ctrl-F and start searching for calloc. On around page 782 the acroread will hang... Can anyone confirm?

    I would upgrade to the newer acroread-7.x, but that can not be used for easy pdf-to-ps conversion (e.g. acroread -toPostScript < file.pdf > file.ps) without a valid DISPLAY...

    --
    In Soviet Washington the swamp drains you.
    1. Re:Khmm, triggers a bug in Acroread-5.09 by wolverine1999 · · Score: 1

      Ghostscript gives me an error too...

    2. Re:Khmm, triggers a bug in Acroread-5.09 by Anonymous Coward · · Score: 0

      MacOS 10.4.1, Preview 3.0.1, 64 seconds to find the first calloc at p.927, the a further 32 seconds to reveal all 9 occurrences, tired old G3 300Mhz...

  75. It's Free. Enjoy It. Jeeez. by BinBoy · · Score: 1

    Good grief. From reading the comments, you'd think he just kicked everyone in the teeth. The guy is giving away a free book. Enjoy it.

  76. Wow! by Subrafta · · Score: 1
    Thanks for making this available.

    It's going to take a while to digest a document of this magnitude, but at least some of us out here are part of your target audience. I've always been interested in computer language grammar. Back in the day I used to read the USENET C FAQ for fun, wrote several translators and code generators, and ID'd my share of C compiler bugs.

    What are your plans for the document? If you can't find another publisher there's probably at least a thesis or two hiding in there...

    Best of luck

    --
    Vuja De: That sinking feeling that this is going to happen again. Often occurs in meetings with Product Managers.
  77. Only Slashdotters would complain about free books by Anonymous Coward · · Score: 1, Insightful

    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.

    Typical.

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

    1. Re:19 known problems cause most bugs by Lord+Omlette · · Score: 1

      I hope you submit it to slashdot when you find it, and I hope the slashdot editors post it...

      --
      [o]_O
    2. Re:19 known problems cause most bugs by Alsee · · Score: 1

      A TV producer???
      What the hell is going on in our government, Wag the Dog?

      -

      --
      - - You can't take something off the Internet! That's like trying to take pee out of a swimming pool.
  79. Tangential Commentary by pommiekiwifruit · · Score: 1
    Um, it's a book that starts with a commentary on the C language (which seems fairly accurate!) and goes into linguistics and other interesting areas with actual graphs and numbers to back it up.

    I think we have found the Anti-Shildt!

  80. Here's how you whittle down your audience by Anonymous Coward · · Score: 0

    From page 5:

    "...most of the existing academic software engineering research is of low quality and suffers from the problem of being carried out by people who don't have the ability to be mathematicians or the common sense to be practicing software engineers."

  81. Ok, so how do we pay him? by wls · · Score: 1

    Alright, so here we have an author who's done a great job and we're all downloading his book. The publishers have decided to cut themselves out of the loop.

    Does anyone know how to easily make a donation to the author, one saying thanks for releasing this cause we value your work, and two rub it into publishers that a technical book does have value?

  82. Fair warning by Locke2005 · · Score: 1

    Excuse me while I go out and by a few reams of paper and some ink cartridges before trying to print this 1616 page document out on my printer! Anybody having any luck so far fitting this into a single binder? I understand now why the publisher balked at this -- the environmentalists would have stormed the office in protest for all the trees killed to print each copy! No problem, I'll just read the whole thing sitting here at my printer...

    --
    I've abandoned my search for truth; now I'm just looking for some useful delusions.
    1. Re:Fair warning by sexylicious · · Score: 1

      Sure. Double-sided, into a 3-inch, D-ring binder. :D

  83. Inadequate teaching in universities by crucini · · Score: 1
    Must be bad universities, I for one had the luck to attend a lot of very good and deep courses about system programming, computer architecture and digital design.

    I'm glad you had a good education. Unfortunately, there are a lot of CS majors emerging these days with a Java-only education. Certain universities are notorious for this. You might think that once someone knows CS, learning additional languages is trivial. But this is not really true, especially if he only knows one language. It's also easier to go from C to java than java to C.
    1. Re:Inadequate teaching in universities by Anonymous Coward · · Score: 0

      Too true. s/BSCS/BSJP/

    2. Re:Inadequate teaching in universities by Anonymous Coward · · Score: 0

      Amen. Totally. Even if they do get minimal exposure to other languages (and CS shouldn't be about languages), they are only taught of one way to code and think -- and regardless of majors, universities should be about inspiring free thought. It took me many years to UNLEARN my college education, I still am thankful for it, but in all many folks will go through school (I know I did) thinking their professors knew what they were talking about and bought everything hook, line, and sinker.

      Industry has caused this. The demands for employment have caused this, but unfortunately this problem is only exacerbated by the growth of Java developers who help pertuate the myth that Java is the Way. They need to open their eyes and look back at history, and see what has survived and what hasn't -- what works and what doesn't -- and then start reading objective language criticism to begin to understand the perfect language does not exist, but that one should be a student of all of them.

    3. Re:Inadequate teaching in universities by dorkygeek · · Score: 0
      Industry has caused this. The demands for employment have caused this, but unfortunately this problem is only exacerbated by the growth of Java developers who help pertuate the myth that Java is the Way.

      If this should be a side blow, I'd like to say that I am not a proponent of Java itself, but merely and advocate of managed compution for projects for which it is justified. Java is only one exponent of this family.

      They need to open their eyes and look back at history, and see what has survived and what hasn't -- what works and what doesn't -- and then start reading objective language criticism to begin to understand the perfect language does not exist, but that one should be a student of all of them.

      Looking at history is nice, but people should also look at the future, say today's research, which may be the products of tomorrow (mind you that adoption by industry takes about 10 years on average).

      --
      Windows is like decaf - it tastes like the real thing, but it won't get you through the day.
  84. Heh, most you slashweenies can't even code C by Anonymous Coward · · Score: 0

    Face it, you're mostly a bunch of weenies who can barely use visual Basic.

  85. Re:It's Free. Enjoy It. Jeeez. by Anonymous Coward · · Score: 0

    Well, I'll be stopping by to drop off a free truckload of elephant manure in your front lawn.

    Enjoy it!

  86. pretty dense, by dbrower · · Score: 1
    I'm up to about page 460, having gotten it a few weeks ago. The commentary on the standard proper is interesting, if a bit verbose. I have a lot of reservations about the wisdom of the length of chapter 0, the psychological theory stuff the author seems to be trumpeting. The gist seems to be that people can be irrational and make silly mistakes, and confusing them doesn't help, and throwing more words at them may not help either. Then there follows 1500 or so pretty dense pages. I'm not sure that a few of the 2000 lines in the standard couldn't have gotten by with a few more "ditto the previous discussion" topics.

    But, for the truly pedantic (like some of us who have been involved in C coding standards for 20 years), much of the detail is interesting. I'm not sure how much general audience there would have been at $90/copy. Graduate level seminars in the ecology and natural history of language standards development?

    -dB

    --
    "It if was easy to do, we'd find someone cheaper than you to do it."
  87. 83 AD called by Anonymous Coward · · Score: 0

    And it wants to remind you that the New Testament is not new at all but a summary of the previous testament that many confuse as being old.

    But yea, you are right, anyone that believes in "thou shalt not kill" and "thou shalt not steal" is obviously old...

  88. Warning to UK Readers! by Hal_Porter · · Score: 0, Flamebait

    There is a picture of Margret Thatcher on page 105.

    If you grew up in the UK in the Thatcher era, between 1979 and 1990, your brain may have a vulnerability that causes it to crash when exposed to these kinds of images.

    At time of writing, no patch is a available.

    The following workarounds are available.

    1) Do not download the pdf file. If you have already downloaded it, delete it without opening it.
    2) Print the PDF file, and ask someone born after 1990 or before 1940 to sort through the printout, find page 105 and destroy it. If they have read about the Thatcer era or lived through it, they should destroy the page *without looking at it*, by placing the printout face down and counting through to page 105.
    3) Disable image display in your pdf file reader, or use a pdf reader which does not support images.
    4) View the pdf in a hex editor.

    --
    echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
  89. Just One Word! by markalanj · · Score: 1

    WOW!

  90. Smoke... by Anonymous Coward · · Score: 0

    Smmmmmohhhke...

  91. Secret code eh? by Anonymous Coward · · Score: 0
    Bomb bomb;
    /* snip */
    bomb.asplode();
    Terrorist!
  92. MOD ME INFORMATIVE! by Anonymous Coward · · Score: 0

    OK Mr Pedant, "ISBN number" is an example of a figure of speech called RAS syndrome. It is too a perfectly valid expression. Now take your grammar trolling elsewhere.

  93. Re:Surely the next language was supposed to be "P" by WilliamSChips · · Score: 1

    It's unknown whether the creators of C were using the next letter in BCPL or the letter after B.
    The Jargon File entry on C says "Before Bjarne Stroustrup settled the question by designing C++, there was a humorous debate over whether C's successor should be named 'D' or 'P'."

    --
    Please, for the good of Humanity, vote Obama.
  94. I'll just toss out my LSSGR... by Anonymous Coward · · Score: 0

    and use the bindings to hold a printout of this book.

  95. Mother of God by Hard_Code · · Score: 2, Funny

    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?
  96. c-PLus-PLus by tepples · · Score: 1

    'b', and its replacement 'c', were both derived from BCPL, so the next in line should be 'p'.

    First there was BCPL. Then, there were B, C, and c-PLus-PLus.

  97. Tail calls in C by tepples · · Score: 1

    Try writing properly tail recursive functions in C

    This is a compiler issue. A compiler can choose to optimize tail calls, or it can choose not to. GCC since at least version 3.3 does optimize tail calls in many circumstances.

  98. His addy from a Usenet post, and website by antispam_ben · · Score: 1

    You can do the obvious demunging with this email address
    Derek M Jones derek@NOSPAMknosof.co.uk
    He also has a website: http://www.knosof.co.uk/
    Amusingly, the "Year 2000 problems in C" link is 404 compliant.

    --
    Tag lost or not installed.
  99. Use Xvfb by tepples · · Score: 1

    I would upgrade to the newer acroread-7.x, but that can not be used for easy pdf-to-ps conversion (e.g. acroread -toPostScript < file.pdf > file.ps) without a valid DISPLAY

    man Xvfb

    Xvfb is an X server that can run on machines with no display hardware and no physical input devices. It emulates a dumb framebuffer using virtual memory.

    The primary use of this server was intended to be server testing. The mfb or cfb code for any depth can be exercised with this server without the need for real hardware that supports the desired depths. The X community has found many other novel uses for Xvfb, including testing clients against unusual depths and screen configurations, doing batch processing with Xvfb as a background rendering engine, load testing, as an aid to porting the X server to a new platform, and providing an unobtrusive way to run applications that don't really need an X server but insist on having one anyway.

  100. Is there a Convoluted C Programming Book Contest? by Anonymous Coward · · Score: 0

    "No more entries, folks, we have a winner."

  101. For the Author by tyrione · · Score: 0, Redundant

    THANK YOU. I will and have started reading your efforts.

  102. Lulu ( a free self publishing site ) by sien · · Score: 1
    Also you might want to check out Lulu which allows you to freely upload stuff and then people only pay when they want a copy.

    There are no upfront costs involved.

    Also, I'd like to point out that I have no affiliation with lulu, I just was looking around for a site that did what they do.

  103. Why this book is EXCELLENT! by chris_sawtell · · Score: 1

    This book is a refreshing change. It is written by an author who has a fully literate command of English, and is therefore a pleasure to read. The contrast to run-of-the-mill books about computing, all of which usually have the linguistic stamp of a semi-literate ten year old child, is so very obvious. The typology is excellent and has been designed by somebody who is fully aware of both the subject matter and communication techniques. There are a few grammatical inconsistencies, primarily of tense and plurality. The publishers are absolutely potty turning down this really beautiful magnum opus. The author is similarly off the normal track giving away this superb work. He should take his work off-line set up a pay for download site as soon as possible.

  104. Accessibility? by tepples · · Score: 1

    Anything that is effective in prohibiting copying to the clipboard will likely prohibit use of a screen reader, making the document not section 508 compliant; watch your company lose its government contracts and tax breaks. And if it can be displayed on screen, it can be printed or OCR'd. What else does the "print screen" key do?

  105. Re:Now that the copyright issues have been sorted by Alsee · · Score: 1
    All copyright law has been rewritten in C and ported to all nations. The first line of US Code Title 17 copyright law now reads:
    #include <berne_convention.h>
    -
    --
    - - You can't take something off the Internet! That's like trying to take pee out of a swimming pool.
  106. This is a rather wordy but well thought out effort by Almost-Retired · · Score: 1

    I skimmed thru the first section and 10 pages or so into the second in trying to decide if this is worth the paper and ink it would take to make a dead tree version of it.

    Generally, I think is worth the time & effort to add it to your bookshelf.

    Addison-Weseley has inadvertantly done us a favor since historicly they have hung onto the copyrights and vigorously defended them to the detriment of the subject matter at hand. Their treatment of the amiga related materiel they published, by end of life treating it long before the usefullness of the material was appreciated by the users brought the amiga platform to a somewhat premature death because the flow of info on how to program it was severely restricted. But they weren't interested in a production run of only 10,000.

    At any rate, I'll give this a **** rating. Its should, unless obvious mistakes are found, serve as the new c99 bible because of its detail.

    I also have both K&R books, and you have to read then with the thought of their conciseness in hand before you can grasp what is being said. Concise is nice, until it leads to obtuse. And its not the least bit helped by the poor quality of the printing where whole pages seemed to have been included in the latest version that were printed on an offset press whose plates were, in the vernacular of the pressman, going blind. This makes it more difficult to read than it should be.

    Makeing your own dead tree version of this should alleviate all the pain except for its weight as you carry it around since its going to be most of the second ream of paper in duplex mode.

    --
    Cheers, Gene
    "There are four boxes to be used in defense of liberty:
    soap, ballot, jury, and ammo. Please use in that order."
    -Ed Howdershelt (Author)
    99.35% setiathome rank, not too shabby for a WV hillbilly

  107. Re:Surely the next language was supposed to be "P" by quigonn · · Score: 1

    In fact, the next in line is PerL.

    --
    A monkey is doing the real work for me.
  108. E? by magetoo · · Score: 1
    "home of E, the secure distributed pure-object platform and p2p scripting language for writing Capability-based Smart Contracts"

    It seems its first application was as a nonsensical statement generator.

    Anyway, the Pascal-looking Amiga E (official site) is what I figured would be hiding behind the link. It was even semi-popular for some time.

  109. Letter by paulatz · · Score: 1

    Pages are in letter size format (187.3x134.9mm^2) how am I supposed to print it with my ol A4 inkjet printer?

    --
    this post contain no useful information, no need to mod it down