3 ms·
I don't think that C/C++ is different, this is exactly how I learned those as well. Be aware though, that C++ and C are very different languages and you should
by kristiandupont 12y ago
I don't think that C/C++ is different, this is exactly how I learned those as well. Be aware though, that C++ and C are very different languages and you should choose one. If you want to do kernel-level stuff or embedded code, C is probably a better choice than C++, whereas if you want to go into gaming or complex desktop applications (think Photoshop), C++ might be the one to choose.
Pointers may be scary but they are just a concept that you need to grasp, like recursion. You first read about it and kind of get it, then you apply it over and over until suddenly you realize that you have developed a true understanding that allows you to build new abstractions on top.
You will hear people telling you to start with C first because C++ is a superset of C, but I always advice against this. Memory management is "manual" in both, but the idioms you apply are very different between the two. Unless you are looking to truly spend years perfecting both, pick one and go with it.
- duaneb 12y agoC++ is also very applicable in kernel programming. See: Haiku, Darwin, Windows. I would not write a C kernel now; Linux and *BSD only maintain relative security and dearth of bugs through years of maintenance and rigorous code guidelines. C++ (even as only a thin layer over the C code) can provide ridiculous modularity and safety that C alone cannot—think RAII and parametric allocators. From a software engineering perspective alone, I think C++ is the win. C is much better as glue code between languages than anything else.