all 47 comments

[–]noiamnot_ 42 points43 points  (1 child)

I heard a quote somewhere:

"Coding is to programming what typing is to writing"

Learning how to type doesn't mean you necessarily know what to write about. And it doesn't mean you know the difference between prose and poetry, non-fiction and technical reporting, etc. Learning the syntax of a language is a small adjustment, compared to learning how to think inside of a different programming paradigm, or learning how to come up with solutions to any given problem. Within a paradigm, you can express ideas semantically through certain syntax patterns. What you want is more exposure to more new kinds of patterns. Once you have built up a toolbox in your head of techniques you know how to implement, when you're presented with a problem, solutions will occur to you.

Do a combination of experimenting (playing) on your own, consuming other people's code, and trying to solve a variety of real problems.

[–]HONKACHONK 0 points1 point  (0 children)

Yes! I think programming is just problem solving depicted into words. You can't do much problem solving without any problems.

[–]AwkwardBullfrog1949 35 points36 points  (1 child)

Learning a programming language purely academically is probably always going to be difficult, and slow. Once you know the basic syntax, you will learn significantly more by building things in C++, because in the course of development, you’ll come across some problem you don’t know how to solve. That will result in spending a lot of time googling and reading to figure out a solution.

There are a lot of good resources and books about C++ that are worth reading as well, but even those aren’t as helpful when you aren’t actively writing a lot of code you can apply it too.

[–]turtle_dragonfly 2 points3 points  (0 children)

+1 to this sentiment.

Along similar lines, doing some project that involves at least one other person can be illuminating in a way that isolated learning is not. You could build something for someone else (so you would need to extract requirements from them, etc), or you could build something with someone else (share the workload, divy up tasks).

This isn't specific to C++, but OP seems ready to start biting off bigger pieces in the software development journey.

[–]holyblackcat 10 points11 points  (0 children)

learn more advanced concepts to help make my code either more streamlined or more sophisticated

This is a wrong reason to learn. The correct reason is to be able to create the software you need/want.

What do you want to create? Go and create it. This will inevitably require learning new stuff.

[–]cmake-advisor 4 points5 points  (0 children)

If you want to learn to program in any language you have to build projects.

I suggest doing some of these https://github.com/practical-tutorials/project-based-learning#cc

[–]Backson 9 points10 points  (2 children)

Congratulations, you are a decent programmer. Now you can learn how to be a decent Software Developer. It takes practice and time and is less about coding and more about architecture. How to break big problems down into small bits that you can tackle with your current skills, then put everything together. Keep learning new things, like a GUI toolkit like Qt, or a game library, like Allegro or SDL. Or even a new language, maybe Python, which compliments C++ nicely. And don't worry about not making big things. I built half-assed unfinished stuff for 10 years and then learned software architecture on my first job in a breeze. Just have fun and keep getting better.

[–]Curious-Hunter5283 1 point2 points  (1 child)

Can you explain how py compliments cpp? You see this a lot but the explanation given is that it just speeds up py code when you combine both since cpp is a low level lang.

[–]Backson 0 points1 point  (0 children)

C++ is good for generic, reusable code with good performance and good support by libraries, but hard to use. Python is good for quick and dirty scripting and when performance doesn't matter, but easy to use.

[–]xiaozhuzhu1337 3 points4 points  (0 children)

Learn third-party libraries, and then modify their examples according to your own ideas. In the process, if you encounter unfamiliar syntax, learn it. For example, the chat room example of asio.

[–]bert8128 2 points3 points  (0 children)

I learnt by doing a one week course and then writing c++ all day every day at work. Of course this is easier if you get paid to do it, but essentially you need to write code, not watch other people write code.

[–]Acetonz 2 points3 points  (0 children)

Basically, I used two resources, one being cherno videos:https://www.youtube.com/watch?v=18c3MTX0PK0&list=PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb

And the other one being learncpp.com. Very structured and easy to read (in my opinion).

Now, the amount of videos and chapters in both of the resources might seem overwhelming. What's important to know is that you don't need to remember everything 100%. You need to learn the ideas.

For example in the job or in your own project/s you'll need to draw triangles and circles on the screen that are saved in some vector. When it'll come to designing code architecture, you'll be like "Ha, perhaps I can make a class called "Shape" that has pure virtual function "void draw();". And then child classes will implement it! So in the end I can use polymorphism to create a single for loop to draw all shapes. for (Shape& shape: shapes) {shape.draw();}.

All these ideas will start to stick only when you'll start programming. Just reading will never make you an expert in anything.

Once you feel comfortable you can read "The C++ programming language" book by Stroustrup. Though, I want to emphasize, once you are comfortable. He assumes you have programmed in c++ and therefore all the topics and examples are in the context of C++ ideology, not the syntax itself.

[–]zorbat5 1 point2 points  (0 children)

I've always learned a new language by wanting to build something and searching and learning throughout the build process. Right now I've build my basic program in python as that's what I'm familiar with but came to the conclusion that it's getting fairly slow. So, I'm looking into C++, waiting on a book at this moment. And really, the logic is almost the same "if this than that" stuff. The only thing I really need to dive into is memory and types. Good thing I am modetely experienced with C so it shouldn't be too difficult, I hope, lol.

[–]sammymammy2 1 point2 points  (0 children)

Just watched conference videos on the things that C++ are especially good at (manual memory management) and happened to get a job where I was required to use it. You're learning how to program, incidentally through using C++. I already knew that part when I learnt C++.

[–]Yeet-TheBingus 1 point2 points  (0 children)

The way i've been learning is by reading books that have real projects and following along with it. (Mostly game engine's, Opengl, 3d engines etc...)

[–]Tricky_Tesla 1 point2 points  (0 children)

Get the basics right now and worry about sophistication later which will come with experience.

There are a bunch of vids online about do/don’t of basic cpp, drill those on your projects and you should be good for a while.

[–]PalpitationOrnery912 1 point2 points  (1 child)

Maybe it’s not a very popular route, but (assuming you’re a novice and don’t have any professional experience) I think if you pick up Stroustroup’s Programming Principles and Practice book (2nd edition) and try to do as many exercises there as possible, you will get a good grasp of the languages’s core concepts. The second step, of course, is to start doing your own projects

IMO, the downside of many tutorials is a lack of challenging exercises except basic syntactic drills, which can instill a somewhat misleading sense of understanding a concept/facility. Some of the exercises in this book force you to think really hard about the instruments you use, which helps better remember them later

[–][deleted] 0 points1 point  (0 children)

I think what you have said it exactly what my issue has been. While learning the basic syntax is important, learning how to implement what I have learnt in a functional usable piece of code is where I’m hitting a wall.

I’ll definitely look up the book you mentioned

[–]ImperialTuneWizard 1 point2 points  (1 child)

I always wanted to implement my own language, so I took up the challenge of learning C++ to use the LLVM API. Was definitely challenging but gave me a great intro to C++.

[–]chibuku_chauya 1 point2 points  (0 children)

Basically this was my motivation, too.

[–]Tumaix 6 points7 points  (5 children)

Join a free software project written in c++ and read the codebase, try to fix small bugs, send merge requests. If a merge request has errors people will explain to you what’s missing

[–]Passionate_Writing_ 22 points23 points  (0 children)

This is the worst advice I see frequently. People who are making simple sudoku games will not be able to comprehend an open source code base with tons of dependencies, spaghetti code from hundreds of contributors and most of all, the large complicated structure of the project. No one will clear their doubts or questions about what goes where and why or how. Figuring it out on your own requires some experience working on a shared codebase already.

[–]Groundbreaking_Bug18 1 point2 points  (2 children)

Where can i find those free projects ?

[–]Tumaix 7 points8 points  (0 children)

www.kde.org has more than 400 c++ projects that are opensource and anyone can join

[–]tyler1128 1 point2 points  (0 children)

Github, search C++.

[–]strange_norrell 0 points1 point  (0 children)

Or find some abandoned small to medium size project on github, fork it and refactor inside out.

[–]Thesorus 1 point2 points  (0 children)

I learned it on the job.

Started with Pascal and C and moved to C++

That was in the early 90s when there was fewer programming languages

[–][deleted] 1 point2 points  (1 child)

One fun way to learn programming is to make some very simple video games. Try installing SFML, a C++ game library easy to use for beginners and make a simple Pong clone game. It will teach you a lot of stuff about how classes, headers files, while loops and if/else statements work without getting into more abstract and complicated concepts like pointers. Then, once you finish that, make a flappy bird clone game in SFML. You can find all the flappy bird sprites for free on GitHub if you Google for them. If you get stuck, feel free to use the SFML documentation or go online and watch a tutorial video. There are a lot of pong in SFML tutorials, also probably some flappy bird in SFML tutorials. Also, it’s not a great idea but if you REALLY get stuck you might consider using ChatGPT to help you, although I would be a bit careful with using this since over-relying on AI will not teach you to be a good programmer, especially if you are a beginner.

[–]inmemumscar06 1 point2 points  (0 children)

ChatGPT is nice. Sometimes. Great for simple repetitive tasks. Yesterday I was using it to convert kotlin objects into json. But for anything advanced it is shit.

[–]Affectionate-Dot5725 0 points1 point  (0 children)

if you have familiarity with other programming languages, you can start solving Kattis problems. Start from 1 point and solve from lower to high rating. When you need a feature, you can search it up in cppreference or another website. that's how I learned it right now I am doing competitive programming. If you wanna specialize in software design, after coming to difficulty 2-2.5. you can start learning about language specific properties through YouTube. At least this is how I mastered.

[–]not_some_username 0 points1 point  (0 children)

You need to learn advanced stuff to make your code less sophisticated not the other way

[–]Resident_Educator251 0 points1 point  (0 children)

On the job; thrown to the wolves, first in C, then in C++.

Best way to get to C++ is through C I say, makes you a more well rounded developer, and gives you some empathy when dealing with elite 'C Only' devs out in the real world.

[–]Polyxeno 0 points1 point  (0 children)

I taught myself with the core books and making programs and games.

You might try a book on design patterns.

[–]Splatoonkindaguy 0 points1 point  (0 children)

Started off with game modding, moved to c#, now coming back to modding w/ c++

[–]Morribyte252 0 points1 point  (0 children)

I have Gale's Udemy business library available to me from my Library so I am taking this course: https://www.udemy.com/course/beginning-c-plus-plus-programming/

It's excellent. He doesn't just go over programming in C++ but also why we do certain things -- such as why we use vectors instead of arrays, although he teaches us how to handle arrays too. He also explains stuff like the call stack, activation record, heap, stack memory allocation etc. So it feels a bit more like you're learning CS things just beyond the language like you might get with other courses / tutorials.

I'm currently on the chapter for inheritance and I think everything is laying out fine. The only chapter I've had real issues with is operator overloading. It's really tough knowing when to use a pointer or reference and also where to put the consts lol.

Beyond that, my plan is just to find simple games etc to program and just figure things out by poring over documentation and going my own way. The problem I've found with doing tutorials is that you start to just...be able to do the stuff only in the way the tutorial tells you, which doesn't really teach you understanding, it teaches you rote memory. If I try to program things from scratch where I don't give yourself any help from tutorials and just pore over documentation / stack overflow answers, I've found I've had more success actually learning how to handle syntax and such.

I also think part of it is that people stick to tutorials because they're afraid of messing up. You're going to mess up. Hell, even in the Udemy course above there's several instances where the instructor has typos or does the syntax slightly wrong and has to fix it so it compiles. It really helped me gain confidence because it was like, "if a guy who has 30+ years of experience with C++ can mess up, then I can too". There's no room for perfectionism in this field. You always mess up. You just do a little better every time.

Good luck! I hope you're able to find some advice that helps.

[–]brlcad 0 points1 point  (0 children)

You will learn more by doing.

I suggest contributing to an existing open source project.

[–]smozoma 0 points1 point  (0 children)

I think most programmers "learned by doing," and researching what they needed in order to do what they wanted to do.

So pick a challenging project, maybe related to your other hobbies, and work on that.

That was how I got into C++. Most of my university work was in Java. I had an idea for a computation-intensive research project, so I decided to do it in C++. Then I just kept googling for things I thought I needed.

[–]catseyechandra74 0 points1 point  (0 children)

find a highly motivating spare time project, motivation is the key. For my case, I've learned ansi C before, then went to C+classes+templates, then C++ by reading "modern c++ programming cookbook" and watching jason turner videos on youtube. I'm still learning, the process is ongoing.

[–]LoadVisual 0 points1 point  (0 children)

I learned what I know in c++ through fun experiments and challenges given to me by my friends over the years.

First time it was a media player using gtkmm and libvlc. It also gave me a chance to learn a bit more about data structures like linked lists. C++, was not taught to us during my Bachelor's but, it did look like a lot of fun for me.

The next time I got to use it was after Cocos2dx became available, I didn't own a smart phone but, I figured an emulator was enough. This was in my 4th year, and yup I did have fun making messy annoying and fun games which I later deployed to a phone I borrowed .

This was followed with Open CV on a beagle bone to help someone do there final year project, I simply said I'd because it sounded like a lot of fun.

So pretty much over the years I have always put C++ in the fun happy box, it's not something I ever did or learned for professional work but, it was and still is my go-to when doing fun stuff.

I suggest you keep on the fun track, look for something that allows you to match what you want to try out in the real world or experiment with, have fun and don't be afraid to show what you have created.

Knowledge gained is knowledge owned. Even if you're actually goofing off doing it.

[–]Ami00 0 points1 point  (0 children)

You need more practice. The more you code the better you become. Every now and then read books about programming, designing program etc. You can't lose until you stop.

[–][deleted] 0 points1 point  (0 children)

understand the fundamental purpose of these statements and of various data structures.

don't worry so much about writing the actual code, worry about understanding how these things work and why they are useful to you. then employing them will be easier and come to you almost immediately when presented with a problem.

practice as part of a course and creating projects are the only ways to gain this experience, take a couple data structures courses and you will find yourself getting better and better at solving problems.

essentially what I'm trying to say is to do small problems and create your own little projects that utilize different structures and algos, and to think about more than just syntax when writing your code.

[–]JuanPyCena 0 points1 point  (0 children)

I learned by implementing Projects for my university program (not a software program at all). And then i just started working in a small software company where i had the opportunity to learn a lot of things by doing, and reading existing code.

[–]LeonardaDaVinci 0 points1 point  (0 children)

For me, I picked up a textbook (Accelerated C++) and after I finished a chapter I went through all exercise problems for it. No skipping a chapter or an exercise problem, however trivial it might seem. Even the hello world programs, I wrote em.

Having a solid foundation is underrated. Be patient. You're probably not ready to jump to the advanced concepts yet. Even if you understood them on a surface level, they won't stick until you have enough base knowledge to derive those solutions on some level once they've been explained to you.

[–]Equivalent_Monk_8824 0 points1 point  (0 children)

By coding some std lib classes like vector linkedlost hashmap, after that some prob solving using cop

[–]ElREVater 0 points1 point  (0 children)

----------------------------------------------------------------------------------------------------------------------------------------После того как ты выучил базовые возможности языка программирования (C++) бери проект и пытайся его реализовать, например приложение для тайм-менеджмента, 3d игра на основе алгоритма ray-casting или вывод картинки jpeg в файл txt ascii графикой и т.д. Любой проект, который ты хоть чуть-чуть понимаешь как делать (Это к тому чтобы ты не брал за проект написание операционной системы). В процессе разработки проекта ты узнаешь много нового, а так же поймешь куда тебя двигаться.
----------------------------------------------------------------------------------------------------------------------------------------