Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming

Are C and C++ Losing Ground? 961

Pickens writes "Dr. Dobbs has an interesting interview with Paul Jansen, the managing director of TIOBE Software, about the Programming Community Index, which measures the popularity of programming languages by monitoring their web presence. Since the TIOBE index has been published now for more than 6 years, it gives an interesting picture about trends in the usage of programming languages. Jansen says not much has affected the top ten programming languages in the last five years, with only Python entering the top 10 (replacing COBOL), but C and C++ are definitely losing ground. 'Languages without automated garbage collection are getting out of fashion,' says Jansen. 'The chance of running into all kinds of memory problems is gradually outweighing the performance penalty you have to pay for garbage collection.'"
This discussion has been archived. No new comments can be posted.

Are C and C++ Losing Ground?

Comments Filter:
  • by KillerCow ( 213458 ) on Thursday April 24, 2008 @04:34PM (#23188964)
    But does Netcraft confirm it?
    • by Tackhead ( 54550 ) on Thursday April 24, 2008 @04:54PM (#23189286)

      But does Netcraft confirm it?

      No, but Stroustrup himself is reputed to have apologized for C++ as far back as 1998.

      "It was only supposed to be a joke, I never thought people would take the book seriously."
      - From the lost tapes of the legendary IEEE interview [nao.ac.jp] of 1998 :)

  • Always be there (Score:5, Insightful)

    by ohxten ( 1248800 ) on Thursday April 24, 2008 @04:35PM (#23188972) Homepage
    C/C++ will always be there. Period. Just look at all of the C/C++ projects on SourceForge. New languages will come and go, but C/C++ are just too stable to go so quickly.
    • Re:Always be there (Score:4, Insightful)

      by KlomDark ( 6370 ) on Thursday April 24, 2008 @04:38PM (#23189016) Homepage Journal
      Yep, it'll be right out there with all the Cobol projects on Sourceforge...
    • by krog ( 25663 ) on Thursday April 24, 2008 @04:47PM (#23189158) Homepage
      C and C++ are entrenched, but it was never their stability which caused it. Computer languages are theoretical; one valid language is just as 'stable' as another. The real issue of stability lies in the implementation, and that is language-independent.

      Anyway, C is going to stick around because it is the most superb assembly language developed by man. C++ will of course stay around as well, but by modern standards it fails as a "high-level" language. The ceiling got a lot higher in the intervening 20 years; other languages reach much higher in a very useful way. I'd be happy to see less C++.
      • I'm not sure C is up to the multithreading/ multiprocessor support that is going to be required as processors keep shifting from single core to multicore architectures...I know it can be done, but C is hard to program for a single core...Multicore support may take it over the edge.

        Mind you, I don't think anything else is really set up for it either (Erlang?) but that's going to be the next big challenge.
        • by Sloppy ( 14984 ) on Thursday April 24, 2008 @05:20PM (#23189660) Homepage Journal

          Mind you, I don't think anything else is really set up for it either (Erlang?) but that's going to be the next big challenge.

          Whatever it is, its compiler and low-level libraries will be written in C.

        • by Nursie ( 632944 ) on Thursday April 24, 2008 @06:39PM (#23191012)
          Jesus christ there's another one....

          C has been doing multi process for decades, and multi thread for a decade or more.

          It's used in commercial apps all over the world.

          How many times - threads and parallelism have been with us for years. Just because games haven't been threaded doesn't mean the rest of the world hasn't been doing it, and doing it well for a long time

          Look up pthreads sometime.

          Seriously, threaded processing in C is damn simple.
          • Mods on crack (Score:5, Informative)

            by Nursie ( 632944 ) on Thursday April 24, 2008 @07:05PM (#23191390)
            Troll?

            Annoyed, enflamed perhaps, but Troll?

            Sorry but it's a pet hate of mine that here on slashdot, which is supposed to be a forward looking tech board, that people still regularly espouse the view that threaded programming is something either still in development, too complex for ordinary mortals, or only applicable in a few scientific arenas.

            It's just thoroughly incorrect. Industry and open source have been doing threading for years. Please can we lose this myth.

            And to bring the post back on topic - pthreads in C will do it all nicely. Hell, even MS VC++ 6.0 (almost 10 years old?) will compile your multithreaded Windows C app.

            I'd also lik to express suprise at the title of this article. C is losing popularity at the same position as last year, number 2? OK, it'll fizzle out any day now, I believe you.

            I think my job's safe for now.
    • Re:Always be there (Score:5, Insightful)

      by fyngyrz ( 762201 ) * on Thursday April 24, 2008 @04:47PM (#23189160) Homepage Journal

      C is perfectly capable of extremely high-quality memory management with significant ease-of-use. However, you get to create that facility, or of course you can utilize someone else's design if you can locate one that fits your API needs, budget and time frame.

      For instance, years ago I faced this issue and wrote a module that ensures there are no leaks in any part of an application I write; I also get over-run and under-run detection, named segments, dual-free attempt capture, memory usage reporting, and more. I have debug and end-user levels for the code so that during development, I get enormous detail, while the end user doesn't see that unless I specifically turn it on for them.

      I have both pool and chunk level management; I have both pool and individual "free" levels; all of this in very few K indeed.

      C is the perfect language to implement memory management in, in fact, because it has perfect fine-grained control over memory.

      That goes for other things as well; C is highly capable if you need to build in certain types of OO; objects with built-in methods and variables can be crafted in seconds, with no waste at all; uniform list handling can be crafted (and is an interesting and useful programming exercise.)

      C *could* go away as a result of a generation of programmers who really don't know how to deal with such things, but I think it would be a real loss if it happened. The up side is that it'll take a while. There's a whole generation of us who know C quite well, and we're nowhere near dead yet. ;-)

      • Re:Always be there (Score:5, Insightful)

        by afabbro ( 33948 ) on Thursday April 24, 2008 @05:08PM (#23189470) Homepage

        However, you get to create that facility

        s/get to/must/

        Seriously, most people want to sit down and write the logic for their application, not invent (or even copy-paste) memory management schemes.

        • Re:Always be there (Score:5, Insightful)

          by fyngyrz ( 762201 ) * on Thursday April 24, 2008 @05:44PM (#23190084) Homepage Journal

          Seriously, most people want to sit down and write the logic for their application, not invent (or even copy-paste) memory management schemes.

          Yes, I understand that perfectly. I'm a huge fan of Python for that very reason.

          However, in C, writing memory management only needs to be done once; while writing the "logic for the[ir] application" is done many times. Consequently, the apparent load of writing memory management is much lighter than one might initially recognize. Or to put it another way, once it's done, it's done and represents no load at all.

          Further, there are huge advantages to having 100% control over the memory management of your application; speed advantages, fewer wasted/tied-up resources, and all the downhill consequences of those things -- if you don't waste resources, they're available for the user, or for other aspects of your programs. Likewise, if you get things done faster, more CPU is available elsewhere.

          Another thing: Depending on an external agency to manage your resources is a two-edged sword. If there are bugs in *your* code, you can fix them as fast as you are competent to do so. Considering you wrote it in the first place, the presumption that you are competent to fix it is usually on target.

          If there are bugs in an external agency, you typically get to report them... and wait, bugs happily chewing on the users of your applications, until said external agency gets around to fixing whatever it was. If indeed they ever do.

          Same thing goes for list management, etc. Write it once, learn all about it (which is interesting AND increases your Leet Skillz) and now you have a generally useful tool that is as fast as you can make it, totally amenable to fixes and updates, and invulnerable to the ass-draggery of outside influences. I have used my list management module in AI apps, ray tracers, image processing, file management, and even in dialogs to control layer types in various (what I think are) clever ways. I have huge confidence in it, but, should it turn out to be broken... I could fix it in minutes. At which point every app I've written gains ground, all my customers win, etc.

          There's something else that has always remained in the back of my mind. As languages get more sophisticated, there is a trend for them to generate much larger and much slower resulting applications. It isn't uniform, and it depends on what you're doing, compilers as compared to interpreters, etc., but the trend itself is pretty clear. For instance, a Python app seems small, until you realize that the Python interpreter is loaded for your one-liner. C++ apps tend to be huge compared to C apps. And so on.

          This trend - basically - tracks the increasing availability of memory and CPU power. Seems reasonable enough. But the funny thing is, if you take an app that was designed to run at adequate speed on hardware from, say, 1992, keep the technology behind the app the same if you update it - that is, keep writing efficient C and so on - then the increase in memory and CPU resources serve to turn the app into some kind of blistering miracle implementation instead of the run of the mill performance you get from depending on the latest and greatest HLL with garbage collection, the implicit inclusion of module after module of object-oriented processing and modeling, data hiding, etc., etc.

          Directly related to this is the fact that if you attempt a modern task - such as an image manipulation system - in a modern language, you, as the programmer, can be significantly enabled by the language; that is, you can be done sooner, and you can have a lot of things done, too, many coming along for the ride, for "free." Garbage collection / memory management being one such thing. But if you approach the task using C, which is basically capable of creating as fast an application as you are capable of writing, it is so close to assembly, while we can certainly agree up front it'll take you longer, the end result coul

          • Re:Always be there (Score:5, Insightful)

            by jsebrech ( 525647 ) on Thursday April 24, 2008 @06:04PM (#23190460)
            But if you approach the task using C, which is basically capable of creating as fast an application as you are capable of writing, it is so close to assembly, while we can certainly agree up front it'll take you longer, the end result could be a lot faster and a lot more capable of efficiently managing the user's resources than that which you might create using a modern HLL.

            Agreed 100 percent. If you write it in C, you can make it run faster with lower resources, but you will spend a lot more time creating, debugging and maintaining it.

            Most software simply doesn't need to be that fast. The performance sensitive pieces of code are in database queries (C code), or disk operations (C code), or math operations (C code). Modern garbage collectors also are proven, they're fast, they're reliable. It doesn't make sense for the majority of classes of software, from a cost vs. gain perspective, to use C for the job.

            • Re:Always be there (Score:4, Interesting)

              by fyngyrz ( 762201 ) * on Thursday April 24, 2008 @06:34PM (#23190936) Homepage Journal

              ...but you will spend a lot more time creating, debugging and maintaining it.

              Hmm. Creating, probably so. You're writing smaller steps on a per-keystroke basis, so it's pretty much a given.

              Debugging and maintaining, however, are issues more predicated upon design skills than the language used. From things entirely outside the code's executing domain (like comments and other documentation) to things inside (structures and algorithms), correctness (from which depends debugging), reliability (from which depends maintainance) and completeness / applicability (from which also depend maintainance), all these things are independent of the language, except in very minor and essentially irrelevant ways.

              I would argue that coding in an HLL does not improve these latter things. However, coding in C brings you extremely close to both the problem(s), and the solution(s) you decide to implement without taking you that last troublesome step down into assembler, where you lose platform independence. I think that is a uniformly positive set of consequences to enjoy as a result of spending that extra time.

              It doesn't make sense for the majority of classes of software, from a cost vs. gain perspective, to use C for the job.

              Well, we'll have to agree to disagree here. Wasting resources can have unpredictably large effects, such as pushing a system over the edge between running in memory and beginning to swap. The more you waste, the more likely you are to cause such problems.

              The fact is, running the user out of resources for no reason other than saving small amounts of my time up front is outside the bounds I am willing to go. The gains at the user's end, especially when multiplied by many users across many invocations, are likely to be substantial. Consequently, the investment on my end is almost certain to be small by comparison, even if it is actually many of my hours.

              As a user, I run into this all the time. If I start a certain application, it typically takes quite some time to start. It's the "industry standard", but frankly, it runs like a pig in hip deep dung on every startup. And it eats memory like crazy, even the executable is 4x larger than other apps that do the same thing, but which -- notably -- aren't the "industry standard." So I make the choice, as a user, to use the other apps for all tasks that are achievable either way (and as it turns out, I *very* rarely have to start the industry standard program.) I want my memory to be used for data, not for a bloated application; and I want my time used in working on that data, not waiting to count and register every plugin or aux feature in the system every time the application starts.

              The problem is that from the programmer's perspective, "time and effort" are not even slightly the same as they are from the user's perspective. For my part, I consider it an ethical "must-do" to consider the user's perspective as the primary one driving the design. Both from the viewpoint that their resources are not "mine to waste" just because they have extended me the courtesy of allowing my software to run in their machine, but also from the viewpoint that any supposedly "extra" time I spend, I spend once; any time I cost the users unnecessarily, I extract that cost from every user, and every time the software is run.

          • Re:Always be there (Score:5, Insightful)

            by lena_10326 ( 1100441 ) on Thursday April 24, 2008 @07:56PM (#23192050) Homepage

            However, in C, writing memory management only needs to be done once; while writing the "logic for the[ir] application" is done many times. Consequently, the apparent load of writing memory management is much lighter than one might initially recognize. Or to put it another way, once it's done, it's done and represents no load at all.
            I don't believe that is true at all. One huge reason for building a memory management scheme is to tailor it to a specific algorithm, which is bound to a particular application. Optimization for allocating small chunks (bytes to kilobytes) can be very different compared to allocating extremely large chunks (megabytes to gigabytes), or variable sized versus fixed size, or read/writes with sequential access versus random access, or low access frequency versus high access frequency, or multi-threaded versus serial. These are all intricately bound to the overall application algorithm and can yield extremely different solutions given a particular problem. It's simply not possible to write a general allocation scheme that is fully optimized for every type of problem. I've experienced this in real world projects.

            Another thing: Depending on an external agency to manage your resources is a two-edged sword. If there are bugs in *your* code, you can fix them as fast as you are competent to do so. Considering you wrote it in the first place, the presumption that you are competent to fix it is usually on target.
            It's rare that the original developer stays on the project for its lifetime of usage. In fact, I've never seen that happen. People quit, get fired, get promoted, or move onto new projects. When the sole hot-shot in the organization writes a complex codebase, it places a future burden on the lesser experienced team that may inherit it. Maintenance is always more expensive than original development.

            If there are bugs in *your* code, you can fix them as fast as you are competent to do so. Considering you wrote it in the first place, the presumption that you are competent to fix it is usually on target... [CUT]... I have huge confidence in it, but, should it turn out to be broken... I could fix it in minutes
            I don't believe that for a second. I've seen sneaky bugs in C code plague development teams for days and on a few occasions a week. You're either vastly underestimating or are totally unaware of very well hidden bugs in your code.

            But the funny thing is, if you take an app that was designed to run at adequate speed on hardware from, say, 1992, keep the technology behind the app the same if you update it - that is, keep writing efficient C and so on - then the increase in memory and CPU resources serve to turn the app into some kind of blistering miracle implementation instead of the run of the mill performance you get from depending on the latest and greatest HLL with garbage collection
            99+% of the time with general problems, I/O is the bottleneck. For those cases, a C application might run 1% faster on newer hardware, given equivalent I/O hardware (same model/make of drive or network). In the vast majority of cases, the effort is simply not worth it. It's far more expensive to pay your salary to build and maintain that codebase than it is to simply purchase a beefier machine. The former is a repeating expense, the latter is a one time expense. Business managers love the latter, not the former.

            I do agree that if your domain consists of highly CPU bound computational algorithms that don't require frequent HD or network access, then your approach will scale well with the faster hardware.; however, I don't think advocating it as a baseline approach for all or most projects makes any sense. It is far more work and causes more maintenance headaches than you're describing.
    • Re:Always be there (Score:5, Insightful)

      by SanityInAnarchy ( 655584 ) <ninja@slaphack.com> on Thursday April 24, 2008 @04:54PM (#23189278) Journal
      Assembly will always be there. Period.

      That doesn't mean it will be particularly popular, or very likely that you can get a job in doing nothing but assembly programming.

      Really, with C especially, just about every advantage it has over more modern languages are advantages that C itself has over assembly. Assembly is still needed, but no one in their right mind would, say, write an entire OS in assembly.

      The day is coming when no one in their right mind will write an entire OS in C or C++, or even an entire OS kernel -- depending on your definition of "kernel".
    • I do most of my work in Python and Java now. However, I often need to write in C/C++ to create JNI modules for Java or extension modules for Python. Wrapping low level (use 3rd party library) and performance intensive stuff for control via a higher level language is very productive. (C++ is handy for JNI, C is better for Python.) Furthermore, I even occasionally write small functions in assembler for C - usually to utilize a specialized instruction.
    • by rishistar ( 662278 ) on Thursday April 24, 2008 @05:08PM (#23189468) Homepage
      C/C++ will always be there. Semi-Colon. There fixed that for you.
  • by eldavojohn ( 898314 ) * <eldavojohnNO@SPAMgmail.com> on Thursday April 24, 2008 @04:35PM (#23188976) Journal
    I can handle C and C++ losing ground.

    But did anyone else find Visual Basic rising two spots to #3 past PHP & C++ to be a sure sign of the apocalypse?

    (Visual) Basic 11.699% +3.42% A
    Could someone reassure me that's a mistake before I go home to sit down with a bottle of Jack Daniels and a revolver with a single bullet in it?
    • Re: (Score:3, Informative)

      by kitgerrits ( 1034262 ) *

      This might have something to do with this PowerShell thing: ccontrolling the O/S through the use of VB scripts.
      It's not exactly the Bourne Shell, but it does show promise.
      As Windows admins look at scripting the boring stuff, they will need to learn VB...
    • by Hoplite3 ( 671379 ) on Thursday April 24, 2008 @04:45PM (#23189122)
      Not a mistake. But if I could make a suggestion, it would be to upgrade your burbon to Booker's. You won't need that money later.
    • by thermian ( 1267986 ) on Thursday April 24, 2008 @04:50PM (#23189228)
      I've been C coding for years, and I have to say, even though I like it, the number of things that I can do more easily with, say, Python, is getting larger.

      I suspect that soon all I will use C for is writing shared libraries that I can call from some other language.

      I wish people would stop banging on about C's memory problems. C has *no* memory management problem. It has no memory management at all, um, I mean, you just have to be careful when writing your code.

      C is fast, seriously fast even. For that reason alone it will always have a place. I shouldn't think there will be many coders who only use C left soon though, because the job market for pure C programmers is pretty small these days.
  • by KlomDark ( 6370 ) on Thursday April 24, 2008 @04:36PM (#23188984) Homepage Journal
    I haven't written a line of code in C or C++ since I started with C# - C/C++ syntax with no tracking of memory (I detest tracking memory!!) except in the more obscure situations. Both .NET and Mono allow for C#, so you're not stuck on one platform.

    • Re: (Score:3, Interesting)

      by QuantumG ( 50515 ) *
      Lately I've found the biggest advantage of using C# over C++ is compile time. If I change a header file in C++, that's it, I'm off to make coffee, but with C# you can change just about anything and the code is recompiled in seconds.

      Now if only the native code generation for C# wasn't so pitiful and unsupported.

    • by pclminion ( 145572 ) on Thursday April 24, 2008 @04:53PM (#23189274)

      I'm not sure why you feel you need to "track memory" in C++. I did an analysis of all the code I've written a year or so ago, and I found that there is approximately one usage of a pointer in every 5700 lines of code (the way I write it, at least).

      We have this great stuff called containers and RAII. And for when you absolutely must, must use a pointer, you have boost::scoped_ptr and boost::shared_ptr. I have not coded a memory leak or buffer overrun in C++ in over six years.

      The best way to not leak memory is to never allocate it in the first place. The best way to avoid overflowing raw buffers is to not use raw buffers. Use the containers. When you think you can't, think harder.

      • Re: (Score:3, Informative)

        by sconeu ( 64226 )
        Not to mention that scoped_ptr and shared_ptr are in the next iteration of the Standard (well, shared_ptr for sure, can't remember about scoped_ptr).
      • by Kevin Stevens ( 227724 ) <kevstevNO@SPAMgmail.com> on Thursday April 24, 2008 @06:13PM (#23190604)
        If you use the facilities provided by the STL and BOOST (most notably shared_ptr), C++ is not a whole lot different than Java these days. Java went a little too far in my opinion on being nice to the programmers while giving up performance. Modern C++ hits the sweet spot in my opinion.

        If only the standards committee could get off its arse and progress as quickly as BOOST does....
    • by PhrostyMcByte ( 589271 ) <phrosty@gmail.com> on Thursday April 24, 2008 @05:11PM (#23189508) Homepage

      Garbage collection is surely a factor in them losing ground, but I think the main reason is simple: library support.

      Java and .NET have huge well-designed frameworks behind them. You can get things done really fast. What does C have? A bunch of separate libraries all with different conventions. C++ is a little better with a more useful standard library and Boost, but it still doesn't have anywhere near the infrastructure Java and .NET have.

    • by Weaselmancer ( 533834 ) on Thursday April 24, 2008 @05:35PM (#23189898)

      I haven't written a line of code in C or C++ since I started with C#

      That says nothing about those languages. All that says anything about is your job.

      I write drivers, so I could make the opposite statement. Doesn't say anything about the relative merits of one language versus another though. All it says is that I'm in an environment where C makes more sense.

      In summary: A hammer is best when your problem is a nail, and a screwdriver is best when your problem is a screw.

  • Dying...not hardly (Score:5, Insightful)

    by PalmKiller ( 174161 ) on Thursday April 24, 2008 @04:39PM (#23189026) Homepage
    I know I am gonna get flamed for this, but they said web programming, like its the only game out there. Sure its not web 2.0 friendly, and sure most web script kiddies don't use it...mainly because it don't hold their hand, but its far from dead when your are needing to squeeze every last ounce of power out of your hardware, or even that other 25-30% of it.
  • by Noodles ( 39504 ) on Thursday April 24, 2008 @04:41PM (#23189048)
    I develop desktop application software. Right now I wouldn't think about using anything else but C++.
  • Wow (Score:3, Funny)

    by ucblockhead ( 63650 ) on Thursday April 24, 2008 @04:43PM (#23189080) Homepage Journal
    Down 0.77% in a year? Alert the presses!


    Almost as bad as Jeff Atwood and Joel Spolsky calling them "dead languages" on their new podcast.

  • by SilentTristero ( 99253 ) on Thursday April 24, 2008 @04:46PM (#23189136)
    For image processing (film/video), real-time audio or any serious signal processing, the overhead of anything but C/C++ is killer. It'll be news when Adobe After Effects or Autodesk Flame is rewritten in python.

    Besides, measuring the popularity of a language by the size of its web presence is the worst kind of fallacious reasoning.
    • by jameson ( 54982 ) on Thursday April 24, 2008 @05:18PM (#23189610) Homepage
      Hi,

      Yes, some things need to be done in assembly or C in order to `stay competetive' or even just to remain within the realm of the possible. How much that is depends on your application and your platform.

      So, systems programmers, you need not worry, your skills are always going to be needed for something.

      But let's be honest here, 80% of the applications you can code entirely in Haskell or Prolog or Python or whatever fancy high-level language you may personally have come to love. And of the remaining 20%, you can usually still code 80% of the application in your favourite language and optimise the core 20% in C. (After profiling. Let me repeat that, AFTER profiling.)

      Will it run faster and in less memory if you do it all in C? If you do it properly, sure. But that's not the question to ask. If you work commercially, ask for `what will be most profitable in the long run, while remaining ethical'. If you work free software projects, ask for `what will benefit people the most'.

      Don't confuse the above questions with `what will satisfy my C(++) hacker ego the most'. And remember that it's not just about getting the code working and making it fast, it's about making the code robust; and in many cases it's also about making the code readable for whoever will maintain it after you.

      Apologies for this rant; feel free to mod it down if you so desire, but you, dear fellow programmers, have had it coming for quite a while, as did I.
  • by jythie ( 914043 ) on Thursday April 24, 2008 @04:48PM (#23189170)
    I could actually see C++ slowly going away over the next decade as it is replaced by other languages that fill the same needs but better. C on the other hand is probably going to be around for a long, long time.
  • Statistics (Score:5, Insightful)

    by Anonymous Coward on Thursday April 24, 2008 @04:48PM (#23189172)
    Measuring by internet web pages mentioning it? Can you say, "worthless statistic," kids? I write code that controls hardware. You bet it's C++. I write code that's IN the hardware. An interpreted language? Are you out of your damn mind? Do I blog about it? Don't be absurd. Am I generating "web presence" for it? Only on slashdot. Go away useless statistic.
  • by ThePhilips ( 752041 ) on Thursday April 24, 2008 @04:55PM (#23189294) Homepage Journal

    What I love about such studies is that they can confirm any theory you want.

    Truth remains that every particular market has requirements which dictate selection of languages.

    I doubt that telecom industry (as it is right now) would ever get over C or C++. Just like kernel or system libraries in anything else but C.

    If you look at rise of Web - and pleiades of supporting it languages - then both C/C++ are out of question of course. Though again I can hardly imaging Apache or MySQL or PHP being written in anything else but C or C++.

    Market for system and telecom programming is definitely shrinking - and consequently their languages. Other markets are now blooming - and their languages are becoming more popular.

    My point is that the languages are complementing - they are not competing. After all you have to write hardware, firmware and OS first. Only then your beloved automated garbage collection has possibility to kicks in.

  • by Froze ( 398171 ) on Thursday April 24, 2008 @04:55PM (#23189298)
    those who can code in binary and those who cant code.

    OK, kidding aside.

    There are those who write code so that a person can do something on a computer. In which case the users are comparatively slow and the high level languages give you a distinct advantage in development.

    Then there are those who write code to make the computer do something, in which case the low level languages give you the ability to more effectively optimize how the computer interacts with itself, this is where languages like C, C++ really come into their own.

    In the early days of computing it was all about the later, now its much more about the former, but the later will never go away. So the decrease is reasonable and IMHO does not represent a failing of the language, just a shift in the way computers are being used. I will be very surprised if the high level languages ever get widespread acceptance in the areas that require computational efficiency, ala computational physics, protein folding, etc.
  • Fortran! (Score:4, Informative)

    by frogzilla ( 1229188 ) on Thursday April 24, 2008 @04:57PM (#23189330)
    Fortran has been dead for ages but we still use it everyday on a variety of architectures. I know we're not the only ones. Many scientists still use it.
    • Re: (Score:3, Funny)

      by Digi-John ( 692918 )
      FORTRAN is fast as hell and lots of scientists know it already, so yeah, it's still got a lot of use over here in scientific computing. Software packages like LINPACK have been tweaked for decades to get really high performance. The thing is, people in scientific computing are less likely to sit around blogging and posting on /. (I'm an exception, it seems) so their languages (FORTRAN and C, maybe some C++) don't get as much coverage as stuff like Ruby on Rails where you get 5 million postings on Digg every
  • Absolutely (Score:5, Funny)

    by DoofusOfDeath ( 636671 ) on Thursday April 24, 2008 @05:10PM (#23189492)

    Are C and C++ Losing Ground?

    Yes, but on the bright side, they lose ground about 1.5x faster than Java in most applications.

  • by Sarusa ( 104047 ) on Thursday April 24, 2008 @05:14PM (#23189556)
    We have certainly replaced C/C++ with Python wherever we can. This is about 90% of our software. Except where C is absolutely needed (which is mostly just in our kernel/device driver stuff), the 10x faster Python development and far easier code maintenance just outweighs everything else. That the Python is much less prone to crashing for programs beyond tiny one-offs is another big positive (yes, yes, if you write perfect C/C++ and don't use glib you'll never crash either, but in practice this never happens).

    In practice the speed difference doesn't matter for almost every application we've run into - we have a high speed network load tester in Python, which sounds ridiculous, but it works and it makes it insanely easier to add new tests or behaviors. If we ever hit a bottleneck, we just write a small C extension module and call that from the Python.

    I'm saying Python here, but insert your higher level language of choice.
  • bandwagonism (Score:5, Insightful)

    by epine ( 68316 ) on Thursday April 24, 2008 @05:16PM (#23189584)
    I wouldn't say C or C++ is losing ground. They both continue to serve well in the niches they established.

    Meanwhile, other segments of the pie are expanding, and few of these new applications are coded in C or C++. Does that mean C and C++ are losing ground?

    There is no language out there that serves as a better C than C, or a better C++ than C++. The people who carp about C++ reject the C++ agenda, which is not to achieve supreme enlightenment, but to cope with any ugly reality you throw at it, across any scale of implementation.

    For those who wish to gaze toward enlightenment, there is always Java. Enlightenment is on the other side of a thick, protective window, but my isn't the view pretty? I've yet to encounter an "enlightened" language that offers a doorway rather than a window seat. I would be first in line if the hatch ever opened.

    The problem with C/C++ has long been that the number of programming projects far exceeds the number of people who have the particular aptitudes that C/C++ demand: those of us who don't need (or wish) to be protected from ourselves (or the guy programming next to us).

    It's not economically practical to force programmers who don't have that temperament to begin with to fight a losing battle with self-imposed coding invariants. I'm glad these people have other language choices where they can thrive within the scope of their particular gifts. I don't feel my role is diminished by their successes.

    For those of us who have gone to the trouble to cultivate hardcore program correctness skills, none of the supposed problems in the design of C or C++ are progress limiting factors, not within the zone of applications that demand a hardcore attitude toward program correctness.

    It's the natural order of things that hardcore niches are soon vacated by those unsuited to thrive there, leaving behind a critical core of people who specialize in deep-down nastiness.

    For example, it's not just anyone who maintains a root DNS server. I can say with some assurance that the person who does so did not earn his (or her) grey hairs by worrying about whether the implementation language supported automatic GC.

    Let's take a metaphor from the security sector. Ten years ago, a perimeter firewall was considered a good security measure. This measure alone eliminated 99% of TCP/IP based remote exploits.

    These days, most exploits are tunneled through http, or maybe I'm behind the times, and the true threat is now regarded to be some protocol tunneled within http.

    Then some genius comes along and says "in the security sector, TCP/IP defenses are losing ground". Quoi? Actually, no one is out there dismantling their TCP/IP based perimeter firewall. It's continuing to do the same essential job as ever.

    It's only the bandwagon that has picked up and moved camp. Yes, garbage collection and deep packet inspection are now all the rage. So it goes.

    Why not go around saying that sexual reproduction is all the rage these days? Would that imply we could eliminate all the organisms that reproduce asexually, and the earth's ecology would continue to function? Hardly.

    These new languages are soaking up much of the new code burden because these language are freed from having to cope with the nastiness at the extremes (small and large) that C/C++ have already taken care of.

    I would almost say that defines a success criteria for a programming language: if it removes enough nastiness from the application space, that the next language that comes along is free to function on a higher plane of convenience. C/C++ have both earned their stripes. Which of these new languages will achieve as much?
  • So what? (Score:5, Insightful)

    by menace3society ( 768451 ) on Thursday April 24, 2008 @05:21PM (#23189680)
    FORTRAN, Lisp, and Cobol have all lost ground. BASIC and Pascal used to be the big dogs instead of also-rans, and if Ada ever had any ground in the first place, it lost that.

    Even Perl isn't as popular as it used to be, now that other languages have started to fill its niche.

    Times change, and it should be unsurprising that the dominant programming languages change along with it. Some day, Java, PHP, Visual Basic, Python, and Ruby will all be obsolescent as well. Thirty years ago, computers were vastly different than they are now. In another thirty years, there will have been another quantum leap (intended) in computing. Why should the languages we program them with remain the same?
  • by SpinyNorman ( 33776 ) on Thursday April 24, 2008 @05:32PM (#23189830)
    There's nothing to stop you from exclusively using reference-counted smart pointers and garbage collection in C++, for some or all of a project, if that's really your thing.

    For me, C++ destructors (each object responsibe for it's own storage) remove most of the hassle of freeing storage, and I've never hankered after garbage collection.
  • Anecdotal experience (Score:3, Interesting)

    by raw-sewage ( 679226 ) on Thursday April 24, 2008 @05:38PM (#23189966)

    I've been in the "real world" for about six years now, after graduating with a computer science degree. I'm currently in Chicago, Illinois, USA. I've spent the past several months looking for a good software engineering job, both in the Chicago and Milwaukee (Wisconsin) areas. Just from this experience, my take is that Java and C#/.NET technologies are hottest right now.

    My first job was using C and C++. This was partly due to historical reasons (the application was about 12 years old), but also because the API for the platform was only in C. Shortly before I came in, and during my tenure there, we were trying to move more towards C++ and build a more object-oriented framework. My current position is at a high-frequency trading firm. All our software is custom and mostly C++ (some C here and there, and a handful of Perl to glue things together).

    So based on this experience, when I was looking for a job, I was focusing on C/C++ positions. What I found is that there aren't a lot of people looking for C/C++ developers. In Milwaukee, virtually all of the demand for C/C++ programmers was for embedded systems. In Chicago, there was little demand for experience in those languages outside of embedded systems and the finance industry (which I was/am trying to get out of!).

    This is just my casual observation of a relatively small portion of the software engineer landscape as a whole.

    On top of a diminishing demand for C/C++ programmers, I found that quite a few companies who were looking for Java/C# programmers wouldn't even consider C/C++ people. The languages aren't all that different, and the concepts should definitely be portable. I think knowing concepts, understanding programming ideas/patterns, problem solving, etc, are more important that knowing the specifics of a particular language. Shrug.

  • by radarsat1 ( 786772 ) on Thursday April 24, 2008 @06:18PM (#23190686) Homepage
    I'd _like_ to stop using C++, frankly, but I don't seem to have a choice. A lot of my work depends on real-time capability, the kind of speed that is still only really possible on natively compiled languages that don't do dynamic typing.

    I don't even mean hardcore real-time mechanical nano-second control of knife-wielding deathbots, just simple, This Must Run As Fast or Faster Than The Rate At Which It Will Be Converted To Analog. Python and Java still don't replace C in this area. (Mainly audio, video, and high-speed mechanical control.) And when it gets complex and you need to get into object oriented models to simplify the programming, there is unfortunately no real alternative other than C++. Combine this with that fact that there are a bunch of great libraries out there written in C++ that would be very difficult to replace, and you're stuck with it.

    (I sort of oscillate between liking C++ and hating it, but I'm preferring straight C more and more these days. But like I said, I don't always have the luxury of choice, depending on what libraries I need to use.)

    All these other languages mentioned (Java, Python, Ruby, PHP, Perl, etc) do not compile to native code, and all do dynamic memory management. Hell, that's exactly what makes them *good*. But unfortunately they're not so good for real-time tasks.

    For real-time, you need deterministic memory management, and native speed. I've been looking at some other languages that compile to native code these days, like D [digitalmars.com], or Vala [gnome.org], but I haven't really decided yet whether I can start using them on serious projects.

    I'd really like to learn more about functional programming in this area, too, but there seem to be very few functional languages that are designed for real-time. FAUST [sourceforge.net] is one, but it's only for audio.

    Anyone know any other good natively-compiled languages that actually have well-implemented modern features?

    I wish it were possible to have a compiled version of Python, for example, but there are many dynamic features it depends on. (Some stuff could be done in Pyrex, which is a pretty cool little project, but so far I've only used it to make bindings to C libraries.)
  • by CoughDropAddict ( 40792 ) * on Thursday April 24, 2008 @06:31PM (#23190892) Homepage
    I am a die-hard C and C++ advocate. I consider it a high priority to make sure that the JVM and .NET aren't the de facto future of all computing, which seems like more and more of a risk when you see things like Singularity OS [wikipedia.org], which is an OS where all application code must be managed code. These managed code people go nuts and think that everything should be managed.

    The current generation of managed code VMs clearly have some benefits. But but they fall far short on some of the key properties that make C and C++ so powerful. Even if I grant you that the JVM and .NET have caught up to C and C++ in speed (which I still don't believe has been demonstrated), it's undeniable that
    • VMs have comically bloated memory footprints: between 2x and 30x comparable C programs according to benchmarks: JVM [debian.org], Mono [debian.org]. Even if you consider memory cheap, smaller is always better because it means fewer bits flying over the bus and better cache utilization.
    • VMs stop the world to do garbage collection. Point me to all the articles you want that explain how "it's getting better" and "they've figured out how to make it real-time," but that doesn't change the fact that you're stopping all threads whenever you garbage collect, which is making your latency suffer.

    C and C++ are the only game in town for getting the best performance and a small memory footprint and the ability to have the lowest possible latency.

    That said, I think that C and C++ are becoming harder to justify when you consider the havoc that memory errors can wreak. It's highly embarrassing to vendors and damaging to their customers when a buffer overflow exploit is discovered. malloc and free, even when used correctly, can still have some forgotten downsides like the memory fragmentation that was discovered in Firefox 2 [pavlov.net], and took some very smart people a lot of work to address.

    What I would like to see is a language that gives the benefits of C and C++ (extremely fast, extremely small memory footprint, and no GC pauses) but that is also immune to C and C++'s weaknesses (memory corruption, memory leaks, memory fragmentation). Yep, I pretty much want to have my cake and eat it too. Why do I think this is possible? I think that the future is to have a fully concurrent, compacting GC. Everyone's telling us we're going to have more cores than we know what to do with soon, right? Well why not use all those extra cores to do GC in the background? Even if it's more expensive on the whole, we barely know what to do with all those extra cores as it is. With this strategy, you could get the performance guarantees and low overhead of C and C++ (on the real, non-GC thread, that is) without having to give up GC or suffer from memory fragmentation.

    I'm also not willing to give up the option of dropping to C or C++ (or even assembly language) when it's justified. Mention JNI in a room of Java people and observe them reel in horror -- it's culturally shunned to deviate from "100% pure Java." Maybe this is a good value when you're on a big team of people writing a web app, but for systems and multimedia programming this is silly -- inner loops are inner loops, and some of them can benefit from machine-specific optimization.

    Theoretically you could experiment with the fully concurrent GC using an existing language/runtime like Java, but I've sort of given up on the JVM and .NET communities, because they have empirically demonstrated that they culturally have no regard for small memory footprint, low overhead, short startup time, etc. They just don't consider huge memory footprint or ridiculous startup times a problem. This is not to ment

Real Programmers don't write in PL/I. PL/I is for programmers who can't decide whether to write in COBOL or FORTRAN.

Working...