Where do I go after learning C++ basics?

I'm a college freshman of science major. 3 years ago I bought an introductory book (Sams Teach Yourself C++ in 21 Days by Jesse Liberty), and with scattered bits of effort, I finally finished reading it last Sunday. I won't dare use the phrase "I've learned C++", but I believe I'm equipped with sufficient knowledge to go on to the next stage. The problem is, what's next?

I've googled around on this topic and have seen varieties of answers. Some advised on working on real projects, which I have none. Some suggested learning assembly language / CSS / HTML, etc. Some said if I don't know what to do, then programming isn't for me (which I totally disagree).

Could you offer some of your advice? Coding isn't my major and I can't work on it full-time. However, I'm prepared to devote and can do a bit of work every day. What do I do next to further develop this (serious) hobby of mine?
Try yourself at coding contests:) http://uva.onlinejudge.org/
Read more books. Effective C++ by Scott Meyers is targeted for your level of experience. Generic Programming and the STL is pretty cool. After those check out the GoF book, Design Patterns.
Last edited on
Go back and re-read it to catch the other 50% you might have missed. No offense - C++ is such a huge language that nobody can simply sit down and read a book on it and claim to know much at all. It's like doing nothing more than reading a textbook on the German language and then calling yourself versed in German, not having spoken or written a single word of it.

Learning to program is an iterative process. You write code. You find there are things you don't know. You go back and read up on them, then apply that new knowledge to new programs you write. Rinse and repeat. I have been programming in C++ for more than 10 years having never read a single C++ book cover to cover. I write code. I find things I don't know. I research them, then apply what I've learned. (In fact, the only C++ book I own right now is "Beyond the C++ Standard Library" and even that I don't use -- I find boost's website more useful).

What's next is to get an idea for a program and go code it. When I was in college, I wrote a college football simulator which was modeled after an old BASIC program I had in a book. I did it because I liked the idea of the original BASIC program, but I wanted to add features. I wrote that program at least 3 times -- the first one in spaghetti code BASIC, which did just a little more than the original, the second in structured QuickBASIC, and the third in object-oriented Turbo Pascal. The final version had a text-based interface similar to Borland's old TurboVision library and was over 12,000 lines of code (compared to the couple hundred of the original BASIC program I copied).
Thanks to all the replies.

I see there are two mainstreams here. One is reading books. The other is writing codes. Here are my problems with the two approaches. I lay them here in hope that I can get more specific replies.

With Reading Books: I live in China and don't have access to many of the books you mention by name or ISBN. While providing the names of the books (so that I can look for them in the Imported section of the bookstore), could you also offer some topics on which I should seek books? I see moorecm mentioned STL and Generic Programming. Are these good topics to explore at my level?

With Writing Codes: I see what jsmith means here. However, off the top of my head, I can't think of anything to write. It's like learning German in that I have learned something by book but have no one to talk to. What are you hints at programs I can write in order to learn more?
STL yes. Generic programming no. That is a fairly advanced topic. You should become completely comfortable with
the STL and writing your own templates before tackling that.

Write something that is interesting to you. Write a little database program that allows you to enter all of your CDs
or books. You can then search by title, author, song title, whatever. It'll be useful to you (ok, I know there are a
lot fancier programs out there that do the same thing.) Or make a game. Write pac-man for an xterm using curses.
(or are you too young to know what pac-man is?)

With Writing Codes: I see what jsmith means here. However, off the top of my head, I can't think of anything to write


Maybe this is just me....

but if you don't have anything you want to write, why do you want to learn C++?
closed account (z05DSL3A)
The problem is, what's next?

Data Structures, Algorithms (analysis and design), object oriented analysis and design...
Thank you, for all the replies.

@jsmith
I'll look into STL.

I think pac-man is the bean-eating game which Google had made a doodle a while ago? I used to play that when I was a kid. However, I have no idea what an xterm or curses are. :(

All the programs I've made so far run in the big black box (the console?). I guess making a game like pac-man requires something more than that. What should I learn?

@Disch
For several reasons. I'm a science major, so I might need to code in the future. I want to make programs for my computer and cellphone to meet my own special needs. And I'm interested. I do have a big goal in mind. I want to make a Morse Code CW trainer before I graduate. However I have totally no idea how far I am from that goal.
Just an FYI, I've found Java far more useful for undergraduate academic work. I've thrown together two-tier database applications and even a distributed system with server failover for one of my class projects.

If you're looking into it to see if you might like to pursue a position using C++, that is a great reason. The main topic to focus on is the STL. It's not only standard, a common subject in interviews, and pretty cool, but it will also give you some insight into a few design patterns (iterator, adapter, etc.).
@riff: As the others said, STL first. It's a major part of the C++ language (well, kinda) and the STL classes are good examples for OOP.

For drawing graphics like in Pacman you need methods to draw graphics, which are not part of the C++ standard. There are a bunch of graphics API's out there, just pick something (better research it a bit to make sure it's still maintained, it's probably not a good idea to learn something just to find out there is a better solution) and go with that one.


Oh, and graphics may or may not, depending on what exactly you are trying to do, require you to be quite versatile at maths. As a science student that is expected from you anyways though so that shouldn't really be a problem.
Topic archived. No new replies allowed.