Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Beginning C++ programming  (Read 1834 times)

DDouble

  • Bay Watcher
    • View Profile
Beginning C++ programming
« on: March 15, 2008, 03:37:00 pm »

Hi forum,

I was really enthusiastic about programming in C++ as a kid, and I made a few text adventure games, and quiz/trivia games. Very simple stuff. I wanted to get back into it now, a decade later, and I was wondering what the best program/complier/books are to start from ground zero. Is there a specific program and accompanying book that is good for beginniners? I used to have C++ For Dummies, but it's about 10 years old now. I want something more recent.

And am I correct in thinking that all I need is a simple compiler, to begin making small games?

Logged

Davion

  • Bay Watcher
    • View Profile
Re: Beginning C++ programming
« Reply #1 on: March 15, 2008, 04:16:00 pm »

Microsoft has several Visual Studio Express editions that are free to download from their website, which are lightweight versions of their Microsoft Visual Studio 2008 product line; I also think they have Express editions for 2005 as well. Either one is a good, free option for people starting out in programming.

I also hear Python is a decent language, and coupled with Pygame you can make any kind of game you want. I've heard it's pretty easy to pick up, though that's subjective.

I don't really know much about reading material and books. I'd say you can learn the vast majority of beginning concepts through the internet via various tutorials, get yourself up to date that way, and then when a problem comes your way that you don't know how to solve THEN hit up the book store and see if you can find a book that explains advanced concepts. My main piece of advice is: don't run out and get a bunch of books on anything technical, especially "Beginners Books", because 99% of them are a waste of money.

[ March 15, 2008: Message edited by: Davion ]

Logged

Mel_Vixen

  • Bay Watcher
  • Hobby: accidently thread derailment
    • View Profile
Re: Beginning C++ programming
« Reply #2 on: March 15, 2008, 04:40:00 pm »

Python is an Interpreterlanguage (says german wiki) like Java so if you want to run Python progs on a Pc you have to install the python interpreter first.

Phyton is a good language for the Ai of roundbased games because you can change them without compiling but for many realtimeprogramms Phyton could be to slow like all interpreterlanguages.

If you want a Graphical User Interface start with C++ or C# and Microsoft foundation Classes (MFC). I know most programmers wouldnt use MFC but its a good and easy to learn framework for starters.

There are some free ebooks (and many programmlibrarys) on the internet which you can use too.

edit: Can annybody bump this thread to "Various Nonsense"

[ March 15, 2008: Message edited by: Heph ]

Logged
[sarcasm] You know what? I love grammar Nazis! They give me that warm and fuzzy feeling. I am so ashamed of my bad english and that my first language is German. [/sarcasm]

Proud to be a Furry.

Katawa

  • Bay Watcher
    • View Profile
Re: Beginning C++ programming
« Reply #3 on: March 15, 2008, 04:45:00 pm »

I agree with Heph, especially on the front of C#. If you plan on just developing for Windows it's probably the easiest thing to start with. Especially if you grab a copy of Microsoft's XNA.
Logged
att has been attacked by a dead and still annoying acquaintance lately.

DDouble

  • Bay Watcher
    • View Profile
Re: Beginning C++ programming
« Reply #4 on: March 15, 2008, 07:49:00 pm »

Thanks.

After consulting in another forum, I think I'll start trying to play with Java and Python. I'm sure there must be hundreds of online tutorials, buying a book shouldn't be necessary until I have a much better idea of what's going on and what kind of book would be relevant.

Logged

Lightman

  • Bay Watcher
  • The groboclones are looking for you.
    • View Profile
Re: Beginning C++ programming
« Reply #5 on: March 15, 2008, 08:00:00 pm »

Honestly, if you programmed in C++ before, things really haven't changed. It just depends what you want to program. There are loads of APIs out there to help you do everything from games to apps and, as has been stated, Microsoft offers their Visual C++ Express for free and it does a fine job of providing an IDE with a good debugger and class/struct tracking, etc.

I've seen a few good apps in Python... never seen any games. Java can be good, too but it's much slower than anything proper in C/C++. Again, it depends what you want to do. If all you want to do is write text games, you could really just use basic.

[ March 15, 2008: Message edited by: Lightman ]

Logged

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: Beginning C++ programming
« Reply #6 on: March 15, 2008, 08:17:00 pm »

The most compliant C++ compiler is GCC, this is available on linux and unix. There are partially functional versions available for windows as GCC for windows or CYGWIN.

C++ is probably the highest performance language that will still give you a good bit of object oriented abstraction. If you want to do game programming, its likely your best bet. JAVA is syntactically similar to C++ but with superior security and easier UI ability. It is however much slower.

Others have said that JAVA is interpreted, it is not, rather it is compiled into bytecodes that run on a virtualized machine. As a result its performance is most often much faster than "interpereted" languages.

For any purpose other than real-time systems or high powered graphics/simulation I would suggest java rather than C++.

[ March 15, 2008: Message edited by: Nadaka ]

Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

Nesoo

  • Bay Watcher
    • View Profile
Re: Beginning C++ programming
« Reply #7 on: March 15, 2008, 09:41:00 pm »

I use Dev-C++ (which has gcc bundled with it, if you so choose; probably a good idea unless you have some other compiler you want to use). As for reading material, I have but one acronym: MSDN. Not necessarily for (re)learning C++, but it's a good reference once you've got the hang of it.
Logged
000508 □ [dwarf mode][flows] flooding over a full pond will kill the fish inside

Yourself

  • Bay Watcher
    • View Profile
Re: Beginning C++ programming
« Reply #8 on: March 15, 2008, 09:57:00 pm »

quote:
Others have said that JAVA is interpreted, it is not, rather it is compiled into bytecodes that run on a virtualized machine. As a result its performance is most often much faster than "interpereted" languages.

That's a common feature of many interpreted languages.  I can't think of many interpreted languages off the top of my head that actually don't do this.  The fact that the code changes to a different form doesn't change the fact that they're still interpreted.  As long as that other form isn't machine code, anyway.  The presence of a virtual machine is what makes them interpreted.

Logged

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: Beginning C++ programming
« Reply #9 on: March 15, 2008, 11:07:00 pm »

quote:
Originally posted by Yourself:
<STRONG>

That's a common feature of many interpreted languages.  I can't think of many interpreted languages off the top of my head that actually don't do this.  The fact that the code changes to a different form doesn't change the fact that they're still interpreted.  As long as that other form isn't machine code, anyway.  The presence of a virtual machine is what makes them interpreted.</STRONG>


Not really... Java, Windows, Linux, OSX, FreeBSD can be and are all virtualized so that their "machine code" can work on a variety of hardware implementations and even run simultaneously on the same cpu. Besides that, there are machines (mostly thesis projects for EE or CS, few/none mass produced) that run java bytecodes as native binary. Take a look at the bytecode specification, its definition is pretty much identical to any other machine language.

An interpreted language combines tokenization, lexan, interpetation and execution all at the same time for each line of code. Java tokenizes, lexans, and interperets the entire class at once during compilation.

Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

numerobis

  • Bay Watcher
    • View Profile
Re: Beginning C++ programming
« Reply #10 on: March 16, 2008, 12:13:00 am »

quote:
Originally posted by Lightman:
<STRONG>Java can be good, too but it's much slower than anything proper in C/C++.</STRONG>

The usual claim is that the overhead of java compared to C/C++ is about 20-30%.  Of course, the fact that java allows you to more succinctly express certain things also means that you're tempted to do slow things.  But for equal effort, you shouldn't see a huge difference.

Logged

DJ

  • Bay Watcher
    • View Profile
Re: Beginning C++ programming
« Reply #11 on: March 16, 2008, 04:21:00 am »

I recommend C++ with SDL.
Logged
Urist, President has immigrated to your fortress!
Urist, President mandates the Dwarven Bill of Rights.

Cue magma.
Ah, the Magma Carta...

falsedan

  • Bay Watcher
    • View Profile
Re: Beginning C++ programming
« Reply #12 on: March 16, 2008, 08:33:00 am »

quote:
Originally posted by Nadaka:
<STRONG>

Not really... Java, Windows, Linux, OSX, FreeBSD can be and are all virtualized so that their "machine code" can work on a variety of hardware implementations and even run simultaneously on the same cpu. Besides that, there are machines (mostly thesis projects for EE or CS, few/none mass produced) that run java bytecodes as native binary. Take a look at the bytecode specification, its definition is pretty much identical to any other machine language.

An interpreted language combines tokenization, lexan, interpetation and execution all at the same time for each line of code. Java tokenizes, lexans, and interperets the entire class at once during compilation.</STRONG>


Java is virtualised in that the bytecode runs on a 'virtual machine' which interpreted java bytecode into native machine instructions. Windows, Linux, OSX, FreeBSD can be virtualised with programs like VMWare, Qemu, etc.

Also most modern dynamic languages (perl, python, ruby) will compile thier scripts into their own bytecode (perl6 and python will share the same VM called Parrot), and hell Common Lisp can compile code at run time and include it in the running process. Old BASIC interpreters would do all the lexing etc. at run-time, but modern programming languages are considerably more avanced than QBASIC.

Seconding the recommendation for Bloodshed's Dev-C++, which also comes with considerable module support, including an SDL module. You'll need a good STL reference, and of all the C++ books I would recommend Stroustrup because he designed the language, also "Bjarne Stroustrup" is fun to say.

If you go with Java, NetBeans is good for big applications, and Eclipse is a nice IDE for getting Java code up and running quickly.

Logged

aran

  • Escaped Lunatic
    • View Profile
Re: Beginning C++ programming
« Reply #13 on: March 17, 2008, 03:45:00 pm »

You can also use eclipse with a plug-in for C++ development. Eclipse is awesome and free. The more I use it, the more I like it.

I would suggest just learning C#, which basically has all the good points of Java (aside from relative platform independence, though the mono project is getting there) with few of the negative ones. It's also still evolving and has some incredible new stuff added to it, like WPF (Windows Presentation Framework) and LINQ.

Logged

The-Moon

  • Bay Watcher
    • View Profile
Re: Beginning C++ programming
« Reply #14 on: March 17, 2008, 05:21:00 pm »

quote:
Originally posted by DDouble:
<STRONG>Hi forum,

I was really enthusiastic about programming in C++ as a kid, and I made a few text adventure games, and quiz/trivia games. Very simple stuff. I wanted to get back into it now, a decade later, and I was wondering what the best program/complier/books are to start from ground zero. Is there a specific program and accompanying book that is good for beginniners? I used to have C++ For Dummies, but it's about 10 years old now. I want something more recent.

And am I correct in thinking that all I need is a simple compiler, to begin making small games?</STRONG>


The best IDE you can use is www.Codeblocks.org.  Beats the crap out of MSVC or DevC++ any day. Its open source as well.

Also check out www.gpwiki.org

If you want to do graphics the i suggest you use sdl, and if 3d graphics, then openGL. Try to stay away from directX.

These are also my opinions btw  :)

[ March 17, 2008: Message edited by: The-Moon ]

Logged
There is absolutely no time, to be taking time for granted. ~Busta Rhymes
Pages: [1] 2