Hacker News new | ask | show | jobs
by oconnor663 2655 days ago
> As it stands writing web services in C++ is basically programming malpractice at this point.

This is the kind of extremism that makes people hate Rust. Please don't make people hate Rust.

2 comments

I guess n-gate is right about the horror that is the Rust Evangelism Strike Force.
I am unapologetic about the truth. The calculus engineers employee that leads them to defer the safety of user facing software for the familiarity of C++ has to stop.
Safety is one thing, but let's not pretend Rust has no downsides compared to modern C++. That's just inane.
I don't claim that Rust is bulletproof. You still have to verify the axiomatic unsafe sections of your code. There can still be bugs in Rust itself, or logical errors in your programs. What I do claim is Rust is a giant leap forward over C++, which is an inadequate tool to write software end users will use. As society continues to rely more and more on software, as it becomes the thing that we stake our lives on, we have a moral responsibility to modernize our tools.
Programming languages are not judged on a single gauge labeled "safety."
Rust is designed with the hindsight of C++ and many other languages, it frankly sweeps the floor in every way other than compile times and certain efficiencies, which will inevitably improve. The only legitimate reason to use C++ is to access legacy C++ libraries that Rust has not yet developed and maintain existing C++ projects.
That is not the only legitimate reason, at all; adoption of new technology takes time for good reasons. Rust is still pretty new, a lot of things are still only in nightly, and while impressive the ecosystem has a long way to go in terms of robust libraries.

Open source software is only one facet; there are plenty of companies with millions of lines of C++ internally, some of which making up parts of their infrastructure.

I'm being intentionally very non exhaustive for two reasons:

1, I don't feel I should have to explain this. It's self explanatory that these two extremely complicated things can't be compared like integers

2, because it's very much subjective. If you are starting a completely greenfield project Rust might be a good idea. I am a huge fan of what Rust has to offer. But it has it's kludges and kinks to work out, whereas companies have had decades to work out and improve their usage of C++. In particular, linting and coding standards for modern C++ projects generally go very far in improving memory safety even if they don't provide strong guarantees like Rust can. With enforced coding standards you can virtually eliminate risks like buffer overflow and discourage risks like data races. In addition to the ecosystem of libraries, there's a lot of excellent tooling for C++, for static analysis and debugging.

I fear now that I have elaborated the first instinct you will have is to poke holes in individual points. Please don't. All I'm trying to illustrate is that switching to Rust costs time+effort, and it is seriously not better than C++ in every way, in the same way that Go isn't.

This sort of fanboism is offputting and does a disservice to Rust. Nobody who was fluent in both languages would ever make such a claim.
How does Rust sweep the flor in game engines like CryEngine or Unreal, GUI frameworks like WPF, Qt, MFC, IDE tooling like Visual Studio, database drivers like OCI and ADO, CUDA, Metal, DirectX....?
template<int x>

checkmate atheists

You can catch more flies with honey than with vinegar
It would be much better to use asp.net core over Rust or Drogon. Safe, fast, easy to develop for, easy to hire engineers for, better for actually building a product quickly with fewer bugs.
I'm comparing using Rust versus C++ to build something like Drogon. We're talking about tools to build high performance infrastructure, which is completely different than using the infrastructure from an application developers perspective.