News for hackers. Stuff that matters.
Re:C++ Frequently Questioned Answers (2009) by spoiler on Sunday January 23, 2022 @08:39AM (#30046043)
> But as the market exists right now, Rust developers are twice as expensive and the product they deliver is twice as bad.

It's interesting how we have different experiences regarding this. In my experience, it's usually the opposite. And I believe it's mostly because Rust lets you focus more on the problem you're solving, rather than thinking about dos and don'ts of the language.

For example, most Rust projects (or products) seem to have much more polish than equivalent C++ projects (even for ones with years head start). By polish I mean both user experience and the developer experience when one works on the project.

Also, adding user-facing (i.e. UX) polish to Rust projects requires less ahead-of-time planning in my experience.

One reason is that when introducing new Rust code, there's less performance gotchas, and Rust code seems to compose more ergonomically than C++ code... Most of the time at least; there were times that Rust was frustrating. But I think less often probably, _and_ the frustration is compile-time, rather than runtime. Also Rust has a shorter feedback loop due to Rust's incremental compilation really helps mitigate the frustration, so you can iterate faster.

And another is because I've always felt like refactoring Rust code (even with C++ experience than Rust) tends to be easier, and faster to refactor, and I feel bolder while doing it, if that makes sense? Simply because the compiler thinks about various categories of problem domains instead of me, and it tells me about them.

Of course, it's never black and white with any of the above things I mentioned; the situation is grey in both ecosystems. But I think it's a much lighter shade of grey in the Rust space than in the C++ space. And as always, there's always exceptions on either side, too.

EDIT: I quoted OP's full sentence, but then only addressed the last bit. I hopefully clarified in comments below that I wasn't talking about the first part. Sorry about that!

Re:C++ Frequently Questioned Answers (2009) by otabdeveloper4 on Sunday January 23, 2022 @08:54AM (#30046123)
> In my experience, it's usually the opposite.

Obviously your experience doesn't involve budgeting or hiring developers.

Your subjective feelings about how nice or fast it is to write Rust code isn't what we're talking about here.

The original poster claimed that Rust can save money by letting managers hire junior devs to replace senior C++ developers.

This isn't true. Rust developers are much more expensive than C++ developers, and have vastly lower productivity. (No doubt because of their vastly inflated expectations; any Go/Python/PHP developer who upgrades to Rust suddenly thinks they are elite 10x programmers because they have a clue about performance now.)

Re:C++ Frequently Questioned Answers (2009) by lpapez on Sunday January 23, 2022 @09:29AM (#30046370)
> The original poster claimed that Rust can save money by letting managers hire junior devs to replace senior C++ developers.

This is not at all what I said, nor meant. I never said anything about the hiring market, but merely stated a personal observation why I think Senior C++ devs often dislike Rust.

Re:C++ Frequently Questioned Answers (2009) by ncmncm on Sunday January 23, 2022 @06:20PM (#30051693)
You were wrong about that, too:

Senior C++ developers are not impressed with Rust because it doesn't solve any problem they have. Switching to Rust would make them markedly less productive, with no corresponding benefit. The drain comes from slow compilation and from excess design overhead, the need to distort a simpler architecture to satisfy the borrow checker.

Put simply, the extra work to satisfy the borrow checker prevents errors they do not make.

This contradicts Rust propaganda, where a few CVE numbers are cited over and over, echo-chamber style. What these citations never mention is that they are for bugs in mostly very old code. We just don't need to write code that way anymore. It is not just error-prone, it is more work, so there is simply no temptation to write it that way.

I do hear of programmers who have elected to stop learning, and (proudly!) admit continuing to write C++98 or even "C-like C++". We used to say "you can write FORTRAN in any language"; there is no eliminating bad programmers, but plenty of reasons to avoid their product. What conclusions can we make about Rust from its worst adherents?

Re:C++ Frequently Questioned Answers (2009) by tialaramex on Sunday January 23, 2022 @09:53PM (#30053168)
> What these citations never mention is that they are for bugs in mostly very old code.

It is unavoidably true that grave security holes get found only in existing code and not hypothetical future code written with a later language revision and whatever new features will definitely avoid those "errors they do not make". That's time's arrow for you.

Can you name a few of these "Senior C++ developers" and point us to, say, a few years of their work?

Is there a specific vintage of C++ where you feel like, at last, unlike C++ 98 you "don't need to write code that way" and so Senior C++ developers won't make these errors? C++ 11 maybe?

Re:C++ Frequently Questioned Answers (2009) by pcwalton on Monday January 24, 2022 @02:49PM (#30062974)
> Put simply, the extra work to satisfy the borrow checker prevents errors they do not make.

> This contradicts Rust propaganda, where a few CVE numbers are cited over and over, echo-chamber style. What these citations never mention is that they are for bugs in mostly very old code.

Empirically this is not true. https://twitter.com/LazyFishBarrel/ is not citing "a few CVE numbers over and over"; for example, in browsers, new code is disproportionately responsible for vulnerabilities. I know most of the people at the big tech companies doing the research into where the security problems in major C++ software come from; they're not making the results up.

Re:C++ Frequently Questioned Answers (2009) by ncmncm on Monday January 24, 2022 @07:11PM (#30066041)
When I look into these CVEs and see "use after free", I know immediately it is not a problem in modern code.
Re:C++ Frequently Questioned Answers (2009) by kobebrookskC3 on Sunday January 23, 2022 @11:49PM (#30053855)
> it doesn't solve any problem they have

you mean a problem blithely ignored until the software becomes important enough to attack, at which point, it's too late to rewrite the "very old" code? https://googleprojectzero.blogspot.com/2022/01/zooming-in-on...

> errors they do not make.

bullshit. a quick look at oss-fuzz on c++ projects, many of them in modern c++, will show that they are teeming with memory unsafety.

> there is no eliminating bad programmers, but plenty of reasons to avoid their product.

on an unrelated note, what product are you responsible for, so i can avoid it?

Re:C++ Frequently Questioned Answers (2009) by ncmncm on Monday January 24, 2022 @01:20AM (#30054241)
There is no possibility you could ever afford it.
Re:C++ Frequently Questioned Answers (2009) by kobebrookskC3 on Monday January 24, 2022 @04:33AM (#30055258)
the world can't afford new code written in a blatantly memory-unsafe language
Re:C++ Frequently Questioned Answers (2009) by spoiler on Sunday January 23, 2022 @09:04AM (#30046198)
> Obviously your experience doesn't involve budgeting or hiring developers.

Ah, that is very true! :) I forgot to make clear in my comment that I wasn't referring to that bit at all.

I only participated in the hiring/interview process, but that's as far as my hiring experience goes.

> The original poster claimed that Rust can save money by letting managers hire junior devs to replace senior C++ developers.

Ah, I didn't interpret it that way. I thought the point they wanted to get across was that it's easier to get the same for less—not in terms of monetary cost, but in terms of less mental effort with regards to context/knowledge about the language itself.

But, the hiring point you're addressing can be inferred from their comment, too.

I think I agree with you on that... It probably is "easier" to hire C++ developers, since there's an older and bigger market for them.

I think Rust developers are in an interesting position right now that they're not as abundant as other developers, since Rust is probably still in "early adoption" stage. So they can use that as leverage in salary negotiations, maybe? But it also comes at a cost of a much smaller job market for them, too.

Re:C++ Frequently Questioned Answers (2009) by fisf on Monday January 24, 2022 @08:17AM (#30057206)
> I think Rust developers are in an interesting position right now that they're not as abundant as other developers, since Rust is probably still in "early adoption" stage. So they can use that as leverage in salary negotiations, maybe? But it also comes at a cost of a much smaller job market for them, too.

No, you are viewing that from a technological perspective - what you assume only holds if "Rust" was a requirement.

If staffing a project is much harder (and maybe more expensive) when using Rust as language, then Rust will not be chosen if C++ is an option.