Thread: Why C Matters

  1. #76
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >Then maybe we should start using languages that have no type-safety whatsoever, perhaps?
    Only if we kill all of the stupid people.

    >We have to sacrifice something for a better goal.
    So we'd be sacrificing C++ code quality for decreased C code quality? Normally a sacrifice results in improvement elsewhere, not deterioration. This sounds like a lose-lose scenario to me.

    >A lot of C code can be converted into C++ code with little effort.
    Idealistic ignorance is unbecoming. There likely isn't a C code base in existence[1] that can be converted to C++ without a lot of effort and resources.

    [1] That wasn't specifically written with C++ compatibility in mind.
    My best code is written with the delete key.

  2. #77
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Prelude View Post
    >We have to sacrifice something for a better goal.
    So we'd be sacrificing C++ code quality for decreased C code quality? Normally a sacrifice results in improvement elsewhere, not deterioration. This sounds like a lose-lose scenario to me.
    That's not how it's supposed to turn out -_-

    >A lot of C code can be converted into C++ code with little effort.
    Idealistic ignorance is unbecoming. There likely isn't a C code base in existence[1] that can be converted to C++ without a lot of effort and resources.

    [1] That wasn't specifically written with C++ compatibility in mind.
    That seems far-fetched to me. How about an example of what cannot be converted into C++ with little effort, so I can become less "ignorant"?
    And btw, it's also understandable that they would convert it into "C+" - just converting the code so it compiles with C++ compilers, not rewriting the entire structure to fit the C++ programming mindset.
    Last edited by Elysia; 01-11-2008 at 12:20 PM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #78
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >That's not how it's supposed to turn out -_-
    Surprise!

    >How about an example of what cannot be converted into
    >C++ with little effort, so I can become less "ignorant"?
    Code:
    int x;
    int x;
    int x;
    int x;
    int x;
    
    int main ( void )
    {
      x = 10;
      return 0;
    }
    Imagine multiple files and a lot of reuse of the identifier x in various scopes. There's more to the conversion than just making code compile. You also have to make sure that none of your changes broke the behavior of the code.

    >rewriting the entire structure to fit the C++ programming mindset.
    That thought never crossed my mind. I'm referring simply to making the existing C code compile and run properly as C++.
    My best code is written with the delete key.

  4. #79
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    There's also simply the fact that some people don't like C++. Linus Torvalds, for example.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #80
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    That's irrelevant. Simply because you don't like a language doesn't mean it shouldn't exist (to clarify: I think C should go away because C++ does everything it does and more and there are at least one reason I've stated that hamapers development of the standard due to the fact that TWO languages exist when there could exist only one!).
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #81
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Simply because you don't like a language doesn't mean it shouldn't exist
    That is a different issue though. The more practical implication of CornedBee's observation is: how do you get a C code base to move to C++ if the programming leads are not willing to make the change because they like the code to be written in C, without caring for C++ compatibility? So it is not so much that C++ should not exist, but that C should continue to exist as a separate programming language.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #82
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    This calls for deprecation.
    Eventually everything will go away, so you should simply stop using at some point.
    The same could go for C. It will be deprecated; people start deploying new projects with it (though old projects will still use C and maintain it), but in the future, C will disappear. There will be such a time when no one teaches it anymore.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #83
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >but in the future, C will disappear. There will be such a time when no one teaches it anymore.
    That's quite likely. But we're not there yet, so deprecating C (however you suggest we do that) will be accepted by the C community with a collective chuckle, and the edict will be promptly ignored.
    My best code is written with the delete key.

  9. #84
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I very much doubt we can do that now, since no one seems to want to use C++ to do everything C can. My opinion is just that C is longer necessary, but I can't do anything about it.
    Last edited by Elysia; 01-11-2008 at 03:02 PM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #85
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    The argument will finally be settled when the C programmers die of old age.

  11. #86
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    We have already have so many post regarding this issue C or C++. I can also see that Prelude talking about C disappears. OH no, it shouldn't. It should be there forever. The whole computer evoluation had been evoled with C and C should continue for ever. Atleast I wish.

    ssharish

  12. #87
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >because no one seems to understand that C++ can do everything C can
    I guess we're done here then. Since you clearly don't respect the intelligence of your peers, there's no reason you should be offered that courtesy.
    My best code is written with the delete key.

  13. #88
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    Deprecation only has meaning within a standard. It only refers to later versions of a standard. To say the standard is deprecated would be meaningless, because there would always be a last version of the standard.

  14. #89
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Prelude View Post
    >because no one seems to understand that C++ can do everything C can
    I guess we're done here then. Since you clearly don't respect the intelligence of your peers, there's no reason you should be offered that courtesy.
    Did I miss something?
    Did someone mention something C can do that C++ cannot?
    All I think I've heard is that existing C code can't be converted to C++ easily and thus, since much is written in C without C++ compability in mind, C must stay. For a while, at least.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  15. #90
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    You missed that "no one seems to understand" is a rude thing to say.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Speed of C++
    By bobthebullet990 in forum A Brief History of Cprogramming.com
    Replies: 64
    Last Post: 01-12-2007, 02:39 AM
  2. Replies: 2
    Last Post: 09-28-2006, 01:06 PM
  3. C++ tests.
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 38
    Last Post: 06-30-2006, 06:51 AM
  4. Confuted/Blackrat: quaternion question
    By Silvercord in forum Game Programming
    Replies: 12
    Last Post: 08-18-2003, 06:02 PM