Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Programming

Is C++ More Popular Than C? 142

Last month TIOBE announced its estimate that the four most popular programming languages were:

1. Python
2. C
3. C++
4. Java

But this month C++ "overtook" C for the first time, TIOBE announced, becoming (according to the same methodology) the #2 most popular programming language, with C dropping to #3. " C++ has never been that high in the TIOBE index," says TIOBE Software CEO Paul Jansen in the announcement, "whereas C has never been that low."

1. Python
2. C++
3. C
4. Java

C++ started a new life as of 2011 with its consistent 3 yearly updates. Although most compilers and most engineers can't take up with this pace, it is considered a success to see the language evolve.

The main strengths of C++ are its performance and scalability. Its downside is its many ways to get things done, i.e. its rich idiom of features, which is caused by its long history and aim for backward compatibility.

C++ is heavily used in embedded systems, game development and financial trading software, just to name a few domains.

There's different rankings from the rival PYPL index of programming language popularity. It lumps C and C++ together to award them a collective ranking (#5). But unlike TIOBE, it shows Java [and JavaScript and C#] all being more popular (with Python still the #1 most popular language).

Of course, statistical anomalies could be also skewing the results. Visual Basic also lost two ranks in popularity in the last month, according to TIOBE, dropping from the #7 position to the #9 position (now falling just behind Go and SQL). This becomes the first time that Go has risen as high as #7, according to TIOBE's announcement — with Rust also reaching an all-time high of #17...
This discussion has been archived. No new comments can be posted.

Is C++ More Popular Than C?

Comments Filter:
  • by crow ( 16139 ) on Saturday June 15, 2024 @09:40PM (#64552419) Homepage Journal

    If you look at job postings on LinkedIn, you'll see vastly more C++ jobs than C jobs.

    • C jobs are more common for embedded work. Unless you're searching for that kinda work, you won't see those ads.

      But the most likely explanation for the TIOBE index is people clicking on both C and C++.

      • Re:Yes (Score:4, Informative)

        by 93 Escort Wagon ( 326346 ) on Saturday June 15, 2024 @10:38PM (#64552487)

        C is like perl - when its coders can't figure something out, they don't do a web search - they hop onto some IRC channel that's been running continuously since 1994, and ask there.

    • by Kisai ( 213879 )

      The "evolution of C++" could be described as major blunders and mis-steps, the same ones that Python, PHP, Perl, Java and even Javascript have been doing, and all of those have been repeating the mistakes of C++.

      A programming language needs to be as backwards compatible, FOREVER, otherwise it's a DEAD language. You can not demand that programmers rewrite 20, 30, 40 years of programming just because the idiots in charge of the standard decided to change the function named "strcpy". If you want to change the

      • by hjf ( 703092 )

        To be fair, Javascript hasn't broken compatibility since it was invented. It drags the quirks it has had since the beginning where 0=="0" and "0"==0 give different results. What has changed is that some runtimes (node) have dropped support for the things those same runtimes invented in the first place.

        Python, on the other hand, keeps breaking things for the sake of breaking things. Python 3 is fundamentally incompatible with python 2, and major dot releases are only mostly compatible. The problem is that de

        • Is there any reason you can't use an HAOS VM ?

          • by hjf ( 703092 )

            first of all, basically that the only VM solution that works on FreeBSD is VirtualBox and it breaks with every FreeBSD dot release as it relies on a kernel module. So with every freebsd upgrade I need to rebuild VirtualBox from source, and lock the package to prevent upgrades. It's very slow and annoying. The solution proposed by FreeBSD, bhyve, does not work. It's an abandoned piece of software that can only run by freeBSD gurus. I've requested support many times on "how do i run a linux vm" and have never

  • Parsing Bug (Score:5, Funny)

    by martin-boundary ( 547041 ) on Saturday June 15, 2024 @09:43PM (#64552423)
    Sorry guys, last month we incorrectly parsed "C++" as "C" and "++", our bad!

    ;-)

  • downside (Score:4, Insightful)

    by phantomfive ( 622387 ) on Saturday June 15, 2024 @10:12PM (#64552467) Journal
    The downside of C++ is not the many features, features are fine. It's not the backward compatibility, backwards compatibility is fine.

    The problem with C++ is the un-intuitive design that leads to many pitfalls that are easily fallen into.
    • Re:downside (Score:5, Informative)

      by ShanghaiBill ( 739463 ) on Saturday June 15, 2024 @11:07PM (#64552513)

      The problem with C++ is the un-intuitive design that leads to many pitfalls that are easily fallen into.

      In the early 1600s, the Puritans brought cows to the Plymouth Colony, and the cows soon wore paths between their barns and pastures. When walking between their fields, farmers used the same paths. As the settlement grew, more houses were built along the paths, and the paths were widened to accommodate wagons. Soon, larger buildings were constructed along the same roads, and the roads were paved for automobiles. So when people wonder why the streets of Boston are such a mess, it's because the layout of the streets is based on where cows walked 400 years ago.

      C++ was designed the same way.

      • You have to give those cows credit though, because Boston roads were designed better than Los Angeles roads.

    • The two aren't separable.

      The upside of C++ is it's strong source compatibility with C. You can take an old C project and slowly upgrade piecemeal without a rewrite making it shorter, simpler and less buggy by slowly introducing C++

      https://m.youtube.com/watch?v=... [youtube.com]

      Also closely related is it's backwards compatibility. Code I wrote and debugged in 2003 still works and I still use it.

      But that leads to the design. The design is only intuitive if you understand C well, and the whole design and ongoing changes to

      • The two aren't separable.

        Well that's a lie. You can have intuitive design while still maintaining backwards compatibility.

        Also closely related is it's backwards compatibility. Code I wrote and debugged in 2003 still works and I still use it.

        Yeah, C++ deserves a lot of credit for backwards compatibility. Many other languages should learn from that. As Doug Crockford said, "a backwards-incompatible change is an act of violence." (paraphrased). So 10 points to C++.

        The design is only intuitive if you understand C well, and the whole design and ongoing changes to C++.

        No that's not true at all. For example, operator overloading is a cool feature and a good idea in some cases, but it's a mess in C++ due to poor design. That has absolutely nothing to do wit

        • Ok, well to continue this conversation let it be noted I'm arguing with the kind of fuckwit who can't grasp the difference between a lie and a difference of opinion.

          Anyway as expected you haven't actually backed up your opinions with anything, so there's no conversation to be had.

          • Anyway as expected you haven't actually backed up your opinions with anything,

            You said that it's impossible to create new features in C++ without unintuitive design. You didn't explain why you think that.

            • You called me a liar for having that opinion.

              No one has managed what you claim is possible. There's C++ and over the last 30-years an almost endless stream of contenders. None of them have managed almost complete C source compatibility work an "intuitive" design.

              You are claiming that something which guess not exist is possible, provide no evidence that it is possible and call naysayers "liars".

              How about you take your stupid opinions and piss off?

              • How about you take your stupid opinions and piss off?

                Oh, now you're angry. Anger let's people manipulate you.

                None of them have managed almost complete C source compatibility work an "intuitive" design.

                Really? You really 'believe' that?

                • Oh, now you're angry.

                  Not especially, you snivelling wankstain, I just see no reason to be anything other than utterly rude to you since you decided to open with calling me a liar for having a different opinion.

                  Naturally you cannot provide any evidence of your supposed intuitive design, which you called me a liar for not knowing about.

                  Turns out you're another boring, blowhard tosspot with many opinions and little intelligence.

                  • Look at the bright side. You were either lying or ignorant, and I assumed naturally you are not ignorant.
                    • Oh right I see you are too stupid to have an actual argument so you go straight for accusations of lying.

                      Ugh why do I keep engaging with morons who cannot provide a single shred of evidence or reasoning to back up their arguments?

        • by _merlin ( 160982 )

          For example, operator overloading is a cool feature and a good idea in some cases, but it's a mess in C++ due to poor design. That has absolutely nothing to do with C.

          Why exactly do you think it's a mess in C++? It has a few pitfalls:

          • Overloaded operator && and operator || lose their short-circuit characteristics. Fixing this would require somehow splitting it into two functions, so one can be called to evaluate the short-circuit condition before the argument to the other are evaluated. That woul
          • C++ can do a lot of super-useful things and a lot of incredibly stupid things. (Please don't make operator-> do network IO.) Telling which side of that line a particular idea falls on is what you get from experience.
          • You started listing the pitfalls of overloaded operators.
            • by _merlin ( 160982 )

              Yes, because it's a useful feature with a short list of well-known and easily-avoided pitfalls. Once again, how would you improve the design? Would you just make it impossible to overload the unary &, && and || operators?

              Issues with confusing behaviour caused by implicit conversions between pointer, integer an Boolean types are inherited from C, but the situation has been improved in recent updates to the language standards.

              It would have been nice if explicit cast operators and constructors we

              • Once again, how would you improve the design? Would you just make it impossible to overload the unary &, && and || operators?

                Ruby has a much easier approach with fewer pitfalls, for example.

                For better or worse, a bunch of things in C++ are the way they are because that's what Cfront did, and what Cfront did effectively was the standard (similar to Perl 5 which had an official policy of, "When the interpreter and the documentation disagree, the interpreter is correct," and the current situation with Rust where there isn't a formal standard and the reference implementation is considered "correct" by definition). That's how we got things like SFINAE.

                Ok, well now you are explaining why C++ is a bad design, but that's agreeing with me. My point was that C++ is bad design.

                • by _merlin ( 160982 )

                  Ruby has a much easier approach with fewer pitfalls, for example.

                  Ruby's operator overloading works the same way as C++ using member function operator overloads. It just doesn't allow overloading a bunch of operators (e.g. &, &&, |, ||, ~ and () can't be overloaded) and it has a two-argument [] overload to handle assigning to an index differently from obtaining a value from an index (i.e. x[i] = y calls a different operator to y = x[i]). It isn't a different design at all.

                  You could add a separ

    • by Jeremi ( 14640 )

      The problem with C++ is the un-intuitive design that leads to many pitfalls that are easily fallen into.

      Right, but the un-intuitive design is a direct consequence of having so many features and a mandate to maintain near-100% backwards compatibility across 45 years of evolving language and library design.

      Or to put it another way: it would be possible, in principle, to take C++, chop out all the backwards-compatibility cruft and unsafe or no-longer-considered-best-practices misfeatures, and declare the result to be a new language that would have most or all of the power of C++ with none of the sharp edges. T

      • Right, but the un-intuitive design is a direct consequence of having so many features and a mandate to maintain near-100% backwards compatibility across 45 years

        No, that is false. It is an excuse you believed for some reason.

        C is elegant design. C++ is crap design. Pretending that the crap design was necessary because of "backwards compatibility" doesn't even make sense, I don't understand why you believe that.

        • by Jeremi ( 14640 )

          Pretending that the crap design was necessary because of "backwards compatibility" doesn't even make sense, I don't understand why you believe that.

          You misunderstood. The implementation of the crap design wasn't necessary -- a better standards committee might well have produced a better design. Unfortunately, they didn't.

          But once the crap design was finalized and widely adopted, the preservation of the crap design became necessary, because once a large number of people have written software that relies on C++ working a certain way, to break all that code would be language suicide.

          And that's why C++ remains difficult and error-prone today. Even if ev

          • But once the crap design was finalized and widely adopted, the preservation of the crap design became necessary,

            That doesn't need to get in the way. For example, friend was basically deprecated and no one uses it anymore, so it's still there (good!), but it doesn't prevent good new design.

            • by Jeremi ( 14640 )

              That doesn't need to get in the way. For example, friend was basically deprecated and no one uses it anymore, so it's still there (good!), but it doesn't prevent good new design.

              I'll give you an example of the problem.

              An infamous C++ design mistake was made in the implementation of std::vector<bool>. The implementers thought they'd be clever and save memory by storing each boolean value in a single bit rather than wasting an entire byte on it. They did that by implementing special proxy-logic code for the bool & operator[size_t] operators for that that one type, and succeeded in reducing memory-usage -- but also in making std::vector<bool> behave differently from

              • You can deal with it the Java way, and just replace Vector with a new construct like ArrayList, without removing the old Vector.

                Or you can do it the C way, and just emit a compiler warning every time someone uses std::vector with a bool. In C it's with the gets() function. gets() has been there for 40 years, but no one uses it. No need to remove it.

                I'm sure there are other ways of dealing with it.
  • by Mr. Dollar Ton ( 5495648 ) on Saturday June 15, 2024 @10:34PM (#64552485)

    Unless you're a limp one-language trick, you learn to write reasonable code several languages quite early in your career and then you just add more.

    I don't know what car analogy is there, maybe defining your auto mechanic skills by the brand of wrenches you use.

    Who does that?

    • I wish I could choose the programming language I use. I have strong preferences. Unfortunately, I never get to use the language I want because I want to get paid.
    • "Reasonable" code? (Score:2, Insightful)

      by Viol8 ( 599362 )

      I hate to break the news to you my friend but a lot of employers want a lot more than "reasonable" code particularly in aerospace and defence where I've worked (where admittedly is usually more a case of Ada and restricted versions of C than C++) so you won't get away with moderate knowledge of a language, you need to be absolutely on point.

      "the brand of wrenches you use."

      C++ is not a wrench, its more like a full workshop including OBD diagnostics and it literally will takes years to get up to proper speed

    • by dvice ( 6309704 )

      If you are starting a project with budget of 10 million dollars or more and it is estimated that the project will be online for a decade or two and there are other requirements for the projects also, do you care what language you use in the project?

      You need to worry
      - Where do you get the developers for the project?
      - Where do you get new developers after a decade?
      - Is the language active after a decade? Does it get security updates?
      - Does the language have license costs or legal issues?
      - Does the language wo

      • Yes, you need to worry about many things, and most of the things you need to worry about are quite tangential to the "popularity" of the language today as measured by the number of Google searches of the language name in the past month.

  • Again? (Score:3, Insightful)

    by alantus ( 882150 ) on Saturday June 15, 2024 @10:50PM (#64552495)
    Couldn't care less about this Tiobe thing, it's a very flawed method to measure language popularity.
    Anyone who makes any kind of decision based on this is out of his mind.
    Who keeps submitting this?
    • Anyone who makes any kind of decision based on this is out of his mind.

      The TIOBE index is flawed but is a rough measure of popularity.

      Popularity is important when choosing a language. The more popular a language is, the easier it will be to hire proficient programmers. There will also be more libraries, documentation, and support available.

      Also, there are reasons why unpopular languages are unpopular. I've worked with Ada, Ruby, and Haskell. I am very happy to watch them die.

      • The more popular a language is, the easier it will be to hire proficient programmers.

        And it will be even easier to hire bad programmers, because the market is saturated with them.

        • You can find bad programmers for any language.

          • Maybe. I would expect, and yes that is purely subjective and speculative, that the proportion of "bad" coders is higher with more popular languages. For instance I would feel much more confident hiring a Lisp developer than a JavaScript developer. Reasons are variations of the fact that one language is more accessible (if anyone can use it, then any idiot can use it).

      • by vadim_t ( 324782 )

        It's not flawed, that would imply it does an overall sane thing but in a way that's not quite right. TIOBE is not even wrong.

        They just look at an arbitrary number returned by some search engines then apply ill-defined fudge factors.

        Problem is, Google results have little to do with actual usage. Somebody had a spat and duplicated a Wiki? Language got more popular! Popular site dropped off the net? The reverse. A programming language takes the absolutely trivial step to maximize of "$LANG programming"? Sudden

  • > The ratings are calculated by counting hits of the most popular search engines. The search query that is used is
    > +" programming"
    > The number of hits determines the ratings of a language

    So, what they are saying is that python has the most number of people posting online for help on how to do basic stuff.

    • Should have read +"{language} programming".

      Always forget that SL can't post angle brackets in comments.

      • &lt; and &gt; produce < and >

        &amp; to produce &

        Slashdot supports a few other named HTML entities, not sure if there is a list. &mdash; for — and &ndash; for – are the only ones that come to mind ATM.

  • Eat your heart out, Linus Torvalds!

    :)

    • No, Linux did have an inkling of what he was doing. Programmers do not want to hear it but C++ is on a downward slope. The problem being it is an inherently insecure language with possible buffer overflow and memory type exploits that remain a possibility within the C++ world. It's a needless liability for companies when there are much more secure languages arriving (aka rust). Lawyers will be able to litigate that these new languages are not being used if there happens to be a bad data breach!

      Companies are

  • LOL Thanks for that. Now I know how far to trust these results
  • by jd ( 1658 )

    A language that evolves fast has, by definition, both constructs that were poorly thought-out and a lack of constructs that developers actually need.

    Since backwards compatibility is built-in, it also has a vast amount of cruft. And this is the really bad part. That cruft will include constructs that are rarely, if ever, used, so are rarely, if ever, tested. It also has to handle an ever-increasing number of cases, which means the compiler is more complex (so will contain more bugs) and will be slower (impac

    • Re:Hmmm. (Score:4, Interesting)

      by serviscope_minor ( 664417 ) on Sunday June 16, 2024 @05:50AM (#64552785) Journal

      I'm going to dispute most of this. C++ isn't perfect but...

      C++ hasn't evolved fast. If anything it's been pretty slow, especially the painfully long 98 to 11 gap. It's now 45 years old, old enough to be the parent of some people with "senior" job titles.

      C++ doesn't have vast amounts of "cruft" as you call it. It certainly has rarely used features, but they are things that you absolutely need but rarely and that serve as foundations.

      If you are using volatile a lot, or lock free concurrency constructs a lot, or manual memory allocation a lot, poor explicit lifetime management a lot, then you are likely doing something wrong. But you need all of those in the language because without low level constructs you cannot build the higher level ones. They should all generally be wrapped and rarely seen floating in the wild, but you still need them.

        So I challenge you, find some features which fit the mould of "cruft" especially ones that have complex interactions that cause problems and for which there is a reasonable alternative.

      Many many attempts have been made to "overhaul" C++ without keeping compatibility. Many have failed, some have succeeded in their own right but very very few have even managed to scratch the domains where C++ is very good.

      If it's not compatible in some way, then you lose the advantage of decades of very vert solid libraries. So really it has to offer something more than a temporary cessation of "cruft".

      But no, I disagree that C++ is massively over engineered.

      • It came a long way from making sure the first arguments in a C function was a pointer to your context. I hate to say it, but your right. It takes a while to obsolute functions. It took till, er I think C++20, that volatile was finally obsoleted now that we have std::atomics. That's really what has being going on is moving all the low level stuff into the library so you just need to modify the library rather than the compiler for this stuff.

        Still, kind of wish there was some clarification on what const
    • by gweihir ( 88907 )

      Agreed. When C++ was designed, nobody expected it to be used as a general purpose language. Oh, and look, it is not. For example, things like inefficient virtual function dispatch are a dead giveaway that it is not even a proper OO language. Another is the general non-orthogonal nature of visibility, which is screwed up to an impressive level. There are more. This is a complex, hard to handle monster with surprises in too many places and it should never have seen the light of day.

      My take is the only reason

    • by Jeremi ( 14640 )

      Really, C++ needs a complete overhaul, backwards compatibility be damned.

      You're not wrong -- the only problem is, backwards compatibility with existing C++ codebases (and existing C++'s developers' brains) is the main reason for C++'s continued popularity. The beautiful shiny language that comes out at the end of your overhaul wouldn't be C++ in any meaningful sense of the word, so almost nobody would use it. (The people who would use it are already using Rust ;) )

    • C++ needs a complete overhaul, backwards compatibility be damned.

      Right, and call it "Rust".

  • by 278MorkandMindy ( 922498 ) on Sunday June 16, 2024 @06:07AM (#64552799)

    There is literally (used correctly) no way to say which is "more popular" as that term is not defined. More people using it? More downloads? More complete programs produced? (not that you could really count that anyway)

    The only important metric is if the language is still being used and evolving/being supported. This penis measuring competition is meaningless.

  • Code that makes money is not available for public consumption and thus not ranked. This list is at best the most popular languages for open source.
  • For example, a lot are things like writing firmware, drivers, high-performance software, etc. C++ is pretty unsuitable for these.

    • Re: (Score:2, Interesting)

      by Tough Love ( 215404 )

      Not a shred of truth to that. Educate yourself. [www.qt.io]

      • by gweihir ( 88907 )

        No need to educate myself. Your view is rather limited. On new designs with an all-C++ enabled development team, there may even be some truth to your reference. But that is not the standard case.

        Fact is, the C++ fans have been pushing how great their language is for everything for a long time. Nobody outside that community believes it and for good reasons. This effect can be observed with other language communities as well.

        • It is apparent that you have zero experience in this sector, which does not stop you from spewing rubbish. Embedded c++ development platforms have been popular since the early 90's.

Technology is dominated by those who manage what they do not understand.

Working...