Why is Rust difficult? (2024)

Rust is considered difficult to learn by many people. Indeed, when I learned it,I considered it to be the hardest programming language up to that time I’ve met.And that says something, since I have a habit of learning whatever language Ifind interesting. Looking back, I’m not sure I was correct, C++ is probablyharder ‒ but it was distributed into much longer time than learning Rust.

So, this is my point of view what I believe are the reasons. Also, I’ll claimthis upfront ‒ I don’t consider it necessarily a bad thing for a language to behard to learn, not when I get something in return for the investment.

Rust attacks hard problems

There are languages that are simple. To point one of them, look atlua. The complete language manual is shorter thanintroductory book to most other languages. It has something like 4 or 5 datatypes and you can’t add your own. Why is it so?

Because lua, and other languages, made different choices about what their goalsare. If you start designing a language with the intention of creating a verysimple and minimal language, you will end up with a very simple and minimallanguage (if you’re any good at designing languages). The language may not besuitable in some situations, but that wasn’t the goal.

On the other hand, if you declare upfront that your language needs to be able tosolve any hard problem anyone thinks of, run fast and be safe to use then you’llprobably get your wish, but it’ll hardly be simple.

And that’s what the authors of Rust decided. To be able to do whatever is neededdone. But Rust is not the only complex language because of that. Look at C++ ‒Rust at least keeps the complexity somewhat sane.

However, this is difficulty that anyone trying to enter the low-level world ofsystem programming should expect. All these details about where a memory isallocated, how much memory it takes, that were not important in other languagessuddenly surface. But that’s because you need the control, isn’t it? Otherwise,you would use the simple language, as it would be sufficient.

The language is honest

This is similar to the above, but not completely.

When the language designers want to solve a problem, there are two generalapproaches.

First one is to hide the problem from sight and let the language handle itsomehow. The fact it isn’t always the best way doesn’t matter.

The other approach is being honest about the complexity of the problem, admitit, but arm the programmer with tools to handle it.

This means the beginner must grasp the complete complexity of the problem, butmakes it easier in the long term ‒ simply because after solving the problems,there’s no beginner any more and because sometimes having the needed tools andnot fighting the language to get to the problem is just easier.

Rust is different

One of the problems why I found Rust hard to learn was that it looked similar toother imperative languages on one side, but introduced a lot of novel concepts.It has all these cycles, conditions, functions, like everyone else. But it alsohas the ownerships and traits and lifetimes. These do have its reasons, but theyfeel alien at first ‒ but not alien enough to completely switch mental models.But that also make the language interesting.

What I mean about switching mental models. If you coded in Python and then triedHaskell, you’d see at the first glance than nothing is the same. But withRust, I started to code like I did in C++, because it looked a bit like C++. Putsome callbacks here and there… and then the compiler complained, because suchmodel doesn’t fit. I tried to force it and after a time I got a really hairyAPI I didn’t like a bit.

The problem here is two-fold:

  • It is not clear upfront the language is different than whatever else one mightalready know and that the other knowledge needs to be put on a shelf for awhile.
  • There are many books about good design in the OOP world, many books andclasses how to structure a program in pure functional world. But not many(none?) books about best practices for a world based on ownership andcomposition.

The compiler is a very strict teacher

All things together, Rust insists that your program will be correct or it won’tcompile. Strict typing makes you think about the relations in your program. Itchecks that you don’t get data races. It will tell you if you try to free somememory too soon.

This is a good thing. It makes sure your programs are better than of thecompetition (if you manage to compile them, of course), that they are lesslikely to crash and burn or something even worse. It makes the language easierto use (imagine if you had to actively think about all these things insteadof relying on the compiler to check it for you ‒ welcome to C).

But at the same time, it makes learning it a bit harder, because it insists onyou learning everything needed to write a good program. An average is notacceptable.

If you just learned about how to write a function, it doesn’t feel veryencouraging when the compiler starts to talk about data races (what are these,anyway, you ask at the time). A program that is subtly wrong would be fine atthat time ‒ at least it would run.

But in the long run this makes you a much better programmer. Even in otherlanguages.

Today, there’s a lot of very good documentation about this ‒ it at leastexplains why such things are incorrect and how to fix them.

People say it’s hard

This one comes down to perception. If so many people say Rust is hard to learn,then it must be true. The fact they learned in times when there was no or littledocumentation doesn’t change a thing here.

What to do about it

Documentation and resources help a long way. However, I believe the biggestissue is perception and expectations.

So, if someone asks (or if you’re considering learning Rust and ask yourself):yes, Rust is hard to learn. But not necessarily slow to learn. A month or soof experimenting in the evenings after work goes a long way. By that time, youprobably could start contributing to the Rust compiler itself, with some littlehelp ‒ and compilers are one of the most complex pieces of software that exist.

What should a beginner in Rust expect:

  • Some frustration that his or her programs don’t compile on the first (ortenth) attempt.
  • Having to understand a lot of problems not known to exist before.
  • Satisfaction after discovering how much can be learned with a very strictteacher and probably enjoyment from the learning itself.
  • Find the language different and interesting.
  • Becoming a better programmer, even in other languages (for example, ownershipis just formalisation what most people do in languages with manual memorymanagement anyway, but Rust makes sure it becomes second nature).
  • Meeting some very nice people in the community.
  • Discovering that it’s possible to both write and run programs fast at the sametime instead of having to choose.
Why is Rust difficult? (2024)

FAQs

Why is Rust so hard to learn? ›

The compiler is a very strict teacher

All things together, Rust insists that your program will be correct or it won't compile. Strict typing makes you think about the relations in your program. It checks that you don't get data races. It will tell you if you try to free some memory too soon.

Is Rust a hard game? ›

Rust can be a difficult game to start out in, so we compiled a list of tips to help beginners get on the right track. When venturing into any new survival-crafting game, players will need as many tips as possible to survive their first night, let alone any additional time spent in the wilderness.

Is Rust beginner friendly? ›

Rust is for low-level systems programming and it is useful for developers conscious of memory safety and performance. For beginners, it can be pretty tricky to learn but it will still only take a couple of weeks if you already have some familiarity with coding – or a little bit longer if you're a total novice.

Is Rust getting too complicated? ›

Rust is a difficult programming language to learn

When asked 'what are your biggest worries for the future of Rust? ' the majority (43%) were worried about Rust becoming too complex at 43% — up from 37% in 2022.

Can I learn Rust in 2 weeks? ›

> It took me probably more like 1-2 months to really understand how to code in Rust. I do not think a typical team of JS/Python devs would be productive in 3 weeks. I think it would be more like 3 months. Our very first Rust project (to learn the language) was a path tracer that was done (fully functional) in 2 weeks.

Is Rust as complex as C++? ›

As a result, it can take longer to write C++ code. However, while it might be quicker to write Rust programs than C++ programs, this only applies to skilled developers. Both Rust and C++ are complex languages with a high learning curve.

Why don't more people use Rust? ›

It falls in the same category as C or C++. People usually don't have to make use of C/C++ or any systems engineering language that often. Rust is relatively new and doesn't have higher level abstractions for it. It barely has a fully functional HTTP server abstraction.

Is Rust really faster than C++? ›

It is difficult to compare the two languages in terms of speed and performance directly. Generally speaking, Rust and C++ are comparable in terms of overall speed and performance, but when we take into account unbiased benchmarking, there are many instances in which Rust will perform even better than its counterpart.

Is it possible to play Rust solo? ›

Players can enjoy Rust solo on PC or console by hosting or renting dedicated servers. Joining inactive Rust servers can simulate a single-player experience with no extra effort or cost.

What is the average age for Rust players? ›

The average age of a player is between 17 and 40 years.

Is Rust worth it for solo players? ›

Rust can be a foreboding challenge for players as they are overwhelmed with threats to their survival. It is tough enough to play with a group of friends, never mind attempting to play solo. But it is not impossible to venture out alone. It just requires a lot of planning and vigilance.

How long does it take to learn Rust? ›

However, a very rough rule of thumb is that 3-6 months of learning and coding in Rust would usually be expected to be enough for an already experienced developer to reach a solid intermediate level and be able to work on commercial projects.

Is Rust losing popularity? ›

Growing popularity of Rust development services in numbers

SlashData has identified Rust as the fastest-growing language community. Rust also moved from 14th to 12th place in SlashData's ranking of programming languages in just six months.

Why is Rust not good? ›

Rust isn't particularly good at correctness of programs compared to something like Agda, but it is much easier to write Rust programs than Agda programs. The sides of the tradeoff are problem domain complexity, runtime cost, programmer effort, and compile-time cost.

Why is Rust so much fun? ›

The game is not like other games, it leaves players with a sense of routine. It's also hard to get bored when Rust offers different types of weapons, items, and tools to use in its game world! Secondly, Rust has great graphics for an online video game.

Is Rust harder to learn than Python? ›

In general, Python provides a simpler development experience and is easier to get started with. When comparing Rust or Python, it is evident that Python is more beginner-friendly due to its simpler syntax and abundant resources.

Is Rust harder to learn than Go? ›

While Go is relatively easier than Rust, it has a steeper learning curve than other languages like JavaScript and Python.

Is it hard to learn Rust if I know C++? ›

So yes, learning Rust may not be trivial but for sure if you are competent at C++ then Rust should not be a huge challenge. A major concern when learning and using a new language is getting to grips with the huge array of libraries one is likely to want to use. The whole ecosystem of the thing.

Top Articles
January Blog Income Report: How I Made $6,790.93 Blogging
Are Your Investments Safe with Robinhood?
Kreme Delite Menu
Week 2 Defense (DEF) Streamers, Starters & Rankings: 2024 Fantasy Tiers, Rankings
Cooking Chutney | Ask Nigella.com
Coverage of the introduction of the Water (Special Measures) Bill
Unitedhealthcare Hwp
oklahoma city for sale "new tulsa" - craigslist
South Carolina defeats Caitlin Clark and Iowa to win national championship and complete perfect season
Ogeechee Tech Blackboard
Craigslist Phoenix Cars By Owner Only
Facebook Marketplace Charlottesville
People Portal Loma Linda
Hca Florida Middleburg Emergency Reviews
Cvs Appointment For Booster Shot
Procore Championship 2024 - PGA TOUR Golf Leaderboard | ESPN
Cyndaquil Gen 4 Learnset
Der Megatrend Urbanisierung
Nick Pulos Height, Age, Net Worth, Girlfriend, Stunt Actor
Ukc Message Board
CDL Rostermania 2023-2024 | News, Rumors & Every Confirmed Roster
EASYfelt Plafondeiland
Evil Dead Rise Showtimes Near Regal Sawgrass & Imax
Azur Lane High Efficiency Combat Logistics Plan
Like Some Annoyed Drivers Wsj Crossword
Magic Seaweed Daytona
T Mobile Rival Crossword Clue
Mals Crazy Crab
Cor Triatriatum: Background, Pathophysiology, Epidemiology
Encore Atlanta Cheer Competition
Remnants of Filth: Yuwu (Novel) Vol. 4
HP PARTSURFER - spare part search portal
Dl.high Stakes Sweeps Download
Ugly Daughter From Grown Ups
Franklin Villafuerte Osorio
Does Circle K Sell Elf Bars
Mumu Player Pokemon Go
Gina's Pizza Port Charlotte Fl
P3P Orthrus With Dodge Slash
Craigs List Jonesboro Ar
8005607994
How are you feeling? Vocabulary & expressions to answer this common question!
The Minneapolis Journal from Minneapolis, Minnesota
Koninklijk Theater Tuschinski
Leena Snoubar Net Worth
Bcy Testing Solution Columbia Sc
Rhode Island High School Sports News & Headlines| Providence Journal
Cuckold Gonewildaudio
Southwest Airlines Departures Atlanta
Server Jobs Near
Research Tome Neltharus
How to Get a Check Stub From Money Network
Latest Posts
Article information

Author: Eusebia Nader

Last Updated:

Views: 5866

Rating: 5 / 5 (60 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Eusebia Nader

Birthday: 1994-11-11

Address: Apt. 721 977 Ebert Meadows, Jereville, GA 73618-6603

Phone: +2316203969400

Job: International Farming Consultant

Hobby: Reading, Photography, Shooting, Singing, Magic, Kayaking, Mushroom hunting

Introduction: My name is Eusebia Nader, I am a encouraging, brainy, lively, nice, famous, healthy, clever person who loves writing and wants to share my knowledge and understanding with you.