Wie sind die Roboter.
July 25, 2012 3:05 PM   Subscribe

Basic programming using C++ from the ground up, high school edition.

My high-school-aged younger brother seems excited about joining his school's robotics club in the fall. Apparently, they do some C++ programming in there. My brother is inexperienced, but undaunted.

I will admit up front that he's not a great independent learner at this point in his life. He is impatient, easily frustrated, and oftentimes very stubborn. He definitely lacks an internal locus of motivation. Robotics may easily turn out to be another thing that he gets excited about, buys a bunch of stuff for, and then quits after a week.

He's asked for a C++ book, and there's certainly no shortage of those. But most of them are directed to patient, attentive adult learners. I need something that is engaging, interesting, and makes no assumptions. His technical knowledge is really quite limited. I'd hate for him to quit before he finds a working compiler. Whatever you recommend should probably be project-based or task-based, even if in silly or useless ways.

In the end, even if he doesn't stick with robotics for long, he might end up with an extra tool in his inventory. And programming is fun.

In sum: please recommend learning resources for C++ that start with the rudiments of programming and teach basic concepts in engaging, creative, and interesting ways. Hard-copy books are preferred, but online resources may also be acceptable.

Alternatively, feel free to suggest stuff to get older kids excited about computers, robots, and programming. Focus on things that don't assume that computers, robots, and programming are inherently interesting.
posted by Nomyte to Technology (14 answers total) 11 users marked this as a favorite
 
I would look into On to C++
posted by thelonius at 3:17 PM on July 25, 2012


Perhaps he'd be more interested in concepts of programming, and not get so easily turned off by C++ specifics.

Some puzzle games like LightBot would be a start, or move up to Kodu for more advanced challenges.

Once he is confident in being able to solve something programmatically, then learning C++ is just about the specific syntax to accomplish the task.

If the robotics club is FIRST, my experience is that they usually have good mentors that would be happy to give 1:1 help.
posted by Diddly at 3:32 PM on July 25, 2012 [2 favorites]


I took AP Computer Science in High School. I am pretty sure it still exists. The language taught was C++ and I feel pretty confident that the curricula they have developed for that program/class/course would fit the bill here (same audience, same language) and there should be plenty of it out there...

If not, something like Code Academy would be my first stop. It would get you to a place where adult texts are far less intimidating.
posted by milqman at 3:42 PM on July 25, 2012


Here's the "definitive" booklist. I think you want to get a modern book (published in the last 5 years) to take into account how C++ has evolved. The C++ Primer sounds like a perfect book, and was published in 2010.

I like Diddly's idea about doing puzzles to build motivation.

Personally, I don't know why robotics clubs would use C++ anymore. Computers are fast, and Python makes programming (and learning programming) a lot easier.
posted by esprit de l'escalier at 3:42 PM on July 25, 2012


Response by poster: > I took AP Computer Science in High School. I am pretty sure it still exists.

Amazon suggests that the language used in AP CS classes has been Java for the past ten years or so.

> Personally, I don't know why robotics clubs would use C++ anymore.

Neither do I. Python was my first idea too, but my brother is very, very insistent that it's C++ or bust and that he desperately needs to learn it immediately.

Also, I realize that C++ is probably the worst non-exotic language to use when first learning to program.
posted by Nomyte at 3:56 PM on July 25, 2012


Personally, I don't know why robotics clubs would use C++ anymore.

A robot's embedded systems are probably controlled with a C- or C++-based SDK. Perhaps there isn't an API available in a scripting language.

As well as book recommendations, he might take questions to Stack Overflow, a great resource for programming, in general.
posted by Blazecock Pileon at 4:11 PM on July 25, 2012


Personally, I don't know why robotics clubs would use C++ anymore. Computers are fast, and Python makes programming (and learning programming) a lot easier.

Arduino is programmed in C++.

I would first talk to the club mentor and find out what setup they'll be using. You could get him a book that walks through MS Visual Studio only to find out that all their programming is done in Linux with g++. Or vice-versa. The languages are the same, but the environments entirely different and it's going to frustrated a new learner.

Also, there's something called "embedded c++" which might be what he's using. It's a simpler version of C++ for restricted systems. IIRC, it doesn't have exceptions, multiple inheritance, etc. You wouldn't want to get a book that spends a lot of time on these topics if it's not relevant to what he's doing.
posted by sbutler at 4:27 PM on July 25, 2012


He is impatient, easily frustrated, and oftentimes very stubborn. He definitely lacks an internal locus of motivation. Robotics may easily turn out to be another thing that he gets excited about, buys a bunch of stuff for, and then quits after a week.

my brother is very, very insistent that it's C++ or bust and that he desperately needs to learn it immediately

Learning C++ compounded with learning to program for the first time is not something that will come quickly or comfortably. It will certainly not happen immediately. Moreover, there isn't exactly a litany of such books out there, simply because such a direction isn't generally taken. That being said, I'd recommend Accelerated C++.
posted by Algebra at 4:56 PM on July 25, 2012


Yes, APCS uses Java now. (They used Pascal when I did it. HA!)

I also agree that C/C++ isn't a neophyte language.

What I would suggest is to set him up with a machine that WILL compile a "hello world" program. If that part of the process is taken care of, he can work the examples in any textbook and get an idea for how it works at least.

If you want to really be a dick, teach him vi and make him program text only to start with.
posted by gjc at 7:30 PM on July 25, 2012


C++ is a bear of a language. It keeps growing more fur with each passing decade. That said, learning a useful subset of C++ is certainly possible and the majority of C++ programmers do just that. It is quite likely he can interface with the APIs they use by just knowing some C++.

But figuring out what book to get would be a tough task as the will all be broad. Finding a mentor in the program is going to be more helpful than finding a good book.
posted by chairface at 9:44 PM on July 25, 2012


C++ is a non-trivial language to learn really well, and it's not as forgiving as languages like Ruby or Python, but if he's set on C++, I wrote a book on C++ that was specifically designed to teach non-programmers to program in C++, starting with the very basics and without making any assumptions about prior programming experience. You can check out the table of contents and first chapter (which explains on how to get set up with a compiler--using lots of screenshots--as well as a bit of cheerleading on why you should learn C++) on the book's website.

Each chapter has both exercises and quizzes at the end that should give him a chance to practice.
posted by alexallain at 10:44 PM on July 25, 2012


C for Dummies by Dan Gookin, followed by C++ for Dummies.
posted by tel3path at 11:28 PM on July 25, 2012


Arduino is based on C/C++, and I'm not even sure if any C++ features are utilized.

I have no doubt that he is capable of learning C++ as his first language--but from what you've described, it sounds like he would really need a supportive classroom environment. Compiling code is not the friendliest beast. Concentration and patience are crucial when debugging.

I suggest that you get in contact with the teacher and ask what the best prepatory materials would be. The teacher may even chuckle at the suggestion that he learn C++ because they don't even get into that until 2nd quarter and then it's really only for a week (or something). It's difficult to come up with age-appropriate learning materials, so contact someone who does it for a living!
posted by semaphore at 4:38 AM on July 26, 2012


Response by poster: I ended up buying the ebook by alexallain. For a while it sounded like my brother was using it successfully, but then it turned out that he got a couple chapters in and then quit. Also, it doesn't sound like robotics is actually teaching him anything about programming or computers. Either they don't do anything structured with their students, or he's slacking off, or it's one of those things where students who already know how to do the work actually do the work and everyone else just watches.
posted by Nomyte at 10:18 PM on December 30, 2012


« Older How to make the following: 1 desktop + 1 desktop =...   |   I am 99% sure that I will still lose at Monopoly... Newer »
This thread is closed to new comments.