Learning Rust for the 40 year old Jr. Dev

Learning Rust for the 40 year old Jr. Dev

When any of us are learning a new skill, be it backend development or programming (both of which I decided I needed to learn as I approached the age of 40), I believe it is important to give ourselves the grace to learn. This is code for: allow yourself to try and fail, fail and try, adjust and overcome. While this sounds so obvious, it feels counter-intuitive while in-frame. It is when we zoom out that all of this makes sense and seems so logical - but just like children, we sometimes only believe what we can see at the moment.

By giving myself the grace to swing and miss, I have had the greatest adventures of my life building myself from nothing - the stripped away, bare self I started from - after I destroyed my former self. I outlasted the old me, and grew into what I am now - and I will always be growing, evolving, forever. I am preparing to take a coding exam to see if I can get into Polkadot Academy - blockchain specialization and as I continue to build myself into my new profession as a backend developer, I have found Rust programming incredibly useful for several reasons:

Rust is a compiled language that 's directly translated to machine code, which gives us higher performance and speed in comparison to Python.

Rust's zero-cost abstractions & efficient memory management allow developers to optimize sections of code without sacrificing safety.

The Ownership Model and Strict Compile-Time checks help prevent common memory-related madness issues like: null pointer dereferences, buffer overflows and data races. Python relies on GIL- Global Interpreter Lock, which limits true concurrency.

Rust's error handling mechanism is more developer friendly than python. Rust will return a value when an error is found and provides us suggestions on how to fix it -- Python just tells you there is an error. This allows us to address errors faster and creates a faster paced development environment.

The low-level control over memory management and system level operations allows developers to optimize for performance and resource utilization.

And Rust is more secure. Rust's emphasis on memory safety and its compile-time guarantees make it a more secure choice for building applications, especially those that handle sensitive data or operate in critical environments.

Rust's safety features help prevent common vulnerabilities like buffer overflows and data races, which can be more difficult to address in languages like Python.

Rust's focus on concurrency and safety makes it a natural fit for building the high-performance, reliable, and secure backend systems that blockchain applications demand. Its ownership model and fearless concurrency features enable us to write concurrent code with confidence, handling the massive transaction volumes and data processing needs of blockchain networks.

More importantly, in my opinion, Rust's emphasis on memory safety helps prevent the common vulnerabilities that can plague blockchain applications, ensuring the integrity and robustness of our codebase. And as we build ourselves into this new profession, Rust's interoperability with other languages, like C and C++, allows us to leverage existing libraries and frameworks, further expanding our toolset and accelerating our growth.

But perhaps most importantly, Rust's growing ecosystem and supportive community provide us with the resources and guidance we need to navigate this new frontier. Whether we're building custom blockchains with Substrate or deploying Rust-based components on the web through WebAssembly, the Rust ecosystem empowers us to tackle the unique challenges of blockchain development with confidence and efficiency. By embracing Rust and its principles of performance, safety, and scalability, we can truly transform ourselves and build the backend solutions that will power the next generation of blockchain-based applications.

Overall, Rust programming offers backend developers like myself a powerful combination of performance, safety, and scalability, enabling us to build fast, reliable, and secure backend services that meet the demands of modern applications. Whether you're working on web applications, APIs, or distributed systems, Rust empowers you to tackle complex backend challenges with confidence and efficiency, just as I have found in my own journey of learning and growth.

Performance: Rust offers performance comparable to low-level languages like C and C++, making it ideal for building high-performance backend systems. Its zero-cost abstractions and efficient memory management enable you to optimize critical sections of code without sacrificing safety.

Concurrency: Rust's ownership system and fearless concurrency model allow you to write concurrent code with confidence. You can easily leverage multiple threads and asynchronous programming techniques to build scalable and responsive backend services, handling thousands of requests concurrently without the overhead of a Global Interpreter Lock (GIL) like in Python.

Safety: Rust's emphasis on safety makes it particularly appealing for backend development, where reliability and security are paramount. The compiler enforces strict rules at compile-time to prevent common pitfalls like null pointer dereferencing, buffer overflows, and data races, resulting in more robust and predictable software.

Ecosystem: Rust's growing ecosystem of libraries and frameworks cater to a wide range of backend development needs, from web servers and database connectors to cloud infrastructure and distributed systems. With tools like Rocket for web development, Diesel for database access, and Actix for building asynchronous applications, you have everything you need to build modern, efficient backend services in Rust.

Interoperability: Rust's interoperability with other languages, particularly C and Python, allows you to seamlessly integrate with existing codebases and leverage existing libraries and frameworks. Whether you're building micro-services in Rust or adding performance-critical components to an existing system, Rust's interoperability ensures compatibility and ease of integration.

Learning Rust is not an overnight deal. Not for me anyway. I find the error handling to be extremely helpful, as well as frightening depending on the way my coding session has been going. I chuckle to myself as I write that. Rust is very different from Python. And now that I have built a few minor programs and games, I appreciate the complexity of Rust. There is so much more I feel I know about programming, as opposed to the seeming simplicity of Python and the other higher level programming languages. This FEELS like programming to me, understanding much more than just what the code will do, but how to manage the code to truly optimize it. I feel I have advanced more in the last 2 weeks, than I have in the past year.

Rust has helped me go over a blockage I was facing. Not that I knew everything -- not at all -- but I feel I approach writing code differently now. In the next article I will break down a 'simple' program in Rust, and lay down the intro to a hackathon I am entering: Chianlink Block Magic on April 29th 2024.