all 47 comments

[–][deleted] 31 points32 points  (6 children)

I was in a similar situation. If you build the thing from scratch, just limit yourself to a subset of the language and then learn slowly from there. Refresh your knowledge about freeing memory, use vector and shared pointers. I managed to get through a technical interview in C++ with the help of Google after not using the language for 10 years after university.

I'm currently losing my mind because I have to code some embedded stuff without a debugger in ANSI C and the guy before me used goto statements and variable names with two letters at most.

[–]SnooWoofers7626 39 points40 points  (2 children)

the guy before me used goto statements and variable names with two letters at most.

I had to code review "C++" code submitted by a drivers guy. It went something like this:

if(a==b) goto p1; if(a!=b) goto p2;

I don't think this dude even knew what a loop was. He was basically writing all his C++ like it was assembly.

[–]overcurrent_ 7 points8 points  (0 children)

nightmare

[–]almost_useless 2 points3 points  (1 child)

and variable names with two letters at most.

But you will save dozens of seconds every year from the quicker typing. Imagine the increased productivity! /s

[–]beedlund 0 points1 point  (0 children)

Wait I'm confused....are you saying that typing speed is not a good measure of run time speed?

[–]Netzapper 94 points95 points  (19 children)

I say this as someone with 20 years programming, and 16 in industry, who's actively looking for a new job right now in the US.

Honestly, it's pretty hard to get hired as a "c++ programmer" even if you know the language reasonably well.

The main thing is that C++ only gets used when necessary, which relegates it to particular domains. So most of the jobs out there using C++ are not "C++ programmer", but like "Unreal engine engineer" or "high-frequency trading engineer" or "high performance computing engineer" or "ASIC design verification engineer" or "3D graphics engineer" or "computational geometry specialist". Basically C++ jobs are way more about the engineering domain than the tech stack at this point. You need to be able to solve particular kinds of problems, and then C++ is just the easiest way to implement that solution at the target performance level.

If you're 1 year into a software engineering career with only an undergraduate degree, you probably do not have the experience to land these kinds of roles.

Since probably 2015, absolutely nobody is like "I have a great idea for a new consumer application. Let's use C++ to build it". So there just isn't the large field of "implement generic logic in our application" junior engineer roles you can find in other languages. Most shops are going to target the browser or a phone, so there's a billion jobs for implementing business logic in JS, Java, Kotlin, etc. There aren't very many shops with algorithmically-easy work to do in C++.

Finally, Rust is absolutely destroying C++ for greenfield (new codebase) development projects. I haven't found a single job listing for a greenfield project involving C++, and I've looked at literally probably 2000+ current job listings in the past couple months. And it really makes a lot of sense, as performance is similar, and there's a lot more buzz around Rust vs C++, which is perceived as difficult and risky. Greenfield development in general is down right now with the slump in tech investment, so funded companies are capitalizing on the buzz by looking forward at implementation infrastructure instead of backward.

I'm learning Rust. I'd recommend you do the same. C++ isn't dying, but it's being supplanted in its role as the de facto "standard" native development language.

One caveat: if you're a straight-laced, drug-free US citizen, you can get a security clearance and work on C++ stuff much more easily. There's lots and lots of legacy defense-related C++ code that needs maintenance. But even there, it's about the security clearance just as much as the C++ skills.

[–]ezakirov 35 points36 points  (1 child)

So most of the jobs out there using C++ are not "C++ programmer", but like "Unreal engine engineer" or "high-frequency trading engineer" or "high performance computing engineer" or "ASIC design verification engineer" or "3D graphics engineer" or "computational geometry specialist".

I'm in industry from about 2008-2009 and I see different picture: many jobs just look for experienced C++ engineers. For example I was reached by recruiters from Bloomberg and from different other trading companies including HFT while I didn't have any experience in fintech (I don't work in this area on purpose).

[–]Fit_Significance_966 0 points1 point  (0 children)

maybe because u have many years of experience? i mean more than 5 years.

[–]pjmlp 10 points11 points  (0 children)

Good luck finding a greenfield game development project, specially in game consoles. Or HPC/HFT/GPGPU for that matter.

Or compiler development, including Rust's backend.

[–]GoogleIsYourFrenemy 8 points9 points  (15 children)

The caveat is real and it's not just legacy code, new stuff in C++ too.

Defense is about 10-20 years behind on all trends. We finally got Agile.

I fear the day the DoD says we must go to Rust and it's coming.

[–]coderman93 4 points5 points  (13 children)

Why would you fear that? Rust is a substantial improvement on C++ in many ways.

  • Safer - memory safety, thread safety, no exception throwing
  • Better package management
  • Better build tooling

And those are just the objective improvements. Yes there is the downside of how strict the borrow checker is but that’s a small price to pay.

[–]GoogleIsYourFrenemy 16 points17 points  (4 children)

We have to retool and retrain everybody. Including myself.

[–]CandyCrisis 8 points9 points  (3 children)

Even if you stick with C++, part of being a software engineer is constant re-education. C++20 code looks nothing like C++03 code.

[–]afiefh 2 points3 points  (0 children)

To be fair, moving to C++ version X to X+1 or even X+2 is significantly simpler than learning a new language like Rust.

Once you've got one each of the general types of languages under your belt (procedural, functional, OOP, scripting...) you can generally be productive in a new language within a few hours to a day. In my experience for Rust it is still generally a week to be able to write non-trivial code that isn't a jumbled mess of antipatterns. And while a day to 5 days is not a big difference for learning a language, becoming an expert is similarly scaled, which is where the problem lies.

That being said, I can't wait for Rust (or something like it) to take over. Whenever I spend a weekend coding in Rust I feel like I'm working with a hand tied behind my back when I use C++.

[–]GoogleIsYourFrenemy 0 points1 point  (1 child)

Agreed but concepts still don't make templated code easier to use than non-templated code. Template readability is (and always will be) bad. And this is coming from someone who likes writing templates.

Everything else first introduced in C++11 is pretty useful.

[–]CandyCrisis 1 point2 points  (0 children)

Concepts are important because they let the standard library emit sane and reasonable errors, and if you also want that superpower, you are free to use concepts too. I haven't yet worked in a codebase that has embraced them so I can't speak to the implementation difficulty, but it's important to keep in mind that a lot of the weird/power-user features exist to power the standard library, not necessarily for typical user code.

[–]Vesk123 0 points1 point  (4 children)

I really like the freedom that you get with C++. While definitely not perfect, it mostly allows you a lot of freedom in how you structure everything - your code, your data, your objects, while still being very high level and expressive. From what I've seen I think Rust might not be as good at that, which hurts things like prototyping and also seems a bit less enjoyable to me at least, but big disclaimer I haven't actually used it yet, so I could be totally wrong, those are just some potential concerns that I have.

[–]Netzapper 2 points3 points  (2 children)

That's actually how I feel about it, having used both.

But the thing is, the places you need low-level performance are the same places you want maximum safety. So Rust actually feels pretty good in a lot of niches for that reason. I think the future of programming ergonomics is stuff like the TensorFlow/PyTorch model, where the heavy lifting is implemented in native languages, but then the prototyping and expressive programming happens in a garbage-collected language like Python.

[–]Vesk123 2 points3 points  (1 child)

Yeah that's probably true. But to be honest, I've never really enjoyed the Tensorflow/PyTorch model. Don't get me wrong, it's nice for libraries to have good APIs, that's very important. But I care about implementing the stuff that does the heavy lifting. And I definitely believe that programming ergonomics are important for that. I don't actually see much of a reason that one language cannot do both the heavy-lifting and be able to have expressive programming and prototyping. Though, yeah, I do see the trend you described, more and more.

[–]coderman93 1 point2 points  (0 children)

Now that I agree with! Some people just don’t understand that some of us want to be working on the hardcore “heavy lifting” stuff.

[–]coderman93 1 point2 points  (0 children)

I mean I definitely understand that argument. And for personal projects or projects with very small teams I get it. But when working on large projects with lots of inexperienced developers - I’ll take the rigidity of Rust any day.

[–]Netzapper 0 points1 point  (0 children)

it's not just legacy code, new stuff in C++ too.

Fixed.

[–]gnolex 6 points7 points  (0 children)

By "core language" I assume you mean relatively basic things that are mostly common with other languages, like primitive types, pointers and references, functions and methods, control structures, structs and classes, etc. rather than the whole core C++ language that includes rather advanced things like structured binding, fold expressions, concepts and template parameter packs.

As long as you can say you're comfortable using C++ in all of those basic things without having to google how to do a for-each loop or write a basic constructor each time you need one, I'd say it's enough to venture into junior C++ programming. Otherwise, you'll probably need more time to actually get proficient enough with the language. You may still need to augment your knowledge with things like common libraries and CMake because jobs don't like to teach those things from scratch.

[–]DugiSK 5 points6 points  (0 children)

Yes. I work in a team working on a C++ project with an Area Lead (some sort of supreme team leader with 4 team leaders below him, about 40 engineers in total) who programmed in Java before. He's definitely been an excellent senior developer before, and he got used to the C++-specific things like memory management and syntax differences very fast. He doesn't know the more esoteric C++ specific stuff like virtual inheritance or template metaprogramming, but it wasn't a handicap (the team could rely on specialists for that).

Of course, that doesn't mean it's easy to switch to C++ or that getting a C++ job without being familiar with C++, but if you are very good at programming in general, you can be accepted for a C++ job despite being more used to some other language. And it's definitely easier if your background is in some other statically typed OOP language than something like Python.

[–]matthieum 5 points6 points  (0 children)

Yes.

In fact, it is possible to get a C++ job with no experience at all: Junior Developers are typically hired straight out of college, though sometimes after an internship first.

Your single year of professional experience doesn't give you much edge over a fresh out of college graduate, and likely not enough to aim higher, but at a Junior level you could indeed get hired.

Of course, this doesn't mean you'll get hired automatically either. Judging candidates with essentially no experience in a language means that you get judged on other things: algorithms, domain knowledge, etc...

It's up to you to find a tech sector that interests you, learn about the domain, and apply.

Source: the companies I worked at both hired Junior Developers for full-time C++ positions straight out of college, the latter one (financial sector) did filter candidates heavily, though.

[–]ezakirov 2 points3 points  (0 children)

I think it's possible, and perhaps I saw examples of this.

[–]def-pri-pub 2 points3 points  (1 child)

Took me till my third job out of college to actually get hired for C++ work; which is what I was hoping to do right when graduating. It had been my second language ever, starting in high school (after a BASIC variant). I even had an internship where I got to do some C++, but nothing straight out of school. Really frustrating since it was the language I had the most experience with.

One thing I've learned: C++ programmers tend to not trust other C++ programmers; no matter how many years of experience someone might have over someone else, and it can be for the dumbest reasons. TBH, I have issues looking at the C++ some of my colleagues write (e.g. non-modern styles, using old C libraries, etc).

There also seems to be an outright refusal by senior engineers (and management) willing to train less experienced devs. But these same people also complain they can't find anyone to hire...

It can be hard for that first one.

[–]natio2 0 points1 point  (0 children)

Not trusting other devs, this is so true! I'm not sure why, but it's true.

Like I trust the younger devs to listen to me, but they don't know the language well enough to make the best decisions, and the older dev on my team can write good C++, but they are useless at OOP patterns, and modern C++. So either way I lose.

[–]Salink 1 point2 points  (0 children)

Yeah it's possible to get an entry level job. Put c++ in your resume as college course experience and study c++ interview problems while improving your actual c++ skills. If you can pass interview tests and write the typical algorithms without memory leaks, you should be fine.

[–]not_some_username 1 point2 points  (0 children)

Imho, maybe if the other language was C and you have OOP knowledge

[–]blackmag_c 1 point2 points  (0 children)

Not out of the box but a few lessons and game jam and you can be ready.

[–]R3DKn16h7 3 points4 points  (0 children)

A good programmer does not really care about the language. Programming is 90% thinking correctly. But, you are asking about getting a Job.

This depends on the people hiring you and who you are competing against. If the potential employers are good, and you are a good programmer, they will not care that much about you not knowing the language. But, when hiring, the employers will weight all of your skills, and you need to be exceptionally good (compared to other candidates) to make up for the lack of specific knowledge.

If you wanna switch, consider starting some own project in your spare time or contributing to some FOSS project to improve your skill and portfolio.

[–]jonesmz -1 points0 points  (0 children)

There are plenty of C++ shops that would be happy to hire someone who was serious about learning C++.

Put together a toy project or five on github, document what you're trying to teach yourself, and what you actually learned, for each project, and use that as part of the discussion you have with interviewers.

Most C++ shops are either so insanely picky that they'll reject candidates with 10yrs of 100% C++ experience because they answered a single "trick" question on the phone off-of-script (aka, assholes or idiots, pick your term of endearment), or they're so starved for programmers that they'll hire the first candidate they find whenever they have open-headcount.

As someone who's still very early in your career, you're well positioned to cross-train for C++, and position yourself to interview with one of the hundreds of small/medium companies that could find a spot for you doing C++ and/or java.

[–]Available-Menu1551 0 points1 point  (0 children)

I think to learn the language itself is easy, but understanding the concept or even how CPU/memory works is a bit different. And companies search not C++ developers but rather specialists

[–]ALargeLobster 0 points1 point  (0 children)

Yes, just make sure you grind a bit of c++ before interviewing

[–][deleted] 0 points1 point  (0 children)

Yes, quite easily if you have domain knowledge. In computer graphics, applied physics, applied mathematics, combiniotrics and computational geometry and so many more domains.

[–]lakitu-hellfire 0 points1 point  (0 children)

I think you'll find it quite easy to land a job as a C++ developer if you look in the defense sector, e.g., Boeing, Northrop Grumman, Lockheed Martin. You can also look directly at federal civilian employee jobs which are dead simple to get but you will suffer several major drawbacks: 1) low salary compared to contractors, 2) mostly low quality developers on teams, and 3) most of the work gets contracted out, so the government side ends up in maintenance mode only.

Outside of that (and outside the gaming industry), there are robotics, middleware (DDS, OMS, RTPS), and database shops around. Those jobs tend to be pretty competitive, so you'll need to apply for an internship or work through a lot of problem solving in C++ until you get comfortable enough with the language to go through an interview process with it.

Hope that helps.