How did you learn C++?

Started by
31 comments, last by assainator 10 years, 2 months ago

I learned C++ by struggling with it. Unlike Visual Basic and Java, C++ was a different beast to understand let alone master. While I never understood the deepest of C++ as in underneath the hood of C++ because I decided to pursue Java much more and make games with it. I understood Visual Basic and Java enough to at least understand the general programming concepts behind C++ which got me grade of a B in both C++ courses I took in college.

I think C++ is something you can only learned at a deeper level on your own or by discussing your roadblocks using C++ on a forum. I had professors who made things really confusing when pointers in C++ was introduced.

Advertisement

I first learned C++ about 15 years ago. I started with C until I had a good grasp of the content and then moved to C++. A good book to have is "C++ A Complete Reference", then using websites like http://www.cplusplus.com/ that have nice tutorials.

I was taught C at college (well, they gave me a textbook and a compiler). Sadly this was long after C++ was standardized but the lack of decent CS tutors in the UK means that the syllabus is still largely dictated by the available skills of staff rather than the real world, in smaller colleges at least.

Bizarrely, even though they were teaching us C, they had us using Borland C++ Builder, so the template code we were filling bits in on contained all sorts of gibberish that made no sense to me. The textbook they supplied had a small, very badly written appendix on C++ so a combination of that and curiosity about all this weird code Builder was generating made me start to experiment in my own time.

Thankfully I left the course before I wasted too much time learning outdated methods, and I wouldn't recommend learning C before C++. I spent a long time implementing my own string and vector classes which was a great way to learn about things like operator overloading and RAII, but produced terrible code. I'm fortunate that I was able, largely through activity on this site, to throw off most of the bad habits I got into in the early days.

Before I had even looked at C though, I had spent most of my life (from about aged 7 onwards) playing around with various BASICs. ZX Spectrum, followed by some game BASIC for the Amiga. It was very clear to me going into the course that having this fundamental understanding of things like variables, control flow, input etc gave me a big headstart on the students who had never programmed before.

I think we have to draw a distinction between learning programming, where the skills should allow you to move from one language to another easily, and learning the nuances of C++. Personally I think my basis in C made it easier to understand some of the peculiarities of C++. I'd already started playing around with writing simple compilers and virtual machines before I got into C++ and I find a bit of understanding of how compilers work under the hood helps make C++ make a bit more sense, but that isn't a requirement.

Now it's a lot more easy, we have tons of sample, tutorial on net, that no need to type anything at all, just build and see what happen !

this is equivalent to i've learnt how to read, highlight text, browse the net and use ctrl+c and ctrl+v very well!

At least format the code with Artistic Style after you do all your copying and pasting, so that you can more easily read the code and learn something from it later. Maybe even modify and experiment with it.

I learnt C++ after coding in C for years at work to modify a COM/ActiveX control. I practiced a bit and read Bjarne's book.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
so initially what everyone is saying is that programming languages can be compared to real languages. (french, italian, chinese, etc.) and the computer understands all these languages, but it's up to me which one I learn even though it will understand all of them?
I learned how to program by reading books and manuals. Some time after I thought I understood the language I discovered there was such a thing as the C++ language standards committee.

I read the real language standard, and realized that before that, while I knew how to write some c++ code, I had no idea what was actually the c++ language. It was eye-opening.

Learning C++ is like learning a foreign language, It's hard to learn how to express yourself with it without a personal, good reason.
Think of something cool you always dreamed to implement, and learn by doing.

http://www.cplusplus.com/doc/tutorial/






I learned how to program by reading books and manuals. Some time after I thought I understood the language I discovered there was such a thing as the C++ language standards committee.
I read the real language standard, and realized that before that, while I knew how to write some c++ code, I had no idea what was actually the c++ language. It was eye-opening.


Is that a 1300 page pdf file on learning C++?...
Yes and no. It is not about learning c++. It *IS* c++.

It is not a text designed to help you learn. As I mentioned, I spent years reading about C++, learning about keywords and how they were used, and assorted practices, patterns, and properties about the language. That isn't what that document is about.

That document is the language standard. (The final draft anyway. Remove 'draft', swap the cover page, and remove some annotations for the final version.) When people talk about C++11, they are not talking about books like C++ Primer. They are talking about the language described in that document.

A strange thing is that so many people, even professionals, have spent years and even decades reading ABOUT the language, but have never read the actual language.


Imagine reading books about law, studying the effect of court cases, writing contracts, and otherwise doing everything in the legal field... but never actually read the constitution or other actual laws.


Yeah, I thought I knew C++ before reading the standard.

This topic is closed to new replies.

Advertisement