DEV Community

Cover image for Why I'm Learning Rust
Brett Codes
Brett Codes

Posted on

Why I'm Learning Rust

I keep asking myself: Why learn Rust when there are so many other languages I could learn? Why not learn Go instead? Everyone seems to pit them against each other. Why not double-down on TypeScript? Why even bother learning a new language or framework if it's unlikely I'll get to use it for anything aside from hobby projects?

These questions are valid ones, but they are based upon a flawed premise. It is 100% okay for someone to learn anything without any good reason! Learning can be purely just for fun, based on a hunch, based on an intuition. So while I don't have great answers to those questions, I at least have some hopes and dreams and a few motivating factors.

Why Rust

My first programming language was Java. My computer science teacher in high school made us print out our code to grade it. I'm not sure why, but that's what he wanted.

Then I started programming in C# because XNA (Microsoft's game engine for indie Xbox 360 development) required it. Then I dabbled in ActionScript 3 for Flash programming, C++ for college classes, a bit of PHP, and somehow landed on using Ruby and JavaScript. Then 10 years flew by. Strange how time works. I've dabbled a bit here and there. A little Go. A little Haxe. But nothing aside from a few weeks or months of experimenting.

As I've grown as a developer, I've found myself longing to get a bit lower level. I'm thinking a lot more about performance and memory. I'm a bit tired of the slowness and memory usage of Ruby (and Rails). Sure, they work and are mature. But they are, in many ways, resource hogs. They don't encourage thinking about program structure and correctness. Performance just seems like less of a priority and concern. But I'd like to write more performant code. I'd like to understand threading and memory usage more. I'd like to build cross-platform tools and games and code.

The thought of writing lower level code that isn't C or C++ is appealing. I enjoyed coding in those languages over a decade ago, but they felt dated in many ways, like writing separate header files. It's been too long for me to have any salient thoughts on them thought. 😅

Also, through TypeScript, I've been re-exposed to the joys of statically typed languages. Having a great language server with types increases confidence with coding and is much more ergonomic than having to look at the docs online whenever one wants to look something up. The idea of a performant, strongly-typed, modern language is extremely appealing!

I'm also continually annoyed by dealing with nil errors in Ruby and null and and undefined errors in JavaScript. I understand why they exist, and they can be manageable, but to think that there's another way is interesting to me.

Programming Beyond the Web

I've primarily done web application development for the last 13 years. It's enjoyable and ever-changing. But I'd like to do some other types of programming too. There are only so many web forms you can build before it begins to feel a bit rote. Game dev, desktop GUIs, command line tools, networking code—Rust seems like a great for all of them. There's so much breadth to the types of programming out there that it feels like I've barely scratched the surface.

The Promise of Polyglot

While there will surely be a bit of overhead of context switching between languages, I think learning a variety of languages will make me a better programmer over all. Rust, so far, seems like it will help me reframe how I think about programs and write my code. That's major! Breaking out of the paradigms of a language and come back with a fresh perspective can be really valuable.

Is Learning Rust Good for My Career?

Without question, learning a new language is good for anyone's career because you're learning something new and being exposed to other types of programming. Whether or not I'll ever have a full-time job programming Rust or that I'd even want to do that remains to be seen.

I'm curious to see how Rust feels for building APIs and web applications. That'll be really interesting coming from Rails and Ruby. I'm not sure of the maturity there yet or what to expect.

But I'd be willing to bet that we'll continue to see more widespread usage of Rust. Even in just the last few years where I've casually followed it, its usage has continued to grow. It's also matured, has a solid package manager, great docs, and a wonderful community. It doesn't seem destined for obscurity. It, in so many ways, seems like an ideal language to have in one's toolkit.

What I've Done So Far

Hopes & Dreams

I'd really like to use Rust for building some significant hobby projects! That's my goal at least. We'll see how it goes. Early learning and progress has been promising. I've been enjoying it. It's been clicking. I've got ideas for what I want to build (collected in Projectbook).

I'm gonna get to it! I'll share what I learn, what I make, and how it's going.

Top comments (1)

Collapse
 
ferceg profile image
ferceg

I can relate to this post, I do PHP BE programming in my work and minimal native Android programming in Java, but my brain needs to do different things sometimes and for me Rust/Flutter/C64 assembly are great for that because they represent a completely different paradigm compared to usual web BE programming.