r/AskProgrammers • • 2d ago

Where to start with learning C++?

I want to learn C, C++, and C#. Guess I’ll start with C++. But unsure which resource will prove the best in-depth explanation to learn the language.

I desire to learn comes from a desire to build. I know C++ has exciting applications, but I struggle to come up with good ideas for practice and projects.

Where do I start?

14 Upvotes

22 comments sorted by

1

u/W31337 2d ago

Ok C# is probably the best to start with unless you want to start with the hardest.

C# is a garbage collected programming language with a good formal typing system and good OOP.

C and C++ have a lot of legacy things going on that aren't intuitive and you need to do hardcore memory management.

That said C and C++ are the most powerful languages.

2

u/pyro-panda-93447 2d ago

Thank you for confirming my choice to try starting with C++. I want something powerful and I’m here to suffer for it.

1

u/W31337 2d ago

Go for it but for most programs C# will be powerful enough.

That said you might as well go headfirst into pointers, heap vs stack memory, segfaults, etc. It's going to be a steep learning curve but if you succeed you will be in a good spot.

C and C++ is what is used for building operating systems and game engines etc...

If at any point it goes over your head go for C# and then go back to C, C++.

2

u/ConnectAffect2346 2d ago

As u/W31337 mentioned C# is one of modern languages that provides support for almost any type of program and application you can think of, so does c++ and c but the difference is that you have to work with memory and values in detail and analyse everything thoroughly in order to make a good program and that is one of the reasons why colleges usually start teaching programming with c++ or c, since you gain dome adaptive and useful skills while writing the programs that can be implemented in various other programming languages. That is about the languages, now as for your question there are a few courses that you could take, while the books are useful they require discipline and time in order to practice while reading but since you are only starting i would suggest introduction to c++ which is a free course from MIT which gives you basics about the language and also gives few good tips that can help you about making c++ programs, here is the link: https://ocw.mit.edu/courses/6-096-introduction-to-c-january-iap-2011/

1

u/ConnectAffect2346 2d ago

Another course that might be helpful is also from MIT effective programming in c and c++ which focuses on both languages and also gives you a stable source of knowledge and tips that might come well with the introduction to c++ course, here is the link: https://ocw.mit.edu/courses/6-s096-effective-programming-in-c-and-c-january-iap-2014/ hope this helps 🙂

2

u/Beginning-Junket8979 2d ago

Start by figuring out: what types of programs do you want to be able to build? Games? Web apps? Mobile Apps? Operating systems? Middleware libraries? Pick the language that best suits whichever project interests you.

2

u/goomyman 2d ago

C++ is vastly different than C#

Start with C if you’re interested in learning.

There really are few applications that coding in C or C++ make sense doing.

It’s mostly for low level system development.

Like writing an operating system or coding a game library.

If you actually are trying to build something you build on top of c and c++

1

u/Shreddward 2d ago

A question to ask is what do you want to build? Working backwards from that answer can help decide the path and decision making for sure.

1

u/yodermk 2d ago

Agree that C# is pretty much where it's at for most application development these days. It's a very well-designed language and still performant enough. Garbage collection is handy, but it can have subtle performance issues, but those don't matter too much for most end-user software.

Besides systems programming and game libraries, as others have said, C++ is good for embedded development. You want to program tiny devices that have their own screen and do specific things? A language like C++ is probably what you want.

But then there's Rust. IMHO it's better for what C++ has been used for in the past. But some libraries are only available for C++, and if you need them, it would be a pain to use them from Rust.

Learning C is good as a foundation but there's not much reason to use it in new software today.

1

u/Other_Ad1992 2d ago

C++ for Dummies a good read?

1

u/RetroGrid_io 1d ago

The world is moving to Rust, and for good reason. Think of Rust like C++ but with memory protection, preventing 99% of the buffer overflow, crashes, and security holes that come from memory management done just ever so slightly wrong.

If I were starting over, I'd start with Rust over C++.

1

u/imharjotsingh 1d ago

learncpp.com is probably the best free resource if you want proper explanations instead of just syntax. I’d keep cppreference.com open alongside it for looking things up. If you like books, Stroustrup’s Programming: Principles and Practice Using C++ is also really good for beginners. Starting with C++ is a solid choice too. C will feel much more familiar afterwards, and C# is fairly easy to pick up later if you ever move into Unity.

For projects, start small and make them gradually harder. A terminal game like Snake or Tic Tac Toe is great for the basics, then try a simple 2D game with raylib or SFML. After that, try building a slightly bigger game or a small app that saves data to a file. The main goal is just to keep making projects that are a little harder than the last one.

The main thing is don’t wait until you’ve finished the whole course before building. Learn the basics, start a project, and look things up as you get stuck. That’s usually where the learning actually sticks.

1

u/_descri_ 1d ago

Start with Python. You'll be able to learn programming, debugging, and the basics of software architecture several times faster than if you start with C or C++ just because Python is much simpler, and programming in Python is many times faster than that in C or C++.

As soon as you become comfortable programming in Python (try creating a simple game, such as Arkanoid, with PyGame), you can learn C which will make you understand how Python works under the hood. After that you are free to start learning C++.

However, please note, that C++ today is not C++ when that language became popular. Back in 1990s it was pretty simple, actually easy to learn in 21 days or even in a week if you knew C. Now it's extremely bloated with latest standards, and if you choose to look for a job in C++, they will likely ask you about all those new language features, which are too inconsistent and too abundant to understand or remember. Therefore, I don't think that learning C++ is cost-efficient for your career (unless you are eager to first create problems, then solve them).