r/technology • u/vitamin_protein_ • Dec 14 '22
Software C++ overtakes Java in language popularity index
https://www.infoworld.com/article/3682141/c-plus-plus-overtakes-java-in-language-popularity-index.html155
u/Nasmix Dec 14 '22 edited Feb 02 '26
This post was mass deleted and anonymized with Redact
mysterious unpack workable automatic gaze soup cause whole wrench resolute
45
u/insufferableninja Dec 14 '22
I don't know man, when the job calls for an impact wrench I'll use it but I'm gonna complain about how it makes my hands itch afterwards.
-1
u/Evil_killer_bob Dec 14 '22
If it calls for an impact wrench use JavaScript
5
u/ShankThatSnitch Dec 15 '22
Using Javascript is the equivalent of using Ramen noodles for repairs.
Source. I am a front end dev.
38
6
u/twitterfluechtling Dec 14 '22
Some jobs require their devs to hammer in screws or to use tha handle of the screwdriver to hammer in nails, though. It's ok to hate those jobs, or to hate the tool in that specific context.
Some tools are chocolate hammers, in those cases it's ok to hate the tool...
1
u/Nasmix Dec 14 '22 edited Feb 02 '26
This post was mass deleted and anonymized with Redact
dolls paltry price stocking outgoing dam sable seemly command late
11
u/YoYoMoMa Dec 14 '22
Real programmers
No such thing.
10
u/hibikikun Dec 14 '22
Expert Googlers
3
u/Evil_killer_bob Dec 14 '22
Last April 1st stack overflow had a banner that said they were moving to a subscription model. That was a good one.
2
u/rsta223 Dec 14 '22
Real programmers : languages are tools. Use the right one for the job.
Machine code or gtfo.
(/S. Mostly.)
2
u/DeepSpaceGalileo Dec 14 '22
There’s no programming language that’s the “right” one for the job. There are many that have trade offs and you have to subjectively decide which trade offs are most important
2
u/Nasmix Dec 14 '22 edited Feb 02 '26
This post was mass deleted and anonymized with Redact
north consist treatment reply sable detail salt march outgoing birds
1
u/DeepSpaceGalileo Dec 14 '22
Maybe? For 98% of developers the language and stack have been chosen well before they’re ever on a project
2
Dec 15 '22
There is only one language with no trade offs. It's easy to learn, it's fast, you have total control over everything. It has excellent library support as well as infinite amount of examples on the internet. It almost feel intuitive. You can write anything from a basic script, to a web application, to device firmware with it, it is C, C is the best language for every task. C is the greatest language ever, luckily I do firmware so it fits nicely there.
2
u/7h4tguy Dec 15 '22
Nah hammers and screw drivers are totally different. Languages have vast overlap. Everything can be done in modern C++, I don't need Python in my toolbox to appease ivory tower AI lecturers.
2
Dec 14 '22
I just learn languages as needed, back end through Linux passing data packets through write only corporate networks Node, want it to have an interface? Java/python….. want it to actually work? C.
-3
u/Zyansheep Dec 14 '22
I don't think that analogy works as well for programming languages as it might for engineering. Languages are tools, but they can all technically do the same jobs. Some are just faster to run or faster to write and have more thought put into creating good tooling / libraries for different applications. I think as existing and new languages progressively improve in those areas, there will eventually be a language as fast as C, easy to write as python, abstract as haskell, and customizable as lisp so as to become an excellent omnitool for all programming applications.
3
u/Fenix42 Dec 14 '22
No, not every language can do every job. C++ can really do a modern web front end just like JS cant do embedded.
We have multiple languages because we need different things for different applications.
1
u/Zyansheep Dec 14 '22
You are absolutely right that we use multiple languages because certain languages are better than others at certain tasks and make different trade-offs. Even though technically C++ can create a web uis (through webassembly), and technically javascript can run on embedded devices, most programmers wouldn't do this because these languages weren't designed with these applications in mind. What I'm arguing is that unlike a hammer (which can only be used to hit things) programming languages are much more similar to each other and eventually, given enough time, their differences will be smoothed out and there will be one language that can do all the things very well. Take for example Rust, it is designed for systems programming, but it is also used for high-performance webapps. Or JavaScript, it has its roots in the web, but then nodejs came along and brought it to the server and desktop app. The general trend looks to be for programming languages to become more general-purpose and applicable to whatever platform you decide ship your app to.
79
u/poop-machine Dec 14 '22
Dev: "I just want to split a string". C++:
auto parts = std::string_view{"Hello world"} | std::ranges::views::split(' ');
for (const auto &string : parts) {
std::cout << std::string_view{string.begin(), string.end()};
}26
u/SarahVeraVicky Dec 14 '22
My favourite part of C++ is the compiler messages.
Nothing like forgetting something in an object, only to get 100 lines of hundred or so letters long abstractions which you have to trace back.
8
u/ponybau5 Dec 14 '22
I love it when the errors don’t actually trace back to the source, but instead some random arbitrary template of the standard library.
3
u/SarahVeraVicky Dec 14 '22
Ah yes, where you have to resolve which implicitly defined specialization of about 10 different resolved layers have caused the syntax to "not be correct for that use case".
23
u/WarrantyVoider Dec 14 '22
C# be like:
string[] parts = "Hello World".Split(' '); foreach(string p in parts) Console.WriteLine(p);16
u/GregsWorld Dec 14 '22
Kotlin: *chefs kiss*
"Hello World".split(" ").forEach(::println)5
u/Asyncrosaurus Dec 15 '22 edited Dec 15 '22
The funny part is, your Kotlin is also close to a valid C# implementation. The poster above used a more verbose method.
Edit: Valid C#:
"Hello World".Split(" ").ToList().ForEach(Console.WriteLine);14
u/purple_hamster66 Dec 14 '22
As long as we’re adding other languages…
Python: for s in “Hello World”.split(): print(s)
People enjoy writing in Python because of the minimal syntactical sugar. That sugar is only needed for the really complex cases that should not exist in most applications. (IMHO, only libraries and frameworks should use these complex cases). You’re supposed to be coding, not encoding!
3
u/7h4tguy Dec 15 '22
C# could be a one liner as well by not declaring a local and moving everything to one line like you did.
-5
0
Dec 14 '22
[deleted]
9
u/drawkbox Dec 14 '22
Ah The Prestige technique.
Same with C# although StringBuilder (C#) and StringBuffer (Java) are your friend.
2
u/Asyncrosaurus Dec 15 '22
The nice thing about C#9 is the new Span<T> class lets you directly access the underlying char array, sidestepping the need to allocate new strings for most string manipulations.
0
Dec 14 '22
[deleted]
24
u/sesor33 Dec 14 '22
Java and JS are completely different languages.
0
Dec 14 '22
[deleted]
4
u/ForGoodies Dec 14 '22
only the people that actually know what you’re talking about didn’t comment/downvote
28
4
3
u/CorrectPeanut5 Dec 14 '22
I've never understood why programmers that deal with Embedded/Hardware tend to get paid less.
1
u/alexp8771 Dec 14 '22
Because the companies that make all the money are web companies. They drive up salaries industry wide.
1
u/alexp8771 Dec 14 '22
If I’m writing low level embedded code I’m using C not C++. C++ is far too bloated these days for embedded dev.
85
u/liarandathief Dec 14 '22
It might be getting used more, but it sure ain't popular
4
u/phdoofus Dec 14 '22
I came here just to say this. It might make a lot of things easier but popular it is not. It's funny to work in a startup where half the team is like 'This would be a lot better in Fortran'.
8
u/OcculusSniffed Dec 14 '22
Depends on what the team is familiar with. An experience team programming in fortran might make a better product than an inexperienced team programming in java. Every feature has tradeoffs
11
47
u/Parking-Jel Dec 14 '22
modern c++ is quite nice to use
38
u/asdfasdfasdfas11111 Dec 14 '22
C++ interviews are fucking rough though. The language is too big and there are too many ways to do simple things at this point. And depending on the interviewer, if they want to be a dick they are massive textbooks of arcane and obscure gotchas they can pull out to make basically anyone sweat.
I've been writing C++ professionally for almost 20 years and I keep up with the modernization pretty well for the most part, but I still loathe C++ interviews and coding tests.
20
u/ExceedingChunk Dec 14 '22
If the interview is set up as a "gotcha", it's a bad interview IMO.
Being a good dev is not about being a human compiler.
11
u/asdfasdfasdfas11111 Dec 14 '22
I mean as far as I'm concerned, coding tests are a waste of time for anyone except fresh grads to begin with. Yet people still use them and tons of technical interviewers are still pedantic assholes.
3
u/jimbolauski Dec 14 '22
I have a hard time knowing if candidates have 5 or 15 years of experience, there are so many rabbit holes you could go down.
1
1
u/7h4tguy Dec 15 '22
I've done my choose your own adventure language interviews (they're flexible, choose your own lang) in C++ and just knowing basic STL classes and algos has been fine. I don't buy this. They were massively impressed with my choice of lang and expertise back when.
30
u/Rizzan8 Dec 14 '22
As someone who is using C++, Python and C# daily in a project, I must say that C++ is far from "nice to use".
20
u/HAHA_goats Dec 14 '22
There is narrow subset of modern C++ that seems nice to use. But maintaining a bunch of old code from a bunch of different developers looks like an exponential nightmare.
All my experience was late 90s. I recently started dabbling at it again and it's like an entirely new language now.
2
u/TheEvilPenguin Dec 14 '22
There is narrow subset of modern C++ that seems nice to use
But does everyone agree what's inside and what's outside the subset?
6
u/BatForge_Alex Dec 14 '22
Yeah, this is kind of C++'s major language problem. Half the devs think C++ is "better" without the modern parts and just stick to the C compatibility layer
Which means they're always working with the worst parts of C++
2
u/TheEvilPenguin Dec 15 '22
I remember way back in uni (not saying how long ago that was), my lecturer for c++ saying that it's a great language as long as you stick to a logical subset of it, the problem being that everyone picks a different subset.
Another anecdote is one of my first mentors saying that he studied and worked with c++ for a few years and decided he could call himself an intermediate, then after a few more years experience decided he could finally call himself intermediate. He still thought of himself as intermediate a decade and a bit later.
0
Dec 14 '22
[deleted]
2
u/Shaky_Balance Dec 14 '22
Yeah I feel like doing best practices for most anything tech is just painful. Just goes to show how difficult the problems that they are solving are.
4
u/biliwald Dec 14 '22
As someone who is using C++, Python and C# in daily projects, I must say that C++ is the nicest of the three, closely followed by C#, and if Python died, I'd cry with tears of joy.
7
u/rdturbo Dec 14 '22
Yeah, with C++ you get structure and control. With python, everyone has their olwn way of doing things lwhich needs time figuring out.
4
u/biliwald Dec 14 '22
I can deal with personal code style and different way of doing a single thing. Every languages has that.
What I can't deal with for any sizable project is not being sure that my code is right and I didn't do a typo or something of the sort that'll only break during execution. I know that linter exists and such, but it's nowhere near a compilator for code correctness.
The other thing that makes it as I never want to work with Python for anything of importance is backward compatibility. When even minor version bump breaks existing code, you lose all credibility in my book.
4
u/homer_3 Dec 14 '22
It's a whole hell of a lot nicer to use than the nightmare that is python.
2
u/OcculusSniffed Dec 14 '22
Not a fan of python either. It's like php with Java libraries, and 3/4 of the time new runtime minor updates break the code. And now I'm applying OS updates when all I wanted to do was run some stupid pytest tests.
1
u/Shaky_Balance Dec 14 '22
Can I ask what your pain points are with C++? Even as someone who likes C++ I'm not going to deny there are a lot of them.
6
5
u/DutchieTalking Dec 15 '22
I code in plain English.
When user presses this button, open the menu. On second press, close the menu.
... I'm not a very good programmer.
1
19
u/buff_bobby Dec 14 '22
I don't know how reasonable the measuring method is with JS being so low. That does not line up with other similar lists at all.
21
18
u/i-m-p-o-r-t Dec 14 '22
C++ has risen from below and slammed Java 16 feet through an announcers table at hell in the cell.
3
11
4
Dec 14 '22
At first, java was winning, then the C++ code actually finished compiling and won the race.
13
u/snarkuzoid Dec 14 '22
I was an early adopter of C++. Lots of fun at the time, but I would not want to use it any more. Of course, I wouldn't want to use Java either.
5
u/CorrectPeanut5 Dec 14 '22
Do I love Java? No. Kotlin is better. Do I love my hourly bill rate for Java? Yes. Yes I do.
1
u/DJAXL Dec 15 '22
Trying to get back into learning programming. What makes Kotlin better in your opinion?
2
u/CorrectPeanut5 Dec 15 '22
It's easier to read and write, more concise. If you don't fight some of the default immutable aspects it's very easy. If you do the code will be sloppy.
Other options are Python if you're looking for more of a devops career, and some groovy as well.
1
u/DJAXL Dec 15 '22
Thanks for the response. I was interested in relearning programming because I do data migration and I figured knowing how to create a tool might be useful one day.
0
u/snarkuzoid Dec 14 '22
I was lucky enough to be in a position that I could pick and choose my toys. If I had to use the Java ecosystem I would go with Kotlin.
2
1
Dec 14 '22
I'm about to complete my javascript cert after completing my html/css cert. I wasn't sure what I was going to learn afterwards, but was thinking Java. What would you suggest? I'm working towards full stack application development, not restricted to web apps.
2
u/theyoungtired Dec 14 '22
Java could be fun and a cool shift in perspectives. If you wanted to go deep, and get a solid understanding of the machine itself, you could also choose a language like C++ that forces you to think about memory. Java is one of my favorites though and think it could be fun to learn!
9
u/littleMAS Dec 14 '22
The 'C' programming language and its 'dialects' are the English of the computer world. Love them or hate them, they are the lingua franca and are not going away.
10
18
u/smartguy05 Dec 14 '22
I think that's kind of funny because the NSA just put out a recommendation to not use C or C++ due to poor memory management by developers and recommends instead to use languages with garbage collection, like Java.
https://securityboulevard.com/2022/11/nsa-memory-safe-richixbw/amp/
14
u/asdfasdfasdfas11111 Dec 14 '22
Writing about memory safety in "C and C++" is kind of like writing about tool safety with "chainsaws and paintbrushes." I'd wager the vast majority of the bugs they are talking about are coming from C-style code patterns. Modern C++ is pretty good about keeping things strongly typed and scoped as long as you are following modern C++ coding guidelines.
If anything, the dangerous flaw in C++ is that you can start with a paintbrush, but if you hold it a certain way it turns into a chainsaw, so you just need to make sure that you don't do that.
4
u/ChuckyRocketson Dec 14 '22 edited Dec 14 '22
If anything, the dangerous flaw in C++ is that you can start with a paintbrush, but if you hold it a certain way it turns into a chainsaw, so you just need to make sure that you don't do that.
I lol'd pretty hard at this because it's so true. Years ago a professor of mine repeatedly told the story of how he broke his grandma's HDD on her new shiny PC when he was learning C and C++ in the 90s. To give him credit, he also helped program the old game "Star Trek: ConQuest Online", was given thanks for "Ring of a Thousand" in Diablo II, engineered the racing engine in a NASCAR game, among other things.
3
u/smartguy05 Dec 14 '22
Their security complaints seem to be 100% about bad practices, not the language itself.
1
u/jimbolauski Dec 14 '22
Smart pointers have cleaned up most of the memory management issues in c++.
1
u/RandomRobot Dec 14 '22
Funny example you chose because C# can leak memory when you do not explicitly dispose of System.Drawing.Pen
32
u/ThrowawayusGenerica Dec 14 '22
Languages with memory safety, not garbage collection. And their first recommendation was Rust.
4
2
2
2
u/wkrick Dec 15 '22
I see people arguing in the comments but the language differences between C++ and Java aren't really what's driving this.
The reason that the popularity of Java has been steadily falling over time is due to the uncertainty created when Oracle purchased Sun and acquired Java.
Since then Oracle has been steadily increasing restrictions and tightening their grip in an attempt to extract profit out of the Java ecosystem.
A few years after the Oracle acquisition, the company I worked for started planning their long-term strategy to migrate away from Java (mainly web applications) wherever possible specifically because of actions taken by Oracle with regards to licensing and audits.
This was also around the time that "JavaScript all the things!" was really starting to take off, so it was a natural transition.
1
u/Prick_in_a_Cactus Dec 17 '22
Oracle already sued eclipse over the use of "Javax". Eclipse had to change the name of Javax to Jakarta in order to avoid further leg costs. I think they made some other changes but I don't know what they were since it wasn't related to an issue I was having. I believe they are now in the clear?
4
Dec 14 '22
When will assemblers with macros be popular again ?
1
u/Capt_Blackmoore Dec 14 '22
probably the same time we're back to trying to fit software in 640K
Sure, back in the '70s we didnt have good tools (for writing in a higher level then compiling to work on a 6502) but at the start of all that we didnt even have a system that we could run it on. and by the 80's we did. and by 90 it no longer made much sense to program in ASM for any reason.
2
Dec 14 '22
It was 64K in CICS. And overlays.
2
u/Capt_Blackmoore Dec 14 '22
I was around when we were trying to fit shit in 16K, and piggybacking ram chips to upgrade to from 64k to 1M.
and by that point we did have C, and we could compile fairly clean ASM code that only needed "some" tweaking.
the 70's is before me; but I heard all the stories, and we played the games. everyone played Atari. some of those games fit in 4K carts.
2
Dec 14 '22
I used a pdp8 with 8k of ram, using punched tapes and TTY at 110 bps, Lots of noise. Before that I used punch cards. Good old days!
1
1
u/drawkbox Dec 14 '22
I love C++. Work in gamedev and you really can't do it without it. Even when doing Android (NDK) and iOS (Objective-C++ (mix)) it is very powerful.
If you can wield the C++, for many years professionally, you can wield any language/platform/system.
1
-1
-7
u/chriswaco Dec 14 '22
C++ is a terrible language, but I still miss it when I need to do fast low-level buffer manipulation. Swift is pretty terrible for that and has changed the API multiple times in the last few years, breaking existing code.
-3
Dec 14 '22
Java, write once test everywhere, re-write once re-test everywhere…
6
-21
u/asenz Dec 14 '22
As the mainstream programming language, C++ is the only realistic future we have so far, so let's make it more user-friendly.
10
u/ThrowawayusGenerica Dec 14 '22
I'm not sure how you intend to make a ~40 year-old language user friendly when it's having extension after extension piled on top of it, yet still has to maintain compatibility with a ~50 year-old language.
Don't get me wrong, I love me some C++ but there's no way to make it user-friendly without also completely overhauling it and basically making it into another language in the process.
5
u/x021 Dec 14 '22
Rust is slowly becoming that future it seems given where and how it’s being used.
2
u/asenz Dec 14 '22
Yes I was thinking about that but nah I would rather see Rust features imported in C++ and more radical changes in the C++ building infrastructure, eg. following the example of Rust.
163
u/rexsk1234 Dec 14 '22
Probably because other JVM based languages like Kotlin are being used muched more for new projects.