Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

codingbat-like site for C++ [closed]

Tags:

c++

Guys, I need to find a good site like codingbat to "learn again" C++. I learned it at school but then I've never used it seriously. I'm not looking for something like Project Euler because it focuses on math problems. I need something really focused on C++ principles, chacteristics and tools.

like image 953
dierre Avatar asked Aug 13 '10 18:08

dierre


People also ask

Is CodingBat useful?

CodingBat problems work great as homework, or for self-study practice, or in a lab, or as live lecture examples. The CodingBat problems are designed to have low overhead: short problem statements (like an exam), nothing to install, immediate feedback in the browser, and there's lots of them to build up those skills.


2 Answers

There is no substitute for practice.

Find a program you want on your machine (maybe as simple as something that counts the number of lines in a project), and write it in C++.

I wish I could tell you that I have an awesome resource that shows you every C++ trick in the book, but truth be told, you are that resource.

Practice. Learn from your own mistakes. You are your best teacher.

like image 40
riwalk Avatar answered Oct 21 '22 02:10

riwalk


I don't think such a site exists and I doubt it ever will. The reason is that C++ is huge - and I mean reeaallllyyy huge.
When you start to write C++ code professionally (that is, 40hrs per week) and take 1 or 2 hrs for learning new stuff about C++ every day (that is, 5-10hrs per week), reading books and articles, you will need months, if not years, to become a real professional C++ programmer - unworldly presuming your job doesn't require you to learn any 3rd-party APIs, new tools, technologies, and whatnot, which will distract you from learning C++.
For several years, I have taught C++ to students who already had one year exposure to Java. In 4-5 months, 12-15 lectures, and at the very least twice that time in the lab, I've managed to drag them from "Hello, world!" all the way to a short introduction to template meta programming. Everyone who know all of the area covered by that span will tell you that, after this, they'd still be bloody novices.
(Heck, I'm using C++ for >15 years, earn my money writing C++ code >10 years, and still learn new stuff about it almost weekly. And that's not even considering the huge amount of stuff dumped over us by the new standard, which has been "just around the corner" for several years).

Due to the sheer size of the territory to cover in order to learn C++, and also due to the fact that C++ is old enough that its programmers can be categorized into several generations when it comes to which standard idioms and "best" practices they learned, and finally because (again due to its incredible hugeness) new techniques are constantly discovered and evolving (template meta programming, now a very important feature of C++, was an accident nobody had planned for), the C++ community's opinions on idioms and practices isn't as compact as, say, the Java community's, and can hardly be communicated as a set of a few dozen rules without arousing heated discussions.
(I think the fact that there are several different very good and recommended Best Practices books listing several dozen rules of thumb each, and the fact that some of them managed to later acquire a supplementing More Best Practices book, literally speaks volumes about this.)

You will find many professional C++ programmers who happily use only 30% of what C++ offers. For example, many use it just as an OO language, missing out templates (maybe except for the STL), exceptions, and other very useful stuff. But C++ is a multi-paradigm language. It supports object-oriented programming as well as generic programming, generative programming, a lot of functional programming stuff, and quite a few other paradigms. And it becomes most powerful where those paradigms are combined.


So what's my advice?

Have a look at The Definitive C++ Book Guide and List.

First make your pick from the beginner's books. Since you say you already had exposure to C++, I'd recommend Accelerated C++ by Andrew Koenig and Barbara Moo. That's an excellent introduction which can't be praised enough for the way it changed teaching C++, but it comes with quite a steep learning curve. Also, with 250 pages, it's really just a short introduction.
An alternative to that would probably be either Stanley Lippman's C++ Primer (which, at 1000 pages, covers the same ground in detail) or Bruce Eckel's Thinking in C++ (which I don't know) or Bjarne Stroustrup's classic The C++ Programming Language (also 1k pages) or his newest book, Programming - Principles and Practice Using C++ (which I haven't looked at yet).
These books come with enough tasks to keep you busy for a while. Add a few of your own to that and you can be busy learning for months.

Then slowly work your way down the list.

The next C++ standard, now generally expected in 2011, will add a few challenging concepts to the language (like rvalue references) and a vastly expanded standard library. (The current draft has almost twice as many pages as the last one.) Unfortunately, since the standard isn't yet finished, there are no books available teaching it. It's all spread out in articles and in online discussions (although Wikipedia has a pretty good article about it), and it's all meant for fluent C++ programmers, not for C++ novices. There is, unfortunately, not a single text out there teaching C++1x to C++ newbies And I'm afraid it might take years before you can make your pick between several recommended books doing this.

And don't forget the C++ FAQ, which is a pretty good (and very readable) online collection of best practices (and their rationals), although it's by no means an introductory text.

like image 53
sbi Avatar answered Oct 21 '22 00:10

sbi