DEV Community

Cover image for How a Language Made Me Cry Before I Even Started Learning It
Prasoon Jadon for The Third Cup

Posted on Edited on

How a Language Made Me Cry Before I Even Started Learning It

I've never worked with C, C++, or Rust before. My programming experience has mostly been around Kotlin and C#. I've also spent quite some time exploring web development and Python.

But recently, while scrolling through DEV, I came across a few articles that filled my heart with curiosity. Unfortunately, none of them warned me about what was waiting ahead.

The first one was from DEV's co-founder, Ben, who was discussing some interesting loops created using Rust. I found it fascinating, although I had a hard time understanding what was happening.

Then I encountered a Rust tutorial by one of my fellow developers and one of my favourite creators on DEV, @nyaomaru.

And that's when I made up my mind.

I was going to learn Rust.

Little did I know that this decision would become a nightmare. Seriously, bro.

Installation: Where the Nightmare Begins

I went to the official Rust website and downloaded the installer.

Everything seemed pretty straightforward until I clicked the .exe file.

PowerShell opened.

And suddenly, I was staring at a screen full of text that I didn't really understand.

It's not something new for me. The same thing happens when I sit in an examination hall, open the question paper, and wonder what exactly I'm supposed to do.

I guess it's common when you've spent most of your time working with web technologies and Python.

Think about JavaScript. You don't even need to install it separately to start writing client-side code in a browser. For frameworks and server-side development, you install Node.js, and things are relatively straightforward.

But Rust?

Well, Rust had a different plan.

I pressed Enter. Then Enter again.

And finally, I was happy.

Rust was downloading!

But what happened next turned my happiness into a sad emoji.

The First Hello World

After installation, I opened the official Rust book and copied the classic Hello, World! program.

I thought I'd check whether everything was working before writing something of my own. After all, the actual learning process was supposed to start after this little test.

I opened VS Code, created a folder, made a .rs file, and pasted the code.

Then I opened the terminal and typed:

rustc hello.rs
Enter fullscreen mode Exit fullscreen mode


`

BOOM!

An error.

I had absolutely no idea what it meant.

I searched for the error in the Rust book, but couldn't find anything that helped me understand what was going wrong.

And then I had to approach my competitor.

Yes, ChatGPT.

I explained everything, and it calmly told me that I needed Microsoft's C++ Build Tools and the Windows SDK for the Windows MSVC toolchain.

I literally opened my mouth and closed it.

There were things I wanted to say, but I don't think the entire developer community would appreciate reading them here.

1.68 GB. Seriously?

Anyway, I did what I was told.

After searching around, I found the required development tools and started downloading them.

The download size?

1.68 GB.

Bro, my favourite game is around 2 GB.

I haven't even downloaded that game, and here I am downloading almost an entire game's worth of development tools just to run Hello World.

Tsk, tsk, tsk.

But I took a deep breath and let the download finish.

Once everything was installed, I tried compiling the program again.

This time, it worked!

The compiler generated an executable file, and I had to run it separately:


.\hello.exe
markdown

Wait, what?

I wasn't expecting this either.

Enter Cargo

After a little more searching, I came across Cargo.

Apparently, Cargo is Rust's build system and package manager. It makes managing Rust projects much easier.

That sounded familiar.

I remembered npm init from my JavaScript days.

So I tried:


cargo init
plaintext

And finally, something made sense!

Cargo created an entire project structure for me, including a Cargo.toml file and a src folder containing main.rs.

I moved my Hello World code into src/main.rs and ran:


cargo run

And...

IT WORKED!

Finally, a smile.

After all that installation drama, I had successfully run my first Rust program.

The Real Learning Hasn't Even Started

Interestingly, the syntax itself doesn't seem that difficult to understand.

At least, that's what I think so far.

But the installation process? That's another story.

I came to DEV because a few articles made me curious about Rust. I wanted to understand the language, explore its features, and eventually write something with it.

Instead, before learning a single concept about ownership or borrowing, I found myself learning about installers, SDKs, executables, Cargo, and project initialization.

Maybe that's just part of exploring a new ecosystem.

I haven't really learned Rust yet, but Rust has already tested my patience.

And now, after all this drama, I think I'm finally ready to begin.

Wish me luck. I have a feeling I'll need it.

Top comments (5)

Collapse
 
nyaomaru profile image
nyaomaru The Third Cup •

That's a great first step!! πŸ˜ΈπŸ’š

Setting up a development environment can be frustrating, especially when you're unfamiliar with the language. But I think overcoming those little obstacles is an important part of learning itself!

I'm still learning Rust too, so let's enjoy the journey and keep learning together! πŸ¦€πŸš€
And I'm really happy that my article inspired you to get started! 😸

Collapse
 
xulingfeng profile image
xulingfeng The Third Cup •

Haha, look who's back! Your second story already? That's a lovely surprise. πŸ˜„

Glad to have you back at The Third Cup, Prasoon. Pull up a chair, take your time, and tell us what's been happening. There's always a fresh cup waiting for you here. No rush, no agenda. Just good stories and coffee. β˜•

Collapse
 
nullandvoid_ profile image
Jyanthi The Third Cup •

A rather relatable predicament! It is curious how the journey of mastering a new language may test one's patience long before the first line of code is written. Yet, such initial tribulations often make the eventual triumph all the more gratifying. Methinks, perseverance is the first skill every aspiring developer must cultivate, long before mastering the intricacies of the language itself.

Collapse
 
leob profile image
leob The Third Cup • • Edited

Nice to read about your Rust "adventure"!

The 1.68 GB download is definitely not very good "DX" (developer experience) ...

But, I promise you that installing/compiling/running is NOT the hardest part of learning Rust - and even learning the syntax isn't the most difficult part ...

Then what is the most difficult aspect? I'm mentioning just 2 words - "ownership" and "borrowing" ...

What's also pretty challenging is that Rust doesn't really "do" classical OO, and that it contains a heavy dose of FP (Functional Programming) ...

I wish you luck indeed!

Collapse
 
olegkhorev profile image
Oleg Khorev The Third Cup •

I was trying to help the customer with React Native after around 20 years of coding with PHP, jQuery, HTML, CSS. It was a big challenge for me.