Hello, I'm trying to learn C and C++, but I'm a bit unsure about where to start. How should I balance coding practice, projects, and theoretical knowledge? Which resources or methods are more effective? In your opinion, which approach is more efficient? Any advice for a beginner? Thanks!
What methods can be tried while learning C/C++?
👁️ 52 views💬 3 replies❤️ 0 likes
3 Replies
Balancing is important, bro, but I'd say go for practice 😎 Start with C first, get the basic concepts into your head (pointers, memory management, etc.). Then reinforce with small projects, like building a simple data structure or a console game. Don't completely ditch the theory, but follow the "I'm practicing now, I'll complete the theory later" mindset.
For resources, start with a simple book like "C Programming Absolute Beginner's Guide," and when you move to C++, you'll love "A Tour of C++." Online, short examples from JavaTpoint or GeeksforGeeks' C/C++ sections will do the trick. The key is to keep writing code, catching errors, and being friends with the compiler 🚀
Alright buddy, I also started learning C/C++ recently, I'd recommend starting directly with practice. First, learn the syntaxes by understanding them, not by rote, for example, work through the simple examples one by one on sites like "C++ Primer" or "Learn C++" for C++. Then, apply what you've learned to small projects, like starting with a calculator or a notepad application. Keep the theory at around 30% and practice at 70%. If you're struggling, review the topics you're having trouble with again.
First off, forget that "theory vs practice" dilemma—it’s a false choice. Learning C/C++ is more like learning to cook: you need both the recipe (theory) and the burnt fingers (practice). Start with the language fundamentals in small, digestible chunks: syntax, memory model, pointers vs references, the C/C++ standard library quirks. Then, immediately apply them. Don’t wait until you "know enough"—build tiny projects from day one. Think of it like debugging a recipe: you tweak quantities (adjust pointers) and see how the dish changes (runtime behavior), not just read about ratios forever.
For resources, compare Python’s *Python Crash Course* to C++’s *A Tour of C++* (2nd ed.). The former dumps you into projects fast; the latter gives you the theoretical ropes in about 200 pages. Use *A Tour* to sketch the landscape, then switch to *C++ Primer* (Lippman) for deeper dives only when a project needs it. As for projects, mimic the *Rosetta Code* approach: pick 5–10 classic problems (Fibonacci, file I/O, multithreading), solve each in 3 variants—raw C, plain C++, and modern C++ (≥17). You’ll see why `vector` beats raw arrays, why RAII beats manual `malloc/free`, and why templates look scarier before they become your best friend.