And now for some C++

Okay, well time has come that I should learn c++. I know C, I know some Pascal, even know a touch of basic and asm. However C++ is the money language. Okay yes there are newer languages out there, however right now the games industry still seems to see C++ as a standard. And if I ever need to fall back on something I should use it. I’m starting with a book I manage to get for free calle Programming and Problem Solving in C++ (2nd Edition and they’re up to like 4 or 5 now), by Nell Dale, Chip Weems, and Mark Headington. Most people i’ve talked to never heard of this book but I’ve read through it. It’s an introductory mostly for people who haven’t really programmed before. I realize I know programming well enough (go to the old uhfgames pages to see 3 games i’ve made, although uhfgames.com itself does not exist anymore), but I wanted to start as though I were a beginner.

So I talked to a few people about how to approach this book. A few said to type in the examples. Been there, done that. Well in C at any rate. I don’t think I learned it that fast because it was never really that fun for me. (I’m only programming because I can’t get someone else to program my games for me, or at least not yet). One person said I should make small example programs but no games, based on concepts learned in the book. Okay little example programs I can go with, but again it’s not very fun, so i’m choosing to build little games whenever I can manage it. So some agree with me though that you should make tons of little games whenever you can do it. So I’m going through the chapter and noticing I can’t really do much but output stuff on the screen. So question is, should I make a game as soon as I can, even without having “learned” a concept that would make it easier? (by learned i mean come to it in the book. I know about input and output, and arrays and variables and everything else you learn in C) . For instance a tic-tac-toe game benfits greatly if you use an array to represent the board. But how about if I don’t get to the chapter that covers arrays. Should i make a tic-tac-toe that writes each “cell” as a seperate variable, or do I wait until i get to arrays. Tough questions — at least for me. At any rate this should prove interesting.

Okay so the 2nd chapter of this book only introduces the char type, and the string class. And it only shows how to output to the screen. The fact it shows a full working program with comments is inconsequential to my learning. In it there’s a case study or example about writing a program that prints a form letter to the screen. Now i’m looking at this, and saying form letter doesn’t sound very fun. So I came up with an idea. All I know at this point (well at a beginners point) is that I can just output text to the screen, I can use named constants, and I can use the string class (barely). So I could either write a story and use the c++ cout stream command to write it out, which is sort of useless as i can do this in any word processor. Or I could make a “madlibs” style program. Of course with madlibs you need input, but I figure I can add input when I “learn” (again come to it) it. So I figured I could use named constants (it describes named constants as well as variables) to change the story content until I get to input.

Does this sound like a good or bad idea?

Keith

One Response to “And now for some C++”

  1. Uhfgood’s great and powerful blog! » Blog Archive » Projects and Programming, what to do? Says:

    […] Uhfgood’s great and powerful blog! Mumblings from an independent game developer. « And now for some C++ […]