Combating AI coding atrophy with Rust - Kaushik Gopal's Website
Combating AI coding atrophy with Rust
It’s no secret that I’ve fully embraced AI for my coding. A valid
concern (and one I’ve been thinking about deeply) is the atrophying of the
part of my brain that helps me code.
To push back on that, I’ve been learning Rust on the
side for the last few months. I am absolutely loving it.
Why Rust?
Systems level language
Kotlin remains my go-to language. It’s the language I know like the back of my
hand. If someone sends me a swath of Kotlin code, whether handwritten or AI
generated, I can quickly grok it and form a strong opinion on how to improve it.
But Kotlin is a high-level language that runs on a JVM. There are structural
limits to the performance you can eke out of it, and for most of my career1
I’ve worked with garbage-collected languages.
For a change, I wanted a systems-level language, one without the training wheels
of a garbage collector.
New paradigms
I also wanted a language with a different core philosophy, something that would
force me to think in new ways.
I picked up Go casually but it didn’t feel like a big enough departure from the
languages I already knew.
It just felt more useful to ask AI to generate Go code than to learn it
myself.
With Rust, I could get code translated, but then I’d stare at the generated code
and realize I was missing some core concepts and fundamentals. I loved that!
The first time I hit a lifetime error, I had no mental model for it. That
confusion was exactly what I was looking for.
Coming from a GC world, memory management is an afterthought — if it requires
any thought at all. Rust really pushes you to think through the ownership and
lifespan of your data, every step of the way.
In a bizarre way, AI made this gap obvious. It showed me where I didn’t
understand things and pointed me toward something worth learning.
Built with Rust
Here’s some software that’s either built entirely in Rust or uses it in
fundamental ways:
Many of the most important tools I use daily are built with Rust. Can’t hurt to
know the language they’re written in.
Kotlin developers will feel at home
Rust is quite similar to Kotlin in many ways. Both use strict static typing with
advanced type inference. Both support null safety and provide compile-time
guarantees.
The compile-time strictness and higher-level constructs made it fairly easy for
me to pick up the basics. Syntactically, it feels very familiar.
How I’m learning Rust
I started by rewriting a couple of small CLI tools I used to keep in Bash or Go.
Even in these tiny programs, the borrow checker forced me to be clear about who
owns what and when data goes away. It can be quite the mental workout at times,
which is perfect for keeping that atrophy from setting in.
After that, I started to graduate to slightly larger programs and small
services.
Main Resources
There are two main resources I keep coming back to:
Using AI as a Rust tutor
There are times when the book or course mentions a concept and I want to go
deeper. Typically, I’d spend time googling, searching Stack Overflow, finding
references, diving into code snippets, and trying to clear up small nuances.
But that’s changed dramatically with AI. One of my early aha moments with AI was
how easy it made ramping up on code. The same is true for learning a new
language like Rust.
For example, what’s the difference2 between these two:
Another thing I loved doing is asking AI: what are some idiomatic ways people
use these concepts? Here’s a prompt I gave Gemini while learning:
Here’s an abbreviated response (the full response was incredibly useful):
It’s easy to be doom and gloom about AI in coding — the “we’ll all forget how to
program” anxiety is real. But I hope this offers a more hopeful perspective.
If you’re an experienced developer worried about skill atrophy, learn a language
that forces you to think differently. AI can help you cross that gap faster. Use
it as a tutor, not just a code generator.
I did a little C/C++ in high school, but nowhere close to proficiency. ↩︎
Think mutable var to a “shared reference” vs. immutable var to an “exclusive
reference”. ↩︎
Comments via 🦋