Let’s talk about Rust programming!

Madhuresh Gupta
Quick Code
Published in
3 min readJun 7, 2020

--

Rust has been gaining lot of popularity in the recent times. And regardless of what technologies you work on, it is important for any developer to keep an eye on what’s going on in the world of other languages and libraries. So today I shall be talking about a systems language which has been the top choice from the last 2 years as developers most desired language to learn (according to stack overflow’s survey).

Now look, the primary purpose of any language is to serve the requirements of any developer and Rust does it well in many of the aspects. And rust is competing in the systems language domain, meaning the places where we have been using C and C++ from decades. And don’t get me wrong, we are not replacing C++ codes everywhere and it’s not going anytime soon. But yeah when it comes to real world projects written on C++ there are lots of challenges when it comes to handling threads or installing dependencies, trust me it’s a developer’s nightmare.

Rust is that language which has literally got you covered on all these issues and this is the reason people have started to think about adopting Rust to some extent in their project instead of C++ in their next project.

The most loved feature of Rust is that it does not have any garbage collector, meaning from the ground up compiling rust code doesn’t send back garbage values thus making it a really secure language compared to C and C++. This is due to the fact that many at times hackers can read back the values collected by the garbage to steal information.

C++ being more than decades old standard does not have uniform documentation in one simple place like what Rust has it on it’s official page. Coming on the dependencies part, Rust comes with it’s own dependency manager — Cargo. Cargo handles a lot of tasks for us, such as building your code, downloading the libraries your code depends on, and building those libraries. When your project is finally ready for release, you can use cargo build — release to compile it with optimizations. This command will create an executable in target/release instead of target/debug. The optimizations make your Rust code run faster, but turning them on lengthens the time it takes for your program to compile.

Rustfmt ensures a consistent coding style across developers so no need to have a separate linter for Rust codebase and this comes out of the box the day you install Rust.

Also unit testing is just built-in along with the core Rust compiler.

All in all it checks so many of the downsides which C and C++ developers face making it a really exciting alternative to give a try. Also the open source community is really active with already 120k+ commits and 30k issues resolved/closed. This is huge compared to any large and popular open source repos on GitHub.

--

--

Madhuresh Gupta
Quick Code

Follows Microsoft, Tesla Motors, SpaceX, Google, Elon Musk. Aviation Admirer!