As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

Guide an idiot through the start of C++ programming

_Y__Y_ Registered User regular
edited May 2007 in Help / Advice Forum
The search function didn't bring up anything useful.
Before I say anything, I am not open to classes.

For many, many years I've been using every known game 'maker' program in existence. In every single one I've ran into some issue that I can't get around and therefore I lose all my work and nothing ever comes into fruition.

(This is an accurate representation of how I feel: :x)

Well, enough of that crap. For my own sanity's sake, I need to learn something 'real.'

I've chosen C++ from the lot of suggestions despite the comments about its difficulty.
Now, I've searched long and far on the internet for tutorials and the like, and nearly every one had some problem like being outdated or assuming the reader has prior programming knowledge (except one), which is why I'm going to get some books!

And I need your suggestions!

If you know of any books (or anything else for that matter) that assume the reader has no previous programming knowledge/is completely stupid I would love to hear them. Accelerated C++ is currently in the mail as I type but it apparently teaches its own way so I'm also looking for other ones. This book looks capable, so any opinions on that would be lovely.

Help me, H/A! You're my only hope!

35.png
_Y_ on

Posts

  • Options
    Steel AngelSteel Angel Registered User regular
    edited May 2007
    I recall there being a few books by the guy credited with creating C++ that have been recommended, but I can't remember either the guy's name or the books. He has a nice sense of humor as well so I imagine the books would reflect that too.

    Steel Angel on
    Big Dookie wrote: »
    I found that tilting it doesn't work very well, and once I started jerking it, I got much better results.

    Steam Profile
    3DS: 3454-0268-5595 Battle.net: SteelAngel#1772
  • Options
    FristleFristle Registered User regular
    edited May 2007
    I've never programmed a game (except for some homebrew junk for GBA once and that was in assembly), but it seems like the only way to make something decent is to start with someone else's game engine. Otherwise the learning curve ahead of you is basically vertical. All professional game development is done with the help of some platform: the Unreal Engine, Doom 3 engine, Criterion software's Renderware, etc etc -- even developers starting from "scratch" on today's consoles are getting the benefit of the manufacturer's development kit. So I assume you're going to make the game for PCs -- I suggest finding an open source game engine (doesn't have to be C++ necessarily) and go from there.

    Have you looked at Microsoft's XNA?

    Here's one RSS feed you might subscribe to for a while.

    On a side note, I hear a lot of video game UI design these days is done in a language called LUA.

    Fristle on
    Fristle.jpg
  • Options
    japanjapan Registered User regular
    edited May 2007
    May be more general than you're looking for, but I'd recommend "How to Think like a Computer Scientist". It's a free download, as well as a print book. I used the Python version of it to wrap my head around Object Oriented concepts.

    japan on
  • Options
    _Y__Y_ Registered User regular
    edited May 2007
    Fristle wrote: »
    I've never programmed a game (except for some homebrew junk for GBA once and that was in assembly), but it seems like the only way to make something decent is to start with someone else's game engine. Otherwise the learning curve ahead of you is basically vertical. All professional game development is done with the help of some platform: the Unreal Engine, Doom 3 engine, Criterion software's Renderware, etc etc -- even developers starting from "scratch" on today's consoles are getting the benefit of the manufacturer's development kit. So I assume you're going to make the game for PCs -- I suggest finding an open source game engine (doesn't have to be C++ necessarily) and go from there.

    Have you looked at Microsoft's XNA?

    Here's one RSS feed you might subscribe to for a while.

    On a side note, I hear a lot of video game UI design these days is done in a language called LUA.

    This is more or less for fun at the moment. I have a lot of time on my hands and it's the one of the few things I'm genuinely interested in.

    What I mean when I say 'I want to program games' is I'd like to make, say, the next Cave Story. Or better yet, I want to know how Cave Story works. I don't want to create a Doom, an Oblivion. I want to recreate Kirby's Adventure, Link's Awakening, Final Fantasy 6. Anything past 2D--anything that would require a company to make--is too far away at the moment.

    XNA did look interesting but I don't know anything about it. I'll have to look more into it.
    japan wrote: »
    May be more general than you're looking for, but I'd recommend "How to Think like a Computer Scientist". It's a free download, as well as a print book. I used the Python version of it to wrap my head around Object Oriented concepts.

    Will most definitely check that out.

    _Y_ on
    35.png
  • Options
    Xenocide GeekXenocide Geek Registered User regular
    edited May 2007
    Those things you've listed are all huge undertakings.

    I'm not saying you couldn't do it, but be prepared to invest years of your life into doin' that kind of thing. (for learning the programming language, and then actually undertaking the project).

    This is not simple stuff.

    Xenocide Geek on
    i wanted love, i needed love
    most of all, most of all
    someone said true love was dead
    but i'm bound to fall
    bound to fall for you
    oh what can i do
  • Options
    FristleFristle Registered User regular
    edited May 2007
    You might find that something like C# has all the flexibility you need. I came across a series of articles at Microsoft on "learning to program the fun way" and using C# to do game development (2D and 3D).

    Fristle on
    Fristle.jpg
  • Options
    _Y__Y_ Registered User regular
    edited May 2007
    Those things you've listed are all huge undertakings.

    I'm not saying you couldn't do it, but be prepared to invest years of your life into doin' that kind of thing. (for learning the programming language, and then actually undertaking the project).

    This is not simple stuff.

    I've got all the time in the world. The previously mentioned Cave Story took five years to make. I expect to take just as long.
    And, of course, I can think of many other reasons besides games to learn a programming language. ;-)
    Fristle wrote: »
    You might find that something like C# has all the flexibility you need. I came across a series of articles at Microsoft on "learning to program the fun way" and using C# to do game development (2D and 3D).

    Will most definitely watch these. C# was a sort of my alternative as many of the opinions about it sounded like what I want. Figured I'd just try C++ first.

    _Y_ on
    35.png
  • Options
    SeñorAmorSeñorAmor !!! Registered User regular
    edited May 2007
    Slightly off-topic (but not worth its own thread):

    I, too, am interested in learning C and its variants, but have no programming experience. I'm quite adept with PHP and Perl, and while I realize C and PHP/Perl are completely different languages, I'm curious if there are enough similarities to give me a little bit of an advantage when trying to learn a "real" language.

    SeñorAmor on
  • Options
    FristleFristle Registered User regular
    edited May 2007
    Slightly off-topic (but not worth its own thread):

    I, too, am interested in learning C and its variants, but have no programming experience. I'm quite adept with PHP and Perl, and while I realize C and PHP/Perl are completely different languages, I'm curious if there are enough similarities to give me a little bit of an advantage when trying to learn a "real" language.

    Not really, no. Well maybe a little. Don't sell yourself short though, if you are adept at PHP and Perl, then by all means you do have programming experience. Just not in a compiled language.

    Fristle on
    Fristle.jpg
  • Options
    tdonlantdonlan Registered User regular
    edited May 2007
    PHP and Perl are scripting languages and are intepreted. C, C++, C#, Java, etc are compiled.

    Many of the modern scripting languages are actually pretty similar in syntax/functionality to programming languages aka - you call functions/methods, you have complex data types (arrays, structures, lists, etc). If you understand those concepts, making the jump shouldn't be all that hard.

    However, if you are a complete newbie, I wouldn't recommend C++. It's a powerful language if you are an expert, but for a beginner its pretty limited. You'll be able to output strings on a command line, but to go beyond that (graphics), you'll have to understand the Windows API or download third party packages.

    Therefore, go with Java or C#. Both are available free and have some nice IDEs (integrated developer environment) which really aid in development.

    Also, if you are interested in game programming, start with Pong. Then do Tetris. These are pretty much the game programming 101 examples. (I had to do Tetris in Java for my comp sci 102 class in college). Both will teach you the fundamentals of game programming - the game loop, buffered graphics, states (or animations if you want to get fancy).

    Good luck with it - and if you make anything, post it here!

    tdonlan on
    ==========
    |daydalus.net|
    ==========
  • Options
    _Y__Y_ Registered User regular
    edited May 2007
    tdonlan wrote: »
    However, if you are a complete newbie, I wouldn't recommend C++. It's a powerful language if you are an expert, but for a beginner its pretty limited. You'll be able to output strings on a command line, but to go beyond that (graphics), you'll have to understand the Windows API or download third party packages.

    I hear SDL quite a bit for ease of use. It isn't exactly DirectX or anything, but after looking over it I believe it has all I need. Any opinions on that would be greatly appreciated also.
    tdonlan wrote:
    Also, if you are interested in game programming, start with Pong. Then do Tetris. These are pretty much the game programming 101 examples. (I had to do Tetris in Java for my comp sci 102 class in college). Both will teach you the fundamentals of game programming - the game loop, buffered graphics, states (or animations if you want to get fancy).

    I heard Tic-Tac-Toe was the best way to start. :P
    tdonlan wrote:
    Good luck with it - and if you make anything, post it here!

    <3

    _Y_ on
    35.png
  • Options
    DrFrylockDrFrylock Registered User regular
    edited May 2007
    C++ was a decent language in, say, 1992. At that point, it had some crufty object-oriented stuff, was reasonably fast and had good tool support on many platforms, allowed you to reuse your C skillset, and so on.

    Then the world changed, for two reasons.

    First, C++ itself got substantially uglier. The templates and the new C++ standards and namespaces and many, many other things make the language increasingly cumbersome and complex. Sure, these can be powerful features, but they're not really implemented in the most elegant of ways. C++ also didn't get things like garbage collection that simplify the world. Perennial poorly-integrated C++ features like operator overloading and copy constructors remained as well.

    Second, the alternatives got better. You can now write high-performance code in Java or C# or hell, even Python, languages that have garbage collection, have better support for dynamism, reflection, and generics (although I have issues with Java's generics for a number of substantive reasons).

    If you insist on learning C++, the book you want is The C++ Primer Plus. I've read many different C++ tutorial books in 20 years of programming and this one is undoubtedly the best.

    DrFrylock on
  • Options
    FristleFristle Registered User regular
    edited May 2007
    DrFrylock wrote: »
    C++ was a decent language in, say, 1992.

    Yea, it's all I ever use, because my particular niche requires it, but I get the feeling it's just not in style anymore. The standard libraries for C++ lack any of the things a modern programmer would need: a GUI, multi-threading, networking. The reason other languages are so popular is because of the libraries they come with out of the box. You need libraries to get anything done in a reasonable amount of time anymore.

    Fristle on
    Fristle.jpg
  • Options
    AngelHedgieAngelHedgie Registered User regular
    edited May 2007
    _Y_ wrote: »
    tdonlan wrote:
    Also, if you are interested in game programming, start with Pong. Then do Tetris. These are pretty much the game programming 101 examples. (I had to do Tetris in Java for my comp sci 102 class in college). Both will teach you the fundamentals of game programming - the game loop, buffered graphics, states (or animations if you want to get fancy).

    I heard Tic-Tac-Toe was the best way to start. :P
    Not really...that means you have to implement a computer player. It's a good choice to start with something that doesnt' have you playing against someone. Personally, I've always liked implementing Conway's Game of Life (hacked together an XNA version in about a day a while back.)

    AngelHedgie on
    XBL: Nox Aeternum / PSN: NoxAeternum / NN:NoxAeternum / Steam: noxaeternum
  • Options
    romanqwertyromanqwerty Registered User regular
    edited May 2007
    C# for a beginner definatly. C++ is great but is dastardly to learn. I was taught C# in high school and it was great, easy to understand as a first language (2nd if u count html :P).

    I also agree u should learn simple games like pong and tetris. They do teach u the fundamentals and there are alot of easy walkthroughs.

    romanqwerty on
  • Options
    clsCorwinclsCorwin Registered User regular
    edited May 2007
    I recall there being a few books by the guy credited with creating C++ that have been recommended, but I can't remember either the guy's name or the books. He has a nice sense of humor as well so I imagine the books would reflect that too.

    Bjarne Stroustrup

    clsCorwin on
  • Options
    TechnicalityTechnicality Registered User regular
    edited May 2007
    I agree with all the people suggesting alternatives. The best way to learn C++ is to learn something similar first. In addition to the existing suggestions I recommend Flash.

    Technicality on
    handt.jpg tor.jpg

  • Options
    clsCorwinclsCorwin Registered User regular
    edited May 2007
    Start with Java. It will be familiar ground for when you decide to try your hand at C++

    clsCorwin on
  • Options
    MasterDebaterMasterDebater Registered User regular
    edited May 2007
    One of my profs mentioned that he had met Bjarne Stroustrup on several occasions, and asked him several pointed questions about C++. His response?

    "Hey, I made the language for me to use. I certainly didn't expect anyone else to like it!" :p


    But yeah, if you're just learning programming I would go one of two routes:

    a. C#, download one of the free versions of Visual Studio, and find some good examples. If you want to do any game stuff, get the XNA add-on as well (it comes with a playable game that you can screw around with, and there are examples on the web).
    b. Java, download Eclipse, bookmark the Javadocs, and sniff around for some examples.

    I found that if you're new, it's way easier if you have the good IDE like VS or Eclipse, with syntax completion and auto-suggest.

    EDIT

    Also, the syntax of Java and C# are very similar, so if you learn one you can learn the other pretty quickly, and move on from there to C++ if you want (I picked up C# in a few hours - and most of that was because I had been using an outdated version of Java).

    MasterDebater on
  • Options
    _Y__Y_ Registered User regular
    edited May 2007
    I see. So C# and Java are the preferred. Thanks for the input guys. <3 I'll go look up some tutorials and books for both of those and get started.

    _Y_ on
    35.png
  • Options
    Steel AngelSteel Angel Registered User regular
    edited May 2007
    One of my profs mentioned that he had met Bjarne Stroustrup on several occasions, and asked him several pointed questions about C++. His response?

    "Hey, I made the language for me to use. I certainly didn't expect anyone else to like it!" :p

    One of my professors also had a chance to listen to him once. He regaled us with how Bjarne described certain aspects of C++'s data hiding: "In C++, friends let other friends touch their private members."
    _Y_ wrote:
    I see. So C# and Java are the preferred. Thanks for the input guys. I'll go look up some tutorials and books for both of those and get started.

    The official Java site has some links to tutorials and the API you may want to look at. It's at java.sun.com and the API is something you should have on hand as you get more into programming in it.

    Steel Angel on
    Big Dookie wrote: »
    I found that tilting it doesn't work very well, and once I started jerking it, I got much better results.

    Steam Profile
    3DS: 3454-0268-5595 Battle.net: SteelAngel#1772
  • Options
    Sk1nnyManSk1nnyMan Registered User regular
    edited May 2007
    I would suggest Java, its more forgiving than C or C++ yet still teaches the same concepts as C++ (Java was actually based on C).

    I have been doing Java for a year now and I can read and understand quite a bit of C code without any real introduction, except some basic "This is called X in Java" stuff.

    The book I can suggest for an introduction to Java and Object Orientated languages in general is:
    Ojects First with Java
    Third Edition
    by David J.Barnes and Michael Kolling
    ISBN 013197629X

    This textbook is very good, if you put the time in you really learn what to do.

    If you get good at Java then the progression to C and C++ will be a lot easier than learning from scratch (I count game makers as from scratch).

    Sk1nnyMan on
    [SIGPIC][/SIGPIC]
  • Options
    JohnnyCacheJohnnyCache Starting Defense Place at the tableRegistered User regular
    edited May 2007
    C++ is a LOT of material to pick up with no instruction. That's an awful lot like saying "I want to learn to box from how-to books"

    You're cheating yourself if you don't get some help with this task. You might do it, but there's no reason to, and a decent teacher might trim your time on this by anywhere from 1000 to 300%.

    ANYWAY.

    I will give a negative review here: Avoid the "teach yourself in 21 days" series. I had a class with one of their books as a text, and it was so rife with typos that we had a whole separate "spot the typo" lesson every class, then did the real lesson.

    As you're about to learn, typos in your instructional materials and examples are BAD in this subject.

    JohnnyCache on
  • Options
    _Y__Y_ Registered User regular
    edited May 2007
    C++ is a LOT of material to pick up with no instruction. That's an awful lot like saying "I want to learn to box from how-to books"

    You're cheating yourself if you don't get some help with this task. You might do it, but there's no reason to, and a decent teacher might trim your time on this by anywhere from 1000 to 300%.

    I've heard a bunch of different opinions on using books to learn these things, and most say they are at the very least capable. An honest to God teacher would help wonders, no doubt, but a particular exploding truck wheel has left my family in a wee bit of a money bind. A book is cheap enough, a full course will have to wait.

    I've also decided to heed the warnings about C++ and try C# instead. I am currently thoroughly enjoying Fristle's C# podcast suggestion and hope it will supplement books enough to really get started.
    ANYWAY.

    I will give a negative review here: Avoid the "teach yourself in 21 days" series. I had a class with one of their books as a text, and it was so rife with typos that we had a whole separate "spot the typo" lesson every class, then did the real lesson.

    As you're about to learn, typos in your instructional materials and examples are BAD in this subject.

    I avoid "Learn X in Y time!" books like the plague. I mean, being eager to learn is good, but wanting to learn something fast rather than well is just stupid.

    _Y_ on
    35.png
  • Options
    AngelHedgieAngelHedgie Registered User regular
    edited May 2007
    One thing to remember though is that there's a number of people on this forum who make their living writing code. So if you get stumped, you can always ask.

    AngelHedgie on
    XBL: Nox Aeternum / PSN: NoxAeternum / NN:NoxAeternum / Steam: noxaeternum
Sign In or Register to comment.