DEV Community

Assis Zang
Assis Zang

Posted on • Edited on

My journey with Rust πŸ¦€ #1 - Why Rust?

Perhaps the biggest reason I chose to study Rust is because it is considered one of the most beloved languages in the community, just like C# πŸ’œ.

C# πŸ’œ VS RUST πŸ¦€

Speaking of C#, Rust has significant similarities with C#, I'm not saying that they have the same essence, quite the contrary, each one has its particularities, but the fact that we can use the same official C# IDE, Visual Studio to programming in Rust, that for me is something formidable πŸ˜ƒ.

Another point is: who wouldn't love a language with a cute crab as the official symbol??? πŸ¦€πŸ€©

Below is a list of reasons that led me to invest in learning Rust.

Rust is highly secure πŸ”

Rust is known to be a safe language. It was designed from the ground up with security in mind, providing mechanisms that prevent a number of common programming errors, such as invalid memory accesses and memory leaks.

Some features of Rust that contribute to its security are:

  1. Compile-time checking: The Rust compiler performs a series of static analyzes during the compilation process to verify the code's compliance with the language's safety rules and that help detect errors even before the program starts. be executed.

  2. Strong type system: Rust has a strong type system that checks at compile time the validity of operations performed on the code. It prevents common mistakes like mixing incompatible types or using uninitialized values.

  3. Ownership Rules: Rust's ownership system based on the concept of "ownership", ensures that each value has a single owner at a given time which eliminates the need for a garbage collector and helps to avoid problems such as memory leaks and invalid memory accesses.

  4. Mutability control: Rust has strict rules for mutability control, which helps to avoid data races in concurrent code. Rust's type system ensures that concurrent access to data is secure, avoiding bugs that are hard to find and fix, contributing heavily to code quality.

  5. Error Handling: Rust has a robust and secure error-handling system. Through the use of Results and Options, the language forces the developer to explicitly handle error cases, making it more difficult to ignore errors or deliberately propagate them.

Rust performs well πŸš€

Rust is known for offering a good performance. The Rust language was designed to be efficient and secure, striking a balance between performance and security. It is compiled into highly optimized machine code, which allows programs written in Rust to run quickly and efficiently.

Below are some of the Rust features that help the language achieve high performance.

  1. Memory control: Rust has a memory management system that guarantees security without the need for a garbage collector. This approach allows for more precise control over memory usage, reducing the overhead associated with garbage collection and avoiding issues such as memory leaks.

  2. No unwanted abstraction: Rust avoids unwanted abstractions that can introduce overhead and negatively impact application performance. Rust allows developers to precisely control low-level details such as memory allocation and thread management.

  3. Optimized Compiler: The Rust compiler is known for its optimization capabilities. It performs sophisticated static analysis and applies a series of transformations to generate highly optimized code, taking full advantage of the underlying hardware.

  4. Safe parallelism: Rust has built-in features for parallel programmings, such as the 'thread' concurrency primitive and the 'std::sync' standard library. These features allow developers to write safe and efficient concurrent code, taking advantage of available processing resources.

Conclusion βœ…

As a C# programmer, I wanted to learn a different programming language, but I wanted a language with another paradigm, not like Java or Node, and Rust for me was a perfect choice πŸ˜ƒ.

If you are an experienced programmer or even a beginner, Rust can be a great starting point to switch languages or even start programming, so don't wait and start your Hello World today! in Rust! πŸ₯³

In the next articles of the series, I will bring my impressions as I evolve in the knowledge of this wonderful technology called Rust πŸ¦€.

See you there! πŸ’β€β™‚οΈ

Top comments (0)