Thread: Are C and C++ still relevant?

  1. #1
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438

    Are C and C++ still relevant?

    I'll prefix this by saying that I know there are certain uses for these languages which keeps them relevant to a small fraction of the developer community. Most notably operating system, device driver, compiler, etc, developers. I'll also say that I'm not trying to start a flame war against any language, technology, or person.

    I'm wondering if languages like C and C++ are still relevant for the majority of developers. I personally don't think so. In the day of 3ghz machines with gigabytes of memory available, the speed argument for C is losing it's merit. That has been the primary argument for a few decades now. With time, it only gets further and further from relevancy. The other major factor I see is the development life cycle for a C application versus .NET or Java. Given the feature rich frameworks provided by these platforms, the time it takes to build a sophisticated application is far shorter than a C equivalent. The C equivalent may run a fraction faster, but took twice as long to build and debug. Considering the shelf life of applications in the enterprise these days, that can lead to problems down the road.

    All of that aside, it's easy to see that these technologies have their own applications. It will be a cold day in Redmond when Windows is a (near) completely managed environment. By the same token, I'd pass out if my next major project at work was slated for using C in it's development. Of course I'm building business applications where speed is important but not the number one concern.

    What do you all think? I know my surroundings, so I'm expecting some "yes" answers to this question. Which is exactly why I'm posting it here. I want to hear what everyone has to say.

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    So my opinions...

    Quote Originally Posted by CompiledMonkey View Post
    I'm wondering if languages like C and C++ are still relevant for the majority of developers.
    Yes!

    In the day of 3ghz machines with gigabytes of memory available, the speed argument for C is losing it's merit.
    No!

    That has been the primary argument for a few decades now.
    Argument or not, it's not true.

    The other major factor I see is the development life cycle for a C application versus .NET or Java.
    Depends on what you try to do.

    Given the feature rich frameworks provided by these platforms, the time it takes to build a sophisticated application is far shorter than a C equivalent.
    Yes and no. If you have newbie or inexperienced devs, then probably. But if, on the other hand, you have experienced developers, then this factor gets less. Do a search on google for how much free code there exists for C/C++ and .NET and Java. Let's see where there's most of it. C/C++? I thought so.
    They may have rich frameworks, but there's lots of free C/C++ code out there!

    The C equivalent may run a fraction faster, but took twice as long to build and debug.
    Again, depends on the experience of the developers!

    It will be a cold day in Redmond when Windows is a (near) completely managed environment.
    Will probably never happen - at least not completely or at least they will probably never shed native application support.

    By the same token, I'd pass out if my next major project at work was slated for using C in it's development. Of course I'm building business applications where speed is important but not the number one concern.

    What do you all think? I know my surroundings, so I'm expecting some "yes" answers to this question. Which is exactly why I'm posting it here. I want to hear what everyone has to say.
    I can also add that C is really old now and there really is little use for it now. A lot of things stay C, but for poor reason, C++ is today's C, and with all the benefits of C plus more. C++ can be as fast as C, and as unsecure, but it can also be a little slower and much safer.

    There are many, many things that require speed today. Emulators, compilers, drivers, operating systems, video encoders, audio encoders, and so on. Don't think that just because we have fast processors, we don't need old, fast languages because everything will be so fast anyway.
    C/C++ have a very large market and especially since companies continue to support it (Microsoft is finally updating MFC, for example), C/C++ will live on. And compare a .NET app to a C/C++ app and see which is faster, less sluggish and overall better design. Most of the cases, it will be C/C++.
    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. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > In the day of 3ghz machines with gigabytes of memory available,
    What mobile phones and satnav boxes are you using then?

    You'd be pushed to find any electronic device nowadays which doesn't have a microprocessor (except for something really simple), and that's going to need code written for it. Chances are that if it isn't in assembler, then it will be in C.

    For sure, your large desktop application is not going to be written in C, but there's an awful lot of grunt work which needs to be done to get you that nice desktop with lots of useful features, or that camera to send all your piccies down the USB cable to your PC.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438
    @Elysia:

    You said a lot about "depends on what you're trying to do" and "depends on the experience of the developers". We're talking on a level playing field here. Given two developers with equal experience in their respective platform, the one in .NET will generally complete their objective quicker. There's a reason they call these newer frameworks RAD environments.

    The abundance of "free code" is irrelevant in my opinion. If anything, having a rich framework like the .NET framework is more of a benefit than random code snippets found across the Internet. Not only is it a supported, well documented, and consistent framework, but everyone developing in .NET is obviously using it. Therefore the knowledge is easier to find online.

    When it comes to design, I don't think you can claim C/C++ will have been designed better. That's so language independent that there's no logical bridge for that.

    @Salem:

    Great point. Mobile computing is a perfect use for fast, efficient, and platform independent technology like C. Of course not everyone here at cprogramming.com is developing for their handheld device. So, there's certainly more out there as solid reasons for C's continued existence and usage.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by CompiledMonkey View Post
    You said a lot about "depends on what you're trying to do" and "depends on the experience of the developers". We're talking on a level playing field here. Given two developers with equal experience in their respective platform, the one in .NET will generally complete their objective quicker. There's a reason they call these newer frameworks RAD environments.
    Sure, but you miss out on a lot of features you can't do in a managed environment too.

    The abundance of "free code" is irrelevant in my opinion. If anything, having a rich framework like the .NET framework is more of a benefit than random code snippets found across the Internet. Not only is it a supported, well documented, and consistent framework, but everyone developing in .NET is obviously using it. Therefore the knowledge is easier to find online.
    It's not as good as a big framework of functionality, but it certainly negates the big bad framework argument.

    When it comes to design, I don't think you can claim C/C++ will have been designed better. That's so language independent that there's no logical bridge for that.
    All applications I have seen perform better when non-managed, simply because managed is such a huge resource hog and eating cpu like no tomorrow.

    And as devices and things smaller, there will be more need for fast languages.
    So I don't see C/C++ going anywhere
    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. #6
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >I'm wondering if languages like C and C++ are still relevant for the majority of developers.
    Yes.

    >In the day of 3ghz machines with gigabytes of memory
    >available, the speed argument for C is losing it's merit.
    Quite the contrary. People use the opposite argument to justify their sloppy and wasteful behavior. The processing and storage capacity of computers isn't keeping up with the ever increasing demands of computer users, and if you don't take performance seriously, you're probably writing bad code.

    >The other major factor I see is the development life
    >cycle for a C application versus .NET or Java.
    That's a factor in choosing the language for your projects, not a factor in C or C++'s relevancy.

    >Given the feature rich frameworks provided by these platforms,
    >the time it takes to build a sophisticated application is far
    >shorter than a C equivalent.
    Given an equally feature rich library in either C or C++, you'll see similar productivity figures.
    My best code is written with the delete key.

  7. #7
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438
    Quote Originally Posted by Elysia View Post
    It's not as good as a big framework of functionality, but it certainly negates the big bad framework argument.
    Read your statement again. It may lessen the argument, but certainly does not negate it.

    Quote Originally Posted by Elysia View Post
    All applications I have seen perform better when non-managed, simply because managed is such a huge resource hog and eating cpu like no tomorrow.
    Design doesn't necessarily mean performance. Most often design is in reference to how well an application can be understood and enhanced by someone other than the author. A well designed C# application (meaning MVC, or N-Tier in ASP.NET) is much easier to understand than a "well designed" C application. I've noticed that C applications tend to be globed together with header files and C source files, which inherently make them more difficult to read and understand than a well structured OO application in C#/Java.

    Quote Originally Posted by Elysia View Post
    And as devices and things smaller, there will be more need for fast languages.
    Why do you assume that because devices gets smaller, they'll need native languages such as C? If we take the cell phone industry as an example, you'll find tons of Java code out there. Certainly it's slower than C code could be but lest we forget about our old pal Moore.

    Quote Originally Posted by Elysia View Post
    So I don't see C/C++ going anywhere
    I can't disagree with you there.

  8. #8
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    This is a stupid argument that we have heard time and time again. Why is it everyone's goal to remove C/C++? Microsoft has recently stated in a rather heated thread that they absolutely have no plans now or in the future to remove C/C++ from MSVS. In fact at a workshop they held in 2007 the most popular mini workshops were those concerning C/C++. This they said was clear evidence that a whole slew of companies are still using C/C++.
    At my current job we could not produce what we do without C and C++. These kinds of discussions are not only absurd, but they are uneducated to say the least. Forgive my harshness but we've discussed this crazy topic about a billion times in the history of this board and well...it's getting a bit thin.

    I'm not saying this about the OP but most people I see making this argument either have little experience in C/C++, don't understand it, or are trying to rid the world of it so they don't have to learn how to write programs that cause you to exercise some brain power, or have been sitting under too many Java profs at school. C/C++ is not the only language out there and thankfully you can use others for various tasks. But it is going to be around for a very long time to come.

    Microsoft released C++/CLI which has not gotten off to a good start and based on the fact that they are updating MFC, I'd say the C++/CLI launch didn't go as planned. So even though it offers such things as memory management, etc, etc, not many are using it. There are millions of lines of C/C++ code out there both embedded and non. And yes there is such a thing as developing desktop applications in C++ and not it is not any more difficult than using another language. In fact you end up coming up against the same problems which have more to do with Win32 API than they do choice of language. Even with the extremely limited experience I've had with C++ GUI apps I would say this age old argument about C++ and GUI just doesn't hold any water. I'll be frank here and say that if you cannot code a GUI app in C/C++ using MFC or even pure Win32 then either you can't program at all, you aren't trying, or you are talking about something which you personally have never attempted.

    And another thing a lot of people seem to keep telling us C++ programmers that we don't want to manage our own memory. This is so untrue. Every C++ programmer I've ever talked to hates having his/her memory managed for them. The number one complaint I hear about C# is that you do not get to manage your own memory. Truth is - I like having control over my memory and I resent people trying to take that away from me at every turn.
    What's so hard about malloc and free or new and delete? If you malloc it, free it, if you new it, delete it. Duh.

    A well designed C# application (meaning MVC, or N-Tier in ASP.NET) is much easier to understand than a "well designed" C application. I've noticed that C applications tend to be globed together with header files and C source files,
    As opposed to C#'s method of throwing everything and the kitchen sink into one class file? Yeah that's a lot more understandable. The only reason a C# app is easier to understand is because that's what YOU understand better, but that's not true with everyone. A well designed C/C++ app is easy to understand as well. I like C# for what it was designed for but interop with native code is a pain (causing more days of dev just to design a wrapper or COM object) and it's not the best choice for everything.

    You are making a lot of blanket statements that do not apply in all cases. Choose the language that helps you get the job done and that you are familiar with. Trying to remove a language because you don't like it is quite absurd.
    Last edited by VirtualAce; 12-24-2007 at 02:32 AM.

  9. #9
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by CompiledMonkey View Post
    Read your statement again. It may lessen the argument, but certainly does not negate it.
    No, it certainly does. Everything you can do in Java/.NET, you can do in C/C++, just with the right resources. Just as might have to search your documentation to find the function you want to use in the framework, if you know where to look, you can often find snippets of code that does the same thing for C/C++. It may take a little longer time, but overall, this is something every developer need to be able to do and know. If a dev can't do this, then sorry, but it isn't much of a developer at all.

    Design doesn't necessarily mean performance. Most often design is in reference to how well an application can be understood and enhanced by someone other than the author. A well designed C# application (meaning MVC, or N-Tier in ASP.NET) is much easier to understand than a "well designed" C application. I've noticed that C applications tend to be globed together with header files and C source files, which inherently make them more difficult to read and understand than a well structured OO application in C#/Java.
    This is untrue.
    It may look better to you, but as Bubba implies, to us C/C++ devs, it's not difficult at all. You're just not used to it.
    And as Bubba also implies, with .NET, it seems many devs are getting lazy and do all kind of stupid things such as wasting memory like no tomorrow (because the garbage collector will collect and free it anyway). So I believe that C/C++ are better designed overall, because C/C++ devs aren't (and can't be) as lazy as .NET/Java languages.

    Why do you assume that because devices gets smaller, they'll need native languages such as C? If we take the cell phone industry as an example, you'll find tons of Java code out there. Certainly it's slower than C code could be but lest we forget about our old pal Moore.
    Yes and what about our old little pals that are trying to decode 1080p? You can be sure that will arrive in cell phones in the future, as well. Heck, our current processors are having trouble with it, so what about cell phones? I'll give you a sample - CoreAVC is an extremely fast decoder that can decode 1080p@60 on-the-fly with usually little problem. And it's coded in C or C++ (not sure which).
    Yes, processors are getting faster and faster, but remember that computers beats cell phones by great lengths and once there will be something new, newer than the cell phones, a curve for those devices will begin, as well. Typical small, slow processors. Speed is the key!


    Other than that, I think Bubba sums up very well the fact that C/C++ is going nowhere.
    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. #10
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438
    Quote Originally Posted by Bubba View Post
    I'm not saying this about the OP but most people I see making this argument either have little experience in C/C++, don't understand it, or are trying to rid the world of it so they don't have to learn how to write programs that cause you to exercise some brain power, or have been sitting under too many Java profs at school. C/C++ is not the only language out there and thankfully you can use others for various tasks. But it is going to be around for a very long time to come.
    You want to talk about brain power yet also mention how it's no different than other languages. Make up your mind. I don't see the requirement of having tons of experience with a language to understand the uses of it. I don't see anywhere in this thread where I've stated something incorrect about the usage of C/C++. Do you?

    Quote Originally Posted by Bubba View Post
    As opposed to C#'s method of throwing everything and the kitchen sink into one class file? Yeah that's a lot more understandable.
    And you're talking about not understanding a language? This comment is painfully obvious in how you shouldn't comment about C#. If you'll read above, we were talking about good design and OOP. Can you dump everything into a single file with C#? Sure, just like C, C++, Java, etc, etc. But again, if you'll read the context, you'll see that wasn't the conversation.

    Quote Originally Posted by Bubba View Post
    Why is it everyone's goal to remove C/C++?
    Quote Originally Posted by Bubba View Post
    Trying to remove a language because you don't like it is quite absurd.
    Talk about uneducated and assumptions. Nobody said anything about removing it or not liking it. It's a simple discussion that had no derogatory remarks or comments. Think you can join that discussion?

  11. #11
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Well, if we take C# for example, that is essentially a "Java with some C++ thrown in". Aside from a ginormous set of "ready to use libraries", many of which are also available for C and C++ if you just are willing to search hard enough or pay the right sort of money. I don't see C# as an enormous improvement on C or C++.

    Java may be a step above, but it's certainly not revulotionizing (is that a word, or did I just make it up?) the software industry, in my opinion.

    Very often, in large software projects, the hard part is producing the "medium level library", the functions that access and manage the database, the network, the spellchecking and/or do basic graphics functions, whatever it is that your application is doing. Once you have the "basic framework", the main development is quite easy.

    In many GUI application development projects, doing the layout/menu/dialog system is probably almost as much effort as doing the actual code for the rest of application. This will be almost identical whatever language you use.

    Yes, C and C++ can be used to do really low level coding [that is indeed what I do for a living], but it's also quite capable of doing high level functionality, once you have your "middle-level functions" there.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  12. #12
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Try to write a HPC application in C# or MFC. Speed and efficiency will always be a concern regardless of how fast the hardware gets. Sloppy code that runs half as fast will always run half as fast no matter how speedy the hardware. With modern computer systems generating significant heat the focus is shifting away from absolute cycles and shifting to FLOPS/WATT. Makign efficient use of the processor resources, particularly in large deployments is fo critical importance. For trivial consumer applications, MFC or C# are probably good enough in many cases, but for performance critical applications, C/C++ was, is, and always will be king.

    The real issue is that companies are getting tired of having to pay decent salaries to programmers. They want to turn programming into a McDonalds job where they can hire a bunch of homless people for $2 an hour and work them 25 hours a day with no overtime or benefits. People intelligent enough to wield C/C++ wont put up with being treated that way, so they want to dumb down programming so maybe they can get people who will put up with it, except the issue isnt that C/C++ is 'too hard', its that programming is an inherently mental task, which requires people with strong problem solving skills. Im fully aware of these other languages, I choose to use C/C++ because it is the easiest language to use that fully meets my needs. The programmign I do requires high performance, if I was a web page designer, id probably think J++ was perfect. If I wrote buggy activeX spyware Id swear by C#.

    New != Better
    Last edited by abachler; 12-24-2007 at 11:34 AM.

  13. #13
    Registered User
    Join Date
    Dec 2007
    Location
    North Georgia Mountains
    Posts
    11
    Are C and C++ still relevant - depends on the problem to be solved. I couldn't imagine a firewall, ids, network analyzer, real time trading or risk analysis system being written in java, vb or C#. Language selection as well as architecture are not one size fits all operations - there is a lot of it depends for the answer.
    I have seen some problems in which there is no system or language that is fast enough to give a good answer in a reasonable amount of time and seen folks use sparse matrix approximations in order to speed things up and still not be fast enough.

    tom

    tom

  14. #14
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Talk about uneducated and assumptions. Nobody said anything about removing it or not liking it. It's a simple discussion that had no derogatory remarks or comments. Think you can join that discussion?
    No because we are tired of discussing this. I stand by my statement. It's absurd and ignorant.
    The basic idea of this discussion is we defend A, you promote B, we defend A, you promote B. In essence it ends up being your way or the high way which is not really a discussion at all.
    Nothing we say or do will ever convince you that C/C++ is still relevant because in the end it's not relevant to you.
    C/C++ is here to stay. No it's not the only language. I'm not even saying it's the best language. It is what it is. A tool to be used properly. Debating which tool to use is utterly ridiculous. It's like a bunch of production workers arguing over which tool to use on an assembly line.

    "Well, <insert name>, ya know that wrench really ain't relevant anymore. Here use this new-fangled thingy."

    Sorry but when I was on production lines we never had this discussion. We used the tools we were most comfortable with and that got the job done. The only people ever trying to fix problems and answer questions we weren't asking were the think-tanks upstairs.

    So why talk about it? There are sometimes when the imperfect tools we have are still good enough to get the job done right.

    So let's compare nails or hammers or wrenches because that is essentially what you are doing here.

    And you're talking about not understanding a language? This comment is painfully obvious in how you shouldn't comment about C#. If you'll read above, we were talking about good design and OOP.
    I didn't throw everything into one file. Microsoft did with their editor.
    Last edited by VirtualAce; 12-24-2007 at 01:59 PM.

  15. #15
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Ill side with Bubba, but add one thing. If a tool is relevent to even one problem, then it is relevant period. To argue that we should get rid of hammers because we have nail guns is stupid, because a nail gun only performs one function of a hammer, albeit faster, it fails miserably at other tasks that a hammer is used for. Try driving a bearing onto a shaft with a nail gun, or cracking walnuts, or ...

    Someone please close this thread before it becomes 'The Thread That Will Never Die"
    Last edited by abachler; 12-24-2007 at 03:03 PM.

Popular pages Recent additions subscribe to a feed