Live data from Hacker News

I think C++ is still a desirable coding platform compared to Rust

lucisqr.substack.com

41–50 of 110 posts

Re: I think C++ is still a desirable coding platform compared to Rust

#41
post #26
post #3

I've done some C++ but no Rust. I'd like to learn a few things from people who have done both. 1. How many years of C++ programming do you have under your belt? How many years of Rust? 2. For new work projects, do you choose C++ or Rust? Why? 3. For new hobby projects, do you choose C++ or Rust? Why? 4. Is there something about C++ that you wish Rust had? 5. Is there something nice about Rust (apart from the borrow c…

1. Hard to count. Started as a youth on game modding, but in terms of serious projects, probably 5-7 years. 2. Rust. It's a Rust shop, and the only C++ we have is in dependencies that we wrap with Rust interfaces. 3. Rust. I've probably shaved a not-inconsiderable amount of time off my life in debugging C++ issues at both compile-time and runtime (inscrutable behaviours, memory safety, broken / unstandardized tooling…

> ADTs

C++ is already a very complex beast as it is.

ADTs (and pattern matching) make it concise to express many different programming things.

But I'd imagine that adding it to C++ would be horrendous.

Re: I think C++ is still a desirable coding platform compared to Rust

#42
post #3

I've done some C++ but no Rust. I'd like to learn a few things from people who have done both. 1. How many years of C++ programming do you have under your belt? How many years of Rust? 2. For new work projects, do you choose C++ or Rust? Why? 3. For new hobby projects, do you choose C++ or Rust? Why? 4. Is there something about C++ that you wish Rust had? 5. Is there something nice about Rust (apart from the borrow c…

I currently work in a mixed C++ & Rust shop -- embedded Linux, autonomy systems for tractors -- and know C++ very well. I choose to work exclusively in Rust. 1. 10-20 years of C++ depending on your definition. But used C++ part-time casually/open-source from mid-90s to 2012 or so, and then mostly full-time from that point on @ Google, with a big chunk of that working in the Chromium source tree. 2ish years Rust, incl…

Pattern matching can be done over structs as well, in Rust.

Re: I think C++ is still a desirable coding platform compared to Rust

#43
post #3

I've done some C++ but no Rust. I'd like to learn a few things from people who have done both. 1. How many years of C++ programming do you have under your belt? How many years of Rust? 2. For new work projects, do you choose C++ or Rust? Why? 3. For new hobby projects, do you choose C++ or Rust? Why? 4. Is there something about C++ that you wish Rust had? 5. Is there something nice about Rust (apart from the borrow c…

1. About 15 years of experience in C++, 2-3 years in Rust. 2. I'm retired now, but I would have considered Rust for any greenfield project that didn't have a compelling reason to pick C++ (e.g. mandatory interop with an existing big C++ library). 3. Rust nearly every time. I sometimes use a layer of C++ as an FFI shim, such as when writing a gRPC client/server (the Rust libs there aren't mature). 4. The library ecosy…

Your thoughts about crates.io mirrors mine exactly. I'm becoming more and more interested in just ditching it entirely and using vendored checked-in (or submoduled) dependencies and managing the transitive dependency tree myself. Cargo&crates.io seems to have been inspired too much by npm. Lots of half-baked, abandoned libs that wantonly pull-in piles of other 3rd party deps and create a sprawling graph of dependencies that ends up with binary bloat and multiple versions of the same package, etc. etc.

Re: I think C++ is still a desirable coding platform compared to Rust

#44

> the pool of engineers with C++ background is much larger than the pool of Rust developers Well that's pointless.

Why? The place I work at decided to use typescript for their integration testing framework for some reason. Everything else is c++ and python, and the developers they hire all know c++ and python, but not typescript. As a result, the integration test framework is a dumpster fire.

Re: I think C++ is still a desirable coding platform compared to Rust

#45

Earlier quoted context omitted.

I currently work in a mixed C++ & Rust shop -- embedded Linux, autonomy systems for tractors -- and know C++ very well. I choose to work exclusively in Rust. 1. 10-20 years of C++ depending on your definition. But used C++ part-time casually/open-source from mid-90s to 2012 or so, and then mostly full-time from that point on @ Google, with a big chunk of that working in the Chromium source tree. 2ish years Rust, incl…

Pattern matching can be done over structs as well, in Rust.

Not nearly as expressively though. You can destructure a struct, but you can't express alternatives on anything but an enum. Languages like F#, Scala, Haskell support more ways of creating ADTs than the kind of enums that Rust has.

Re: I think C++ is still a desirable coding platform compared to Rust

#46

> the pool of engineers with C++ background is much larger than the pool of Rust developers Well that's pointless.

I'd wager that any highly qualified C++ engineer worth working with can pick up Rust and become a highly qualified Rust engineer in And honestly, I'd rather work with those people than with people who came to Rust from languages like Python, Java, TypeScript, etc.

Yeah, I've seen C++ engineers pick up Rust in a few weeks. And one JavaScript engineer, too, defying my prejudice :)

Re: I think C++ is still a desirable coding platform compared to Rust

#47

There's a safe and sane language subset struggling to get out of "modern C++". The essence is following the Rule of 3/5/0, adopting value semantics, explicit ownership via unique_ptr/shared_ptr, resources wrapped as RAII objects. The syntax and feature space is certainly crowded and abused, but playing with the borrow-checker is an entirely different game.

Yeah, I've tried to find this mythical subset. I handwaved my way around most of the difficulties, but I think that it exists. However, I'm not convinced that C++ developers are going to enjoy it. In particular, the subset I could come up with is much less expressive than Rust.

I've written down some of this at https://yoric.github.io/post/safety-and-security/ .

Re: I think C++ is still a desirable coding platform compared to Rust

#48

There's a safe and sane language subset struggling to get out of "modern C++". The essence is following the Rule of 3/5/0, adopting value semantics, explicit ownership via unique_ptr/shared_ptr, resources wrapped as RAII objects. The syntax and feature space is certainly crowded and abused, but playing with the borrow-checker is an entirely different game.

That's my problem when people talk of C++ as if it was a sane, consistent language with a common style and doctrine like C#. You could get anything between C with classes and turbo template metaprogramming header only Boost specials.

Job postings with C++ should probably include an example source file..

Re: I think C++ is still a desirable coding platform compared to Rust

#49
post #28

> In many years of coding C++, very rarely I experienced a stack overflow or segmentation fault. It is literally not an issue in every codebase I have worked with. Is this true for most people though? What do you think about this quote? Frankly I've seen a lot of segmentation fault issues with C++ projects. Granted much of it can be detected pre-emptively with good tools and when a segfault happens, I can debug it qu…

Mozilla has Crash Scenes Investigations, a team dedicated to tracking down segfaults, so... yeah, they very much exist in the wild.

Re: I think C++ is still a desirable coding platform compared to Rust

#50
post #3

I've done some C++ but no Rust. I'd like to learn a few things from people who have done both. 1. How many years of C++ programming do you have under your belt? How many years of Rust? 2. For new work projects, do you choose C++ or Rust? Why? 3. For new hobby projects, do you choose C++ or Rust? Why? 4. Is there something about C++ that you wish Rust had? 5. Is there something nice about Rust (apart from the borrow c…

1. About 15 years of experience in C++, 2-3 years in Rust. 2. I'm retired now, but I would have considered Rust for any greenfield project that didn't have a compelling reason to pick C++ (e.g. mandatory interop with an existing big C++ library). 3. Rust nearly every time. I sometimes use a layer of C++ as an FFI shim, such as when writing a gRPC client/server (the Rust libs there aren't mature). 4. The library ecosy…

somewhat OT, but what happened to haskell? a few years ago it was all over HN - now you hardly see any mention of it. surely this won't happen to rust?
Post reply on HN