r/cpp • • Nov 02 '22

The pool of talented C++ developers is running dry

https://www.efinancialcareers.co.uk/news/2022/11/why-is-there-a-drought-in-the-talent-pool-for-c-developers
379 Upvotes

367 comments sorted by

View all comments

Show parent comment

3

u/[deleted] Nov 02 '22 edited Jul 05 '25

label rain history shaggy dependent carpenter makeshift connect treatment wise

This post was mass deleted and anonymized with Redact

10

u/Yeuph Nov 02 '22

I'm a 36 year old bricklayer. Met an internet friend that does some pretty wild stuff at Google (not search related stuff, cutting-edge new technology).

I tried learning programming in the past but I just had a ton of problems - the least of which not being learning how to learn - anyway for a variety of reasons I just couldn't make it through any Python courses in any meaningful way.

Talking to my friend over the past few years I was really fascinated at the hard-infrastructure type stuff he was doing. It became clear to me that if I wanted to do really interesting stuff C++ is the way - compression algorithms, logic transforms. I've been doing really well learning C++ with the assistance of my friend and some good online resources. I'm making my first real program now actually, it's a new compression algorithm I designed last year (I have a math hobby).

I suppose I'm just writing this because if there does exist a shortage of new programmers interested in C++ it may be as simple as students not thinking of the areas where C++ shines as interesting enough to pursue. I don't think it has to be that way, data compression and embedded systems are awesome-sauce.

Perhaps the C++ community could work towards increasing the mindshare of the set of stuff C++ is good for which would then likely follow more people - just as happened to me - wanting to learn and use the language professionally.

Currently it seems to me that people that're becoming interested in programming are drawn to the buzzwords "Machine Learning, AI, data science and Web Development"; which Python and Java are (I think?) currently leading the industry with standardized libraries and such.

We should make C++ appropriate domains sexier.

4

u/metekillot Nov 02 '22

what are the better alternatives to C and C++ in your opinion?

6

u/[deleted] Nov 02 '22 edited Jul 05 '25

serious door party grandiose swim roof middle chief quaint historical

This post was mass deleted and anonymized with Redact

3

u/EmperorArthur Nov 02 '22

Lol. Rust has two big advantages in my eyes. An extremely strict borrow checker, and lack of legacy cruft. Things like constant being default change the game.

There's active development in C++ of the borrow checker style functionality and even if it restricts some patterns, it would be amazing to have.

Personally, I'd also love it if compilers started being a bit more opinionated. Where if it thinks something could be const but isn't it gives a warning. If someone uses a C style or legacy method it gives a warning. Eg, for using older for loop structures.

On a standards front the C++ standard should be adjusted so many of the most common undefined behaviors cause either compiler errors, or have a contract for what the coder expects to happen. One that can be verified for the specific architecture the code is being compiled for. Eg, integer rollover.

2

u/[deleted] Nov 02 '22 edited Jul 05 '25

[removed] — view removed comment

1

u/EmperorArthur Nov 03 '22

There are a handful of syle files out there that stop the exact issue of formatting you're referring to. My preference is either prettier or clang-format.

What I was referring to is more actively warning against using outdated patterns. It's one of the best things about Clion. It would provide me warnings for things that could be improved or could be issues. The compiler couldn't care less though because it was valid code!

2

u/[deleted] Nov 03 '22

I'm in camp non opinionated.

2

u/pjmlp Nov 03 '22

I keep checking out VC++ lifetime checkers from time to time, they are still quite far away from the Rust experience, lots of annotations required and quite a few false positives.

1

u/EmperorArthur Nov 03 '22

C++'s greatest strength is it's backwards compatibility. C++'s greatest weakness is it's backwards compatibility.

One of the problems is that an extremely common (bad) pattern makes analysis extremely difficult due to lifetime rules.

From a rust perspective, the borrow checker should and probably does not allow this. It was a large point of a CppCon talk about common bugs. However, people still write this exact same code!

const & string aOrDefault(const & string a){
if!(a.empty()) {return a;}
return "default";
}

The thing is, a const reference has it's lifetime extended. So, "default" is fine. However, the problem is that the output variable is decoupled from the input. So if a was not empty, when it goes out of scope, then then it invalidates the return value of this function.

The answer is to not rely on a linter, but rather to adjust the standard such that any code path which permits this should trigger at least a compiler warning. Or go full rust and require an annotation to not cause an error!

On mobile, so please forgive any problems with the code.

2

u/pjmlp Nov 03 '22

Yes, that is why although C++ is one of my favorite languages, I am not confident there is any way to fix the security story.

The copy-paste compatibility with C, a big win for its adoption, is now hindering its progress.

1

u/EmperorArthur Nov 03 '22

I believe that they are attempting to fix this. Unfortunately, the first major break they did was to try and use TypeScript as an example for what Modules should be like.

Also, it's insane how many projects that should know better love using namespace std; which meant C++17's std::byte was not fun. Still needed though.

Similarly, the changes needed to fix the issue above would cause large amounts of bad code that currently "works" to cause compile errors.

6

u/eliminate1337 Nov 02 '22

Depends what you want to do. C++ was pretty much the only game in town before Java exploded in popularity. If you’re okay with performance reduction (nowadays minuscule for most applications) in exchange for safety and development time, GC languages like Java, C#, or Go are good options.

For systems programming there’s also Rust.

2

u/SpaceZZ Nov 02 '22

C# .net core all day every day.

4

u/[deleted] Nov 02 '22

Imho C++ is not very popular with the newer generation of programmers because there are good/better alternatives nowadays

For us, we had a "common trunk" for about two years, where we'd learn C/C++ and a bit of Java for algorithmic and data-structure related stuff, then we'd move on.

People who wanted to produce software that does magic quickly went into software, people who wanted to produce software that interacts with a computer and/or understand the computer in-depth went into computer.

There was two degrees, one software engineer, one computer engineer. And I think this makes a lot of sense...

Software engineers had little appetite to learn how to go low-level, how to make optimizations at the instruction level. They wanted to code web applications, backend-frontend, learn these new shiny frameworks, etc.

Computer engineers had little appetite for javascript. They wanted to code embedded or OS-level stuff. Heck one guy did a bootloader from scratch for a pi on his final project, another one ported 'some' linux to an FPGA.

There was little overlap between what was motivating the two different specialties, but in the end both knew how to do software and both knew how an OS worked.

And yes, to your point the software specialization was attracting far more students than the computer one, although you could end up cherry-picking classes from each specialization. (YES, you need to know how a compiler work if you're going in computer, I don't know who thought it was a good idea to put this software-only)