Hacker News new | ask | show | jobs
by sillysaurus3 4384 days ago
How is Go or Rust better than C C++

Use C or C++ and then try out Go or Rust.

2 comments

That is not really saying much. Depending on the domain you are in C, C++ can be (and are) much suitable candidates than Go and Rust.

The simple point is the "general purpose programming language" is dead. I am not saying there are no general purpose programming languages. I am saying people are going to use language X for task Y because we have the flexibility to do so now.

I'm going to agree on the Go part, but do think that Rust can beat C and C++ at their own game. I really do feel like it's the best of C++, combined with Haskell, and a really smart compiler. A lot of Rust could be translated back into C++ with shared_ptr and && references (the lifetime stuff at least), but Rust gives stronger guarantees about safety and const correctness.
I feel many of the C++ criticisms I read have to do with the older standards (98/03). C++11/14 is a very major upgrade to C++. C++ certainly still has its pitfalls, but things have gotten much better. It honestly feels like a new language to me.
C++11/14 can't be used without upgrading your compilers. Go and Rust use standard toolchains.

Go is also crossplatform, whereas gcc/clang don't like working on Windows, and Microsoft doesn't like implementing the full C++11/14 specs without waiting years after the open source community has already been using the full specs. This results in fragmentation.