I came across this article the other day, titled “Why Rust cannot replace C++”.

I feel that the author completely fails to understand the opposing argument. The article claims that with “new” C++ features like smart pointers, you can write safe code in C++, therefore Rust is unnecessary.

But I don’t want a language where I **can** write safe code, I want a language where I **must** write safe code.

medium.com/@pepitoscrespo/why-

#rust #rustlang #cpp #programming

There’s this common statement that “the cognitive overhead of working with the borrow checker just isn’t worth the security benefits when you can write safe code in other languages”.

But the comparison is always to the “cognitive overhead” of writing something in some other language. When the comparison should be to writing something **correctly** in some other language.

#rust #rustlang #programming

1/3

Show thread

Sure, it’s much easier to pass pointers (*, &, or shared_ptr) around, but now I have the “cognitive overhead” of ensuring that it’s only accessed from one thread at a time. Or not used after it’s been freed in the former cases.

When I’m working with the borrow checker that is something that I **don’t** have to think about. It’s less “cognitive overhead”.

#rust #rustlang #cpp #programming

2/3

Show thread

I’m going to write this up as a blog post with the title “Rust makes you a worse programmer” for pure click-bait fame.

Because you actually have to think less.

(I’m not really)

#rust #rustlang #cpp #programming

3/3

Show thread
Follow

@hds We had a training about modern C++ at work two weeks ago. I learned a lot of knew things but many of them where somewhat familiar. But during these three days I kept thinking „What’s the point?“.

I can understand that there are people who programmed in C++ for a long time and they know everything about the language, for them it is nice to also have these shiny new things that newer languages offer.

1/2

@hds But this is complicated for someone learning C++ from scratch. It does not suffice to only learn the modern way. When you start working at a company and have to maintain legacy code chances are high it was not (completely) refactored to use modern C++. So you have to learn the whole range of C++ to be able to use it professionally.

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml