Why C Matters

This is a discussion on Why C Matters within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Originally Posted by CornedBee C and C++ are considerably less similar than C# and Java. Does that make Java and ...

  1. #46
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,473
    Quote Originally Posted by CornedBee View Post
    C and C++ are considerably less similar than C# and Java. Does that make Java and C# "merely dialects" of the same language?
    YES! They're all just a dialects. So let's learn only the proper language - C!!!!

    And leave the dialects to the morons who do not know how to speak the literary language!!!

    (Followed by the Evil laughter )
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  2. #47
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,455
    Why use an old, deprecated dialect when you can use a newer one that not only sounds better, it can say everything the old one can, thus making there only one dialect to remember.
    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. #48
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    The flip side of that is that if you learn C, then you only have to learn part of a language to know a language. Thus making it easier to learn and remember.

  4. #49
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,455
    But that won't do if you need to learn how to program typical applications, in which that knowledge just won't do. Not to mention you'd usually use C++ or a more modern language to code that.
    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.

  5. #50
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    Why not? Why?

    edit: maybe that's a bad question...

  6. #51
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,455
    In case you don't need all that "power", "flexibility" and "speed," I think you'll agree that you would choose a higher language to do your work!
    Typically C#, Java or C++ are the popular ones, I believe?
    So why learn two languages instead of one when it can be avoided?
    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.

  7. #52
    Registered User alreadyinuse's Avatar
    Join Date
    Dec 2007
    Posts
    12
    Quote Originally Posted by Elysia View Post
    In case you don't need all that "power", "flexibility" and "speed," I think you'll agree that you would choose a higher language to do your work!
    Typically C#, Java or C++ are the popular ones, I believe?
    So why learn two languages instead of one when it can be avoided?
    Are you trying to tell us you have ever programmed in C++ without using classes and object-oriented facilities? :-D

  8. #53
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,455
    Of course I have
    Typically they are small console, test applications, though.
    I have never been in a situation where I need to write typical C code (I don't write for embedded systems, nor do I write drivers or operating systems, etc), so I have never had the need for C.
    Doubtless there are others who do need to do this, so why not try doing it in C++ for once!?
    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.

  9. #54
    Registered User alreadyinuse's Avatar
    Join Date
    Dec 2007
    Posts
    12
    Quote Originally Posted by Elysia View Post
    Doubtless there are others who do need to do this, so why not try doing it in C++ for once!?
    because cpus are not object-oriented?
    I regret not having learnt assembly at first... I would have made better programs in any language.

  10. #55
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,455
    It doesn't matter what cpus are. CPUs understands machine language and nothing more.
    Ideally, we'd write machine code directly, but for us, this impossible. Thus we rely on a language and a compiler to translate our code into machine language.

    All languages translate into assembly code so they don't need to be anything. And it also makes it possible to write efficient code in any language.
    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.

  11. #56
    Banned
    Join Date
    Nov 2007
    Posts
    678
    I never felt that I had to loose anything learning C++.
    The C part I already knew. And I use the extensions provided by C++ as and when I feel good.
    I don't know more than maybe 20% of C++. But it works for me.
    I am making the switch slowly and conveniently.
    For e.g:
    In C I used int for boolean values, but now I use bool.
    I like passing by reference and it helps me avoid some *s from my code.
    In line functions are cool.
    Function overloading is very good.
    Sometimes I use templates too. But very basic use.
    I haven't yet wrote a program that uses classes (except for some demos to clear my concepts about classes).
    When I write in C++ I get a more comfortable version of C

  12. #57
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    C has inline functions. C99 has _Bool, and bool by extension of stdbool.h.

  13. #58
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    Ideally, we'd write machine code directly, but for us, this impossible. Thus we rely on a language and a compiler to translate our code into machine language.
    Nothing is impossible. I know people who can pull the opcodes for instructions for x86 architectures out of the air. I felt like a very small programmer at that moment. ;-)

    All languages translate into assembly code so they don't need to be anything. And it also makes it possible to write efficient code in any language.
    Er, all languages? Java? PHP? any other interpreted, and not complied, language? It's a bit of a thin argument, as eventually _something_ executes in the processor, but hopefully you catch my drift.

    Really... is it this big a deal? I was defiant that C was better in every way over C++. That is, until I actually tried C++. I miss having classes, std::string/vector/list/map/etc, and all the other warm fuzziness that comes with C++ when for some reason something has to be in C. (There are dark places inside the earth where code must be written in C, or some exotic form of assembler.)

    Although I may have been permanently turned away from Java thanks to an exam dealing with the most ridiculous inheritance examples that drove me nuts. That, and I'm always clueless as to whether it's pass by reference or value... so much clearer in C/C++...

    (The whole "use code tags" == very annoying... find the 'code' in this post...)
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  14. #59
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,455
    Quote Originally Posted by Cactus_Hugger View Post
    Nothing is impossible. I know people who can pull the opcodes for instructions for x86 architectures out of the air. I felt like a very small programmer at that moment. ;-)
    Now that's something I'd like to see
    I think we can agree, however, that even if it's possible to write machine code as fast as can you can write a C/C++ program, otherwise that argument is void

    Er, all languages? Java? PHP? any other interpreted, and not complied, language? It's a bit of a thin argument, as eventually _something_ executes in the processor, but hopefully you catch my drift.
    I do catch your drift. So maybe they don't execute directly on the processor, the the framework translates it into machine code basically. The general "idea" is pretty much the same.

    Really... is it this big a deal? I was defiant that C was better in every way over C++. That is, until I actually tried C++. I miss having classes, std::string/vector/list/map/etc, and all the other warm fuzziness that comes with C++ when for some reason something has to be in C. (There are dark places inside the earth where code must be written in C, or some exotic form of assembler.)

    Although I may have been permanently turned away from Java thanks to an exam dealing with the most ridiculous inheritance examples that drove me nuts. That, and I'm always clueless as to whether it's pass by reference or value... so much clearer in C/C++...
    Well, maybe it's not like the world will end, but I would still like to see C go away. At the very least, C89. Ridiculously unsafe.
    But the worst of everything is that a lot of newbies are writing C and I doubt they're going to make embedded systems, drivers or operating systems, so they should be taught C++ instead.
    My thoughts on the whole.
    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. #60
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >I would still like to see C go away. At the very least, C89. Ridiculously unsafe.
    If you think C89 is ridiculously unsafe, how would you claim that C99 is any better? I mean, C99 doesn't add any features that make the language significantly safer, so if C89 is "ridiculously" unsafe then C99 must be as well. Then again, I would argue that the language is perfectly safe if you use it intelligently.

    >But the worst of everything is that a lot of newbies are writing C
    When I learned C, I was told the same thing that you've been saying: "C is a crusty old language that was replaced by C++; learn C++ because you're not going to be writing code for toasters anytime soon". But I wanted to learn C, and to this day I don't regret it because C gave me a lot of low level understanding that has made me a better programmer all around.

    >so they should be taught C++ instead.
    Most newbies won't be doing anything that C++ is best suited for either. They'll end up writing business applications or web applications that would be better implemented in something like Java or VB or PHP. Your argument doesn't match your logic, because if you continue to the logical conclusion, you're extremely unlikely to end up at "so they should be taught C++".
    My best code is written with the delete key.

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, 01: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21