r/AskProgramming • • Oct 10 '26

Other Should I learn Rust or C++ as a beginner?

So I'm a beginner programmer, I've dabbled in it for a bit, tried many languages over the years but got stuck in tutorial hell every time and quit. I want to be serious this time around.

I'm strictly a FOR-FUN hobbyist, interested in Emulator dev, Graphics/Physics engine dev, and Low Level stuff like writing an OS. So which of these languages is better for me to learn?

I keep being warned that C++ gives you such a faulty sense of freedom that you can get to a point where you can spend months searching for a single faulty line to fix a bug because you made some tiny inconspicuous error (which Rust supposedly helps prevent). That sounds like....hell.

Yet I still see everyone using it. Is it really that bad?

3 Upvotes

67 comments sorted by

6

u/JGhostThing Oct 10 '26

I would suggest learning C first and getting *good* at it before even thinking about another language.

1

u/Alone_End5987 Oct 10 '26

But people go for C++ first all the time

1

u/robthablob Oct 11 '26

If you're going to go for C++, I'd recommend Stroustrup's Programming Principles and Practice using C++. https://www.stroustrup.com/programming.html. It's aimed at beginners and will introduce concepts from the language, concentrating on modern features that actually make the language easier. The third edition has been updated for C++ 20 and 23 so its also teaching the current state of the language.

1

u/rew150 Oct 12 '26

Most of the time it actually mean C with a sprinkle of qol features from C++.

1

u/RandomDude9943 Oct 14 '26

i learned c++ after python, c# and all of that bs, to harness its full potential i had to basically learn from zero

1

u/JGhostThing Oct 10 '26

Yes. I still suggest C, not C++. C is a fairly simple language. C++ adds a lot of extra stuff. Yes, I have used it, but I much prefer Java to C++.

I'm learning rust now.

0

u/TheMcDucky Oct 10 '26

C is like a complete, well-rounded language that can build just about anything, and you can gain a fairly complete understanding of its features and syntax in not too long of a time period. C++ is that plus a mountain of additional features. Each project you see is going to use a different selection of those feature. Not only is learning C going to come with less unnecessary confusion, but it's also a very good first step to learning the fundamentals of C++, which you can always do later if you want.

2

u/[deleted] Oct 11 '26

[removed] — view removed comment

1

u/Alone_End5987 Oct 11 '26

It's not wrong, they absolutely do

4

u/Several_Version4298 Oct 10 '26 edited Oct 10 '26

There is no such thing as tutorial hell, it's just procrastination. Look up what you need to learn in the tutorial then just write the code and make it work.

If you haven't stuck at Python then that is good language for a beginner. C which is used for OS and engines and embedded code, is the base of C++. and will teach you what you code is really doing, or Golang are easier for beginners.

-2

u/Alone_End5987 Oct 10 '26 edited Oct 11 '26

Nobody said it wasn't procrastination lol.

And I thought I could learn C++ immediately and skip C.

5

u/HouseOfWyrd Oct 10 '26

As a beginner?

Neither imo, but of those two Rust.

1

u/Alone_End5987 Oct 10 '26

Why Rust?

2

u/HouseOfWyrd Oct 10 '26 edited Oct 10 '26

Because it's ever so slightly less difficult to work with than c++ long term.

Neither are good beginner languages due to lack of automated garbage collection.

If you can't get out of tutorial hell with Python or JS you're not getting out of it with Rust.

2

u/scorchpork Oct 10 '26

You don't need garbage collection until you start handling pointers, and by that time, you are actually learning how your memory is allocated. I found c++ was easier to understand the behavior than .net and java as a beginner. A lot of jave and .net is basically magic that can bite you if you never learn what is going on under the hood.

1

u/TheMcDucky Oct 10 '26

Can you give an example of where a beginner or intermediate might run into trouble with the inner workings of Java? There are probably some places, but I can't imagine it being worse than C++

1

u/scorchpork Oct 11 '26

Not understanding the difference between structs and classes other than default access modifiers. Just an example. Not realizing classes are passed by reference. Not understanding the consequences of memory allocation or the benefits. Not understanding comparing references instead of comparing value equality. I mean, pointers are still there, they are just hidden.

1

u/TheMcDucky Oct 11 '26 edited Oct 11 '26

References and compare/copy by reference/value would be covered by any serious introductory Java course. Differentiating between structs and classes doesn't make much sense as Java doesn't have "structs". I don't see how C++ would give you any more appreciation for memory allocations or its consequences. There are many other reasons I'd recomment C over Java, but these are not those.

2

u/garagedragon Oct 10 '26

Amongst other things, the rust compiler will both catch more of your mistakes and be much more helpful explaining how to fix them.

1

u/Distinct-Brief9643 Oct 14 '26

Rust is way safer c++ has LOTS of memory leaks c++ syntax is quite unorganized (I've heard not my opinion) rust has modern syntax

But still learn a high lvl systems programing lang I repeat HIGH LVL it's way easier to learn it will let you learn faster for example python, ocaml, Haskell,

Haskell to me is still hard to understand

3

u/Substantial-Swan7065 Oct 10 '26

Neither. You will hate you’re life and programming

1

u/Alone_End5987 Oct 10 '26

What? Why?

4

u/Dazzling_Music_2411 Oct 11 '26

Because they are extremely demanding as languages.

If you found yourself stuck in "tutorial hell" with simple stuff, these will have you rushing to jump out of the window.

You have some high ambitions. You mention Games Engines and OSs. Learn C. That will set you up on your way. AFTER that learn whatever you like, Rust, C++, Nim, or whatever's going.

But learn C first. No ifs or buts. That's the serious approach. Anything else would be a bit of a joke. If you can't master C relatively easily, then OSs and Games Engines are not for you.

1

u/Alone_End5987 Oct 11 '26

But C isn't just a gentler intriduction to C++, it has no RAII, no smart pointers, no bounds-checked containers.

And C also doesn't teach you modern C++ because idiomatic modern C++ (RAII, smart pointers, templates, STL) is a new paradigm built specifically to replace manual C.

1

u/Dazzling_Music_2411 Oct 11 '26

But C isn't just a gentler intriduction to C++,

Never said it was. Not remotely.
I agree that this is a common misconception.

What I said was that if the OP has an interest in Systems, Low-level and engines, etc, then, at his current stage of development, C is absolutely what he must learn.

Sort of an acid test, to see if that's what he's really interested in.

1

u/Substantial-Swan7065 Oct 11 '26

+1. The things OP listed are like the hardest possible domains

2

u/jibbit Oct 10 '26

the two worst possible choices

0

u/Alone_End5987 Oct 10 '26

Not for my use cases and preferences

10

u/kitsnet Oct 10 '26

Should I learn Rust or C++ as a beginner?

Python.

So I'm a beginner programmer, I've dabbled in it for a bit, tried many languages over the years but got stuck in tutorial hell every time and quit.

Neither Rust nor C++ would help you here.

4

u/-Zxro Oct 11 '26

i would argue that the hand holding from python hinders you when trying to learn new languages after, could just be me though

2

u/kitsnet Oct 11 '26

I would argue that it is more important for a beginner to be able to find and solve practical problems than to learn how the languages work.

7

u/CS_70 Oct 10 '26

If you want to get that road, start with C. The holy grail of programming languages imho.

1

u/VagueHorizon_ Oct 10 '26

C++ is super set of C, so it gives complete control over handling memory. It isn't something to get scare from, some people like complete control. RUST prevents those memory errors and won't let them reach compilation.

For your low level and embedded path, both C++ and RUST are excellent choices. If you don't like errors then go for RUST but then you wouldn't be able to get complete benefits of OOP principles. C++ is made for OOP, but it comes with handling everything on your own. OOP is just a small factor where I differentiate them. RUST on the other side give some sense of OOP through 'structs' but it is safe.

there are other factors through which you can differentiate them.

Anyways, it totally depends on you which type of system and programming sense you want, both C++ and RUST are capable of doing what you want to achieve.

I will suggest C++ only because you have learned other languages (as you mentioned).

If you have no idea how memory safety works or coming from Python or JavaScript background and not intending to focus on it, then absolutely go for RUST, you will love it.

1

u/Alone_End5987 Oct 10 '26

Thank you! That was really informative, I'll go with C++ then! And yeah I do care about memory safety, I want to improve my domain-relevant skills as much as I can.

1

u/rew150 Oct 11 '26

either C or python not Rust or C++

1

u/Alone_End5987 Oct 11 '26

Why

1

u/rew150 Oct 12 '26

C++ or Rust are too complex and feature-loaded. Those features are for real-world enterprise app, which do not benefit beginners. Beginners should learn how to solve a simple problem first. For that you need simple languages.

C is good because it's a simple low-level language, learn this if you want to learn C++ later.

python is good because you can make useful things fast while the code remain mostly simple. I would recommend this over C if you don't have plan to use C++

3

u/arllt89 Oct 10 '26

2 languages I always advise:

  • Python: very carefully thought language, powerful but no unnecessary fancy syntaxing, perfect for implementing algorithms or some advanced programs, has applications in an absurd amount of fields
  • C: old school language, what is the closest to how a computer actually works so you'll understand so much about your computer, while having the syntax of half of the languages of the planet, also can transition to the infamous but very interesting C++ from there

1

u/FunAd6672 Oct 11 '26

C is a great starting point for sure.

5

u/CauliflowerDue3339 Oct 10 '26

Having worked in industry as a C++ dev for a few years, I’ve never seen anyone “look for an inconspicuous LOC for months”. Modern C++ is much safer than C++99 was in that respect.
I personally think C is the best for a beginner, as it gives you an understanding of what’s actually happening that translates well to most others. That said, from what I’ve heard Rust is generally preferred to C++ by the community. C++ is an absolutely enormous language which can be quite overwhelming.

1

u/CappuccinoCodes Oct 10 '26

"I want to be serious this time around." "I'm strictly a FOR-FUN hobbyist". Huh?

0

u/Alone_End5987 Oct 10 '26

Being serious is fun.

1

u/VancouverVentilator Oct 10 '26

NOTE! READ THIS! Please do not choose rust as your first systems language. PLEASE get a grip for a C style language first. It's much much much easier to transition to Rust after familiarity with C++ - Rust is entirely filled with unintuitive patterns that will trip you up. Heed my advice brother, I'm extremely certain that learning Rust second is ideal. In response to this, crustaceans will surely argue "It doesn't matter which you learn first, all that matters is your willingness to learn". This is utter bull - you can learn anything you put the effort and reps into, but you will undoubtedly be learning for far longer if your icebreaker is Rust. Good luck.

0

u/Alone_End5987 Oct 10 '26

Thanks man, I appreciate it. I will be going for c++

1

u/VancouverVentilator Oct 11 '26

Awesome 👍 just get a semi decent grasp of how C and / or C++ works first and then learning Rust will make more sense. You'll understand why some of Rust's semantics do what they do under the hood. Don't listen to people trying to scare you away from C++. Learncpp teaches the basics and it's all you really need to get started. Veteran programmers can rant all day about the STL, rule of 5, rule of 0, RAII, SFINAE, etc, but you don't need to know any of that right now, you'll pick it up on the way. Rust is laden with just as many obstacles.

1

u/OrganicPause6530 Oct 11 '26

Neither, python is better tbh.

But from these two Rust, but it depends mostly on what you want to achieve with programming.

1

u/Alone_End5987 Oct 11 '26

I literally said it in the post

1

u/CatalonianBookseller Oct 11 '26

I literally said it in the post

Good, then you'll have no problem choosing which one to use

1

u/Alone_End5987 Oct 11 '26

You say that when there's 50 comments of prople giving different answers lol. "Do C" "No do Rust" "don't do rust do C++" "Zig is better" "lool, actually no, Python."

Good, then you'll have no problem choosing which one to use

This literally doesn't say or mean anything.

1

u/Distinct-Brief9643 Oct 14 '26

That true I think you should learn an high lvl systems programing language first then rust all tough I think if you learn c++ and c you'll get a grasp on many other system programing languages (not supporting c and c++) tho

2

u/BeginningPea5674 Oct 10 '26

just learn golang first

1

u/Familiar9709 Oct 10 '26

C++ of course. Or C.

1

u/Boot_Burner Oct 10 '26

I’m currently taking an Intro to C++ course. Not necessarily by choice but because I’m pursuing a certificate that requires it in order to then take a SQL course (don’t ask me why I don’t run the department or make these decisions). 

Before this class I had basically zero programming knowledge or experience but I do have a bachelors in hard science and a decade of experience in my previous field. So far I’ve enjoyed learning C++ as a conduit to programming concepts generally. Because I have no reference point with Python or whatever else, I don’t find it “hard” per se but I do see how it would get tedious and it doesn’t exactly feel super modern. 

If you are hoping to be a life long programmer with a career in industry you should probably learn a little C++ but overall find a more modern language to become proficient in. Ultimately, a lot of this will be reduced to AI so knowing the foundations of any language would be useful. I have friends working at AI companies who have told me they went from writing code every day of every week to just managing 5 different Claude tabs in the span of a year or two. So keep that in mind. Learn the rules before you break them. 

1

u/FirstTimeGamingTV Oct 10 '26

C++ probably, it’s what’s taught in schools at first because if you can understand C/C++ understanding the rest of the languages is pretty easy.

Rust is nice and very useful for what it’s good for, but you won’t benefit much from Rust over C++ as a beginner, and C++ can help you learn most concepts in cs.

1

u/PixelPacker Oct 10 '26

Unless you’re planning to be super serious about making a career of it’s probably best to avoid both.

Rust has designs that you won’t find in any other language and C/C++ will make learning the basics a lot harder.

I personally believe learning an easy language first and then moving to C is an easier pathway

1

u/KC918273645 Oct 11 '26

Rust makes you cry. C++ is better for beginner from those two. If if you're really a beginner, then I suggest something simpler first, for example C. Then when you get some experience with that, look at other languages. And don't follow stupid tutorials. Buy an actual book.

1

u/levyi123 Oct 11 '26

I would suggest C first.
Write simple programs and inspect them in https://godbolt.org/ to see how they translate to assembly.
Learn to read and understand basic assembly to really understand what's going on under the hood, this would get you to completely different level of understanding ;)

Once you can really understand some C code and how it roughly translate to instructions and how it's exectued, you can get into bit more "funny" stuff like C++ or rust :)

1

u/Distinct-Brief9643 Oct 14 '26

I think you should try rust but get familiar with programing with maybe an high lvl programing language like golang

Trust me I've tried rust A BEGINNER TUTORIAL I struggled so hard I rage quit coding wasent even fun tbh I don't like rust low lvl syntax I like high lvl syntax respond if you agree or something

1

u/Distinct-Brief9643 Oct 14 '26

If you really want c++ tell me how good you're doing?

1

u/Distinct-Brief9643 Oct 14 '26

Rust is also an safer more modern version of c++

1

u/Popular-Toe3698 Oct 15 '26

C++ is a complete pain but gives you more control and freedom. And I would absolutely suggest learning it BEFORE Rust.

1

u/AdCompetitive1256 Oct 15 '26

C++ is pretty much universal, is standardized, and has been around for a very long time. There are many C++ compilers and a ton of examples including open source software that you can learn from, even most embedded is programmed using C++. RUST is pretty new, a niche and a trend, and you know how it goes with trend.

That's just my personal opinion, though.

Ultimately, the choice is yours.

1

u/damster05 Oct 17 '26

The actual issue with C++ is the sheer complexity of the language. Many ways to do the same thing.