Reasons why Rust is Better than C++
Posted: Tue Feb 07, 2023 9:50 pm
Hi everybody,
I wanted to start a discussion why Rust is better than C++.
First, it has compiler enforced memory safety. You literally cannot have a segfault from an invalid memory access, either through incorrect pointer arithmetic, or whatever unsafe behavior C++ allows.
Second, it has better syntax. Rust is a new language with no baggage. C++ is literally 35 years old, based on a 40+ year old language, and the syntax shows. Have you even seen the syntax for the protoype of the signal() function? Even worse, C++, in its effort to be a modern language, has added an entire new set of syntax, which just makes it a siamese twin monstrosity. (For example, regular [type] name() declarations for functions, and the newfangled -> declarations for function return types.).
Also, C++oids literally think this is acceptable syntax: Okay buddy.
Third, Rust has a cool mascot called Ferris. Ferris is a cool crab, which is a crustation, so we fondly refer to other Rust users as rustaceans. Get it?
Fourth, C++ is just the unsafe language. The program can leak memory and crash, corrupt data, and let's not forget, get the sensitive data stolen.
Rust is the language that is safe and solves all those problems. Since Rust obsoletes everything before it, there is literally no reason to keep using C/C++.
I wanted to start a discussion why Rust is better than C++.
First, it has compiler enforced memory safety. You literally cannot have a segfault from an invalid memory access, either through incorrect pointer arithmetic, or whatever unsafe behavior C++ allows.
Second, it has better syntax. Rust is a new language with no baggage. C++ is literally 35 years old, based on a 40+ year old language, and the syntax shows. Have you even seen the syntax for the protoype of the signal() function? Even worse, C++, in its effort to be a modern language, has added an entire new set of syntax, which just makes it a siamese twin monstrosity. (For example, regular [type] name() declarations for functions, and the newfangled -> declarations for function return types.).
Also, C++oids literally think this is acceptable syntax:
Code: Select all
[](){}
Third, Rust has a cool mascot called Ferris. Ferris is a cool crab, which is a crustation, so we fondly refer to other Rust users as rustaceans. Get it?
Fourth, C++ is just the unsafe language. The program can leak memory and crash, corrupt data, and let's not forget, get the sensitive data stolen.
Rust is the language that is safe and solves all those problems. Since Rust obsoletes everything before it, there is literally no reason to keep using C/C++.