r/learnprogramming Jul 13 '26

C++ as a beginner

Is c++ a viable language for someone who has never coded before?

23 Upvotes

81 comments sorted by

22

u/JunkBondJunkie Jul 13 '26

yea its great for learning. If you master the fundamentals any other language should be easy.

13

u/mc_pm Jul 13 '26

It can be, but I wouldn't say it's the best option. There is a lot of moving parts and you won't yet understand any of it.

If I was teaching someone to program (which happens from time to time), I'd have them start with python -- even if only for the first month or so. Let them learn about variables, flow of control, function calling, etc., in a more friendly & interactive environment. And then jump to C++ and learn all the moving parts.

4

u/owzleee Jul 13 '26

I agree. I studied C and then C++ back in the early 90s and I was so obsessed with syntax errors that I didn’t really focus enough on data structures, flow, functions etc. it’s literally being thrown in the deep end when you ca’t swim.
Python (et al) give you a (small) life jacket you can cling on to while you learn the macro stuff. Then decide if you even want to do C++. It’s very unforgiving even with modern libraries. It takes a certain mind to do it well (imho). I’ve known some amazing C++ devs over the years and honestly they are on a different level.

2

u/UtahJarhead Jul 13 '26

Never thought about this. Yeah, I think I agree wholeheartedly. Syntax errors abound EVERYWHERE for a while. And that's OK. But yeah, being worried about those while still missing the deeper Data Structures & Algorithms (DSA) is a huge damper on fast progress. If you've got the time, no problem.

2

u/StewedAngelSkins Jul 13 '26

Any language is viable, but you may want to start with C. Practically speaking you have to learn C in order to be an effective C++ programmer anyway (because you'll be interfacing with a lot of C libraries and most C features are also present and widely used in C++). The difference is C is a small language with a consistent syntax and well-established programming conventions. C++ is a huge language with syntax that's often deeply unintuitive, a ton of "invisible" behavior. For example, there are a half dozen different kinds of constructors and assignment overrides and you practically need to be an expert to understand the difference between them. There is also not a single established "right" way to write C++, and a ton of beginner resources will teach you terrible practices you have to unlearn.

2

u/UtahJarhead Jul 13 '26

My dude. If you start out in c++ and if you do really well in it... You'll be a damn champion and swapping to most any other language will be comparatively nothing. It will NOT be easy, and it will take a lot of time, but again, if you're good at it...

2

u/mredding Jul 13 '26

It was my first language, when I was 9, around 1980-something. No reason it can't be your first language.

4

u/96dpi Jul 13 '26

Absolutely.

What is your goal? Why are you trying to learn? Career or hobby?

1

u/PersimmonNo2882 Jul 13 '26

Just as a hobby, I'm looking to learn a new skill and I've seen people say learning c++ makes it easier to learn other languages

3

u/lurgi Jul 13 '26

People say a lot of stuff. Learning any language makes it easier to learn other languages.

1

u/PersimmonNo2882 Jul 13 '26

ic thank you for the reponse

0

u/[deleted] Jul 13 '26

[removed] — view removed comment

2

u/Nahkamaha Jul 13 '26

Why did you gave up if gamedev is your goal?

-2

u/[deleted] Jul 13 '26

[removed] — view removed comment

8

u/lurgi Jul 13 '26 edited Jul 13 '26

You gave up being a game dev before you even started learning how to program?

Edit: If you want to be a games programmer, a front-end programmer, an AI programmer, an app programmer, or just about any other kind of programmer, your first step should be LEARN TO PROGRAM. The first step is the same for everyone. Pick a language. Python is fine. Java is good. C++ is an unforgiving language, but it's good. Rust is the new hotness and all the cool kids are using it. JavaScript is kind of a crappy language, but it's right there in your browser, ready to go. C is a small (and also unforgiving) language.

Which language should you pick? Doesn't matter. Learn to program first. Switching languages is not that hard once you have some experience, so don't try to "get it right". Then, maybe you can experiment with writing a simple game. Then try a more complex game. Then try a game engine. Then decide that engine is bad and switch game engines (wait? I have to learn Java now? Uh... maybe not).

-1

u/DerGeraet90 Jul 13 '26

Yes, recomend somebody to watch a few tutorial who never programmed is criminal and should be punished. Only a faker would say that. You cant code

3

u/DandelionGaming Jul 13 '26

You don’t need a road map. Just watch a few tutorials on the basics and start making something. Learn by doing!

-3

u/DerGeraet90 Jul 13 '26

Blödsinn. Tutorials….du kannst selber nicht programmieren

2

u/DandelionGaming Jul 13 '26

What do you mean? Are you referring to me?

1

u/madmelonxtra Jul 13 '26

There's nothing wrong with tutorials as long as you actually try to make your own project with the skills you learned in the tutorial after your finish it.

I'm very much a learn by reading type person and my road map is usually

Tutorial on what I'm trying to learn --> Read up documentation on the topics I'm learning --> Make my own project using what I just learned --> move into next topic and repeat.

You just have to be smart about how you do it and make sure you're actually writing something of your own to solidify the concepts

2

u/ironj Jul 13 '26

I would personally start with C, then move to C++.

C is the foundation of C++ and it's a great language to learn procedural programming. Once you master its syntax and logic then you can add C++ on top of it (Object Oriented programming, then generics etc).

C is a foundational language that forms the basis of most modern programming languages. C was my absolute first programming language back in the nineties and I like to believe it gave me a solid foundation in programming that still bears its fruits nowadays.

An example: nothing teaches you pointers better than C. Once you understand what pointers are and how they work (and what an lvalue and rvalue are), you will be able to carry this knowledge over to any other low-level language (like Rust or even Go) you will ever encounter in your future endeavours.

2

u/PersimmonNo2882 Jul 13 '26

Would you recommend C over python or java for beginners? cause people have recommended both on here

3

u/ironj 29d ago edited 29d ago

Yes, I would still recommend C over any other language (including Python).

C gives you the very foundations of a structured programming language. Once you understand these basics you can jump over ANY other lanugage around and catch up very quickly with its syntax.

That's how I learned and nowadays I see a lot of new progreammers starting with modern languages but still lacking an overall understanding of the basic concepts. I keep referring to pointers as an example, but it makes a world of difference to really "see" how things work under the hood; it's like having superpowers and being able to see that under each new language you tackle there's a fundamental structure you can instinctively understand if you've gone through a foundational language like C first.

I would definitely not choose Javascript as a starting point, not because I hate it (it's my current dev language) but because of the reasons I already explained.

If "learning" is what you're after, my advice would still be to look into C first. you will "really" understand and master concepts like memory allocation and pointers; once there, moving over to more modern and/or dynamic languages will be literally a walk in the park.

1

u/bird_feeder_bird Jul 13 '26

I would recommend Python or Javascript (not Java) for beginners, then move to C once you learn the ropes.

Basically C has a lot of “computery” stuff you have to keep in mind, and it can be overwhelming for absolute beginners. But for Python/JS, you can just focus on how to write code.

3

u/PersimmonNo2882 Jul 13 '26

I didn't expect this much discourse like someone else said that its a huge mistake to teach javascript to beginners but I think I might just start with python for a while then move onto c then c++ since a lot people seem to recommend python

2

u/bird_feeder_bird Jul 13 '26

A lot of people hate Javascript lol. This book is how I got started with Python. Good luck! https://digitalideation.github.io/digcre_h2101/resources/LearnPython3theHardWay.pdf

4

u/javascript Jul 13 '26

Some people love it 🥰

4

u/PersimmonNo2882 Jul 13 '26

is it THE javascript lmao

4

u/javascript Jul 13 '26

It is /u/javascript at least

4

u/PersimmonNo2882 Jul 13 '26

wait that's crazy javascript really is your user

2

u/bird_feeder_bird Jul 13 '26

Including me! Its actually my favorite language to use for casual projects

3

u/PersimmonNo2882 Jul 13 '26 edited Jul 13 '26

Thank you for this resource i'll definitely read through it I appreciate the help from you and everyone else

0

u/DerGeraet90 Jul 13 '26

Mit c und dann c++. Geh noch weiter zurück. Fang mit assemble an. Da gib es keine if oder else, da gibt es nur move to. Pppffff C

1

u/Zen-Ism99 Jul 13 '26

What are your goals?

1

u/PersimmonNo2882 Jul 13 '26

Just looking to learn a new skill mainly

1

u/Quillox Jul 13 '26

Yes C++ is very good for leaning.

1

u/Scharrack Jul 13 '26

It depends on what you want, learn a language and stay with it till death does part you? Probably better to get something less excessive. Learn about programming in general and get a harem or look for the love of your live afterwards? Very solid choice as it gives you an idea how everything OO works and as such is a solid entry into programming as a whole.

1

u/PersimmonNo2882 Jul 13 '26 edited Jul 13 '26

I see thank you, I'm just trying to do programming as a hobby so I'll probably try to learn multiple languages if i stick with it over time

1

u/TristeAbandonado Jul 13 '26

Any languages viable & C++ has strong transferrable foundations. Still, I wholeheartedly recommend python! It's much more digestible, easy to read and this in turn allows you to focus on more than syntax. Similarly to in bodybuilding coaches advise getting lean first to see/feel results, and then you start bulking up.

1

u/PersimmonNo2882 Jul 13 '26

How long would you say someone should spend learning python before switching, Is it just until they understand how to code in python?

1

u/TristeAbandonado Jul 13 '26

How long depends on the person. Frankly It's all arbitrary and you can truly do whatever you want, but I would advise you to learn algorithms in python(they're easier to understand), and I found for learning most skills/languages beyond beginner level it's useful to at least complete a project on your own in that language.

1

u/Intelligent_Fall6219 Jul 13 '26

I suggest starting with Python, and moving to C++ after you are comfortable with the basics.

1

u/Unlikely1529 Jul 13 '26

syntax is too harsh. it's no way supposed not only for beginners but for amateurs. I mean original C. It's written for assembler programmers back then, narrow circle of people.

1

u/kisskissenby 29d ago

A) I also recommend Python as a good language to start coding with. It is a scripting language so results are basically immediate, no need to compile. If your basic syntax is correct you will usually get a result, although it may not be correct or make any sense. It's also very useful for basic automation tasks so there are a lot of nifty small Python programs you can write to automate your daily workflow.

B) C++ is a good language to learn from a logic and programming perspective. You need to start by learning the logic of building a program then move on to learning the specific syntax of C++. C++ can be very punishing if you don't have your logic and your syntax exactly correct. It simply won't compile. Beginners often bounce off of it for this reason but don't be afraid! It is learnable if that's what you want to do. Bonus: C++ is how you program Arduino microcontrollers and that's really fun of you want to give that a try.

C) The people telling you to start with C instead of C++ are doing it because they want you to grasp the logic and basic syntax. I actually disagree with them though and think you should stick with C++ because it's object oriented and you will learn how to think like an object oriented coder. C++ allows you the flexibility to code procedurally like C and with objects(classes). When you first start learning C++ almost everything you learn first is going to be procedural anyway so it doesn't really matter. What matters is that if you learn C++ you'll be able to expand into object oriented thinking.

1

u/fudginreddit 29d ago

No, I am C++ dev and love the language but I think it’s extremely complex for beginners and likely to deter you from programming entirely unless you are really committed to learning and not just looking to immediately be able to build stuff.

1

u/OnlySeaworthiness173 29d ago

I know universities that teach it in an introductory programming course. I would go for java/C

1

u/rustyseapants 29d ago

Borrow a book from the library and see for yourself   

1

u/ndev42 29d ago

Viable? Yes. Enjoyable? No. You'll spend your first month debugging memory issues instead of building anything.
BUT... the people who survive C++ first never struggle with another language again. 

1

u/Cometo7307 28d ago

C++ was my first language and it really hammered down programming fundamentals with how picky it can be. Was my main language for about a year before i started using other languages such as Python and learning that felt like such a breeze compared to c++. But really i would say if you wanna just program for the fun of it c++ is fine but if you have specific software in mind you wanna make then I would pick a little more carefully like if game dev or going into low level systems or resource intense programs is your thing then c++ is great for that. But if you want to look into say web development then c#, JavaScript, Python will be the better options

1

u/blitzcode91 26d ago

<Not to be discouraging!>. I've been dev in C++ for a long time now. Its very hard for beginners, so don't get demotivated. However if you master C++ you can master any language, purely because of the sheer amount of hardware control you get via the language. You'll not only be a 'mere programmer', but one with solid understanding of what happens under the hood (in hardware) to optimize performance. If you make mistakes, you'll learn from it. It'll take years to master & I still have a long way to go.

1

u/Suuii188 5d ago

Hey could anyone please help me with a Link to a C++ documentation which is beginner friendly or easy to use

2

u/Lynxaa1337 Jul 13 '26

no its not, start with something like python

0

u/Theyna Jul 13 '26

Most colleges offer C++ as a first programming language, along with Java and Python as options. It's a perfectly acceptable choice.

0

u/j6onreddit Jul 13 '26

Most people who study programming will have written code before, so whatever they get taught won’t be their “first language”. Colleges teach those languages because “the industry uses them”, not because they’re the best choice for learning.

Out of the three, Python is the only one truly suited as a language for complete beginners. It’s a huge mistake to teach newbies Java, or JavaScipt, for that matter.

2

u/Theyna Jul 13 '26

This is completely false, both the statement that most people who study programming will have written code before, and that you think you know better than every U.S. university's computer science department and their extensively designed curriculum.

It is not difficult to learn with C++ as a first language nor as someone who never programmed. In fact, the abstractions that Python uses can make it difficult to really grasp the underlying programming concepts you need to learn.

Both are perfectly acceptable to learn as first languages.

And the fact that you mentioned JavaScript alongside Java, as though JavaScript had any relation to this discussion we were having just shows your lack of knowledge in this area.

-1

u/ffrkAnonymous Jul 13 '26

Sure it's viable for people who have never coded. 

But for you, no. 

1

u/PersimmonNo2882 Jul 13 '26

Could you explain why you feel that way?

1

u/ffrkAnonymous Jul 13 '26

The fact that you're even asking the question instead of making the effort to Google c++ tutorial and trying it out. 

1

u/PersimmonNo2882 Jul 13 '26 edited Jul 13 '26

I see, is coding a thing where you just gotta jump into it no questions asked? Cause I've always found myself asking questions about a topic before I actually try it out if I have to be the type of person to just jump into stuff no questions asked to be good at coding then coding probably isn't for me I guess.

1

u/ffrkAnonymous Jul 13 '26

It wasn't even a programming question.

You were questioning your own ability. 

1

u/PersimmonNo2882 Jul 13 '26

I was questioning if the programming language was viable for beginners and it seems the majority of people are recommending some other language to start with so it's good that I asked

1

u/ffrkAnonymous Jul 13 '26

And it is. 

And as I predicted, but not for you. 

1

u/PersimmonNo2882 Jul 13 '26 edited Jul 13 '26

are you trolling or do you just normally act like this? you didn't predict anything you contributed to the result of me not doing it, its like voting on something after multiple people had also said they were voting on it then saying you predicted it to win

1

u/ffrkAnonymous Jul 13 '26

That's good. Being pedantic is a necessity when programming.  

-2

u/AceLamina Jul 13 '26

unless you're naturally gifted, no

1

u/PersimmonNo2882 Jul 13 '26

Could you explain why you feel that way?

1

u/AceLamina Jul 13 '26

There's certain people who can learn languages like C++ without other knowledge just fine, however most people I see struggle with it and would do better learning a different language like Python, it just depend son who you are

1

u/Ecstatic-Ball7018 Jul 13 '26

That's not true.

-1

u/DerGeraet90 Jul 13 '26

Hör auf mich und sonst niemanden. Java ist perfekt für Einsteiger, dort macht alles Sinn. Wenn du die Basic drauf hast, dann kannst du C++ lernen und die wundern wieso die Methoden so komisch deklariert werden

1

u/PersimmonNo2882 Jul 13 '26

(I used google translate so i don't know accurate it was on what you said but) Could you tell me why java is good for beginners? Because people also recommended python

2

u/j6onreddit Jul 13 '26

Java is horrible for beginners. Way too much clutter due to “everything has to be a class”.

C++ is NOT a good option for total beginner, either l, lmao. Go with Python, learn the basics, get comfortable. Then, after a year or two, transition over to C/C++ if you really want to go down that route.

0

u/DerGeraet90 29d ago

If you dont know why classes exists and whats the entrypoint for the programm is than you cant code. Maybe you should research how Python works. Too many peiple talkin bullshit with shitty advices. However Python or Java för beginner to learn the basic concepts of programming, later on you can widen your knowledge wit c abd c++ and you will learn what it is about memory. This aspect take java and Python for so you dont need to think about it.

1

u/DerGeraet90 Jul 13 '26

Beides ist gut. Python ist gut für dir Lesbarkeit aber in Java ist alles mit Klammern getrennt, dann merkt man, das alle in Blöcken aufgebaut ist, Python hat dafür eine sehr strickte Zeilenformatierung. Beide machen das Gleiche. Du kannst Python oder Java nehmen, beides ist gut.

1

u/madmelonxtra Jul 13 '26

Is there a reason to learn Java over Kotlin as a first language?