newbie

Pages: 12
hello, i am a newbie who doesn't have any programming experience.
i heard that python is great to start with, but i prefer to begin with c++ because it's known as the best for game programming.

1) is it okay to learn c++ for a newbie?
2) is c++ really the best for game programming?
3) which software should i use to program in c++? (i am a mac user.)
Last edited on
yes to 1 and 2 I use windows so not sure about 3. as for one its ok to learn c++ but you might have a better time learning something simpler first. I'd say more but gotta go eat.
1. I learned c++ as a programming newbie
2. This is greatly a matter of opinion, but it is one of the best.
3. I just googled and found this forum post:
http://www.cplusplus.com/forum/beginner/675/

I haven't looked at Python yet, but I do hear it is great for beginners.
I think "game development" is more than programming or c++.But c++ is in common usage in game programming.I've coded simple games such as mine sweeper [in C] but that's all.If you plan to stay at amateur level like me,use a language that is easy to learn.
XCode provided by Apple is my favorite among development software on Mac;)
1) Yes. It's true that there are some counterintuitive things in C++, but that's pretty much true for all languages I know.
2) There is no such thing as "the best" in programming. It all depends on the situation, like how fast the program has to be (nowadays for most programs speed doesn't matter too much anymore), how the game's rules are etc etc. What I can tell you though is that C++ is an extremely widespread language, so if you go for C++ you'll have it easy to find tutorials or books for game programming. Finding something that is mac compatible will be more of a problem.
3) Code::Blocks is what I am using, and it runs on macs. Might wanna check that one out. For starters, you just need a compiler (see here on how to get the gcc compiler for mac: http://www.tech-recipes.com/rx/726/mac-os-x-install-gcc-compiler/ ) and a text editor that outputs plain text files.



As to Python: I heard many people say already that Python "is a great language for beginners" or stuff like that. One thing: It's not.
Python is a great and easy to use language- if you already know how to program stuff. Complete beginners to programming tend to get confused by Pythons structure, and to create code that is incomprehensible for any sentient being. In C++ you can create messy code too, but at least it has to follow SOME structure, so most of the times you can at least guess what someone else was trying to do.
thanks for all the great answers!
i'm so thrilled to start learning c++!
@ hanst:

3 good points, but...

You obviously have no experience with Python! It IS one of the best beginner languages. It is concise, elegant, explicit and versatile. Just because it's capable of OOP and has upper-level data structures built in doesn't mean you have to use them when you're just starting out. Plus, with modules like PyGame (an SDL wrapper) you have a great way to learn basic game programming, OOP and how to use those advanced structures (without having to roll your own like you would in C++) while you create simple games right from the start. And since Python is written in C you have a good segue into C/C++ programming when the time comes for you to optimize your Python code with C++ calls.
I miss C++...its so bad that i forget everything about it cause i didn't use my programming skill after i graduated...
@hanst:
The basic TextEdit app can output plain text files. It's just set up so that the default is not to, and I'll agree that there are far better solutions. :)

A minimalist text editor I might recommend for the purposes of programming on a Mac might be TextWrangler, or Smultron (this one is a bit old, so I won't provide a download link).
http://www.barebones.com/products/textwrangler/download.html

And... um... what do you mean in the context of answer #2 when you say "mac compatible"?

-Albatross
closed account (zb0S216C)
I've read multiple books and some of them seem to suggest learning C first for obvious reasons.

I started of with C++ and now I regret it. So I've started to learn C and C++ makes more sense.

Remember: Everybody's brain processes information differently and our body has requirements to learn efficiently. For example, my brain seems to process information better at night with music from my headphones. Somebody else's brain probably processes information better when hanging upside down. It's all about finding what keeps you focused and what sources you're extracting information from.

This is purely my opinion though.
Well, I started with Python, and I think for someone who's new to programming, maybe just learn the Python basics first. Python is great for beginners, and you can still make games with Python too. If you want to use Python then there is something called Pygame. It has some stuff that helps make games, but it needs SDL, and SDL can't really download on Mac. SO. You can register as an Apple developer for free and get Xcode for free and use Xcode to work around this download problem. Get tutorials online to help you do this. I would actually just learn the basics of Python and experiment with Pygame until you're content and think that you get everything. Then I would go to C++ right after that. Don't be sad about not getting to use C++ right away. Python is really fun too, but do learn C++ when you think you're ready. I'm not trying to talk you down, It's just if you have not had a single bit of experience, I think it would be best to learn Python first. OR. You could just ignore my advice and just get right to the C++ing! If you feel really strongly that you should learn C++ first, just do it! Good luck! :)
Last edited on

You obviously have no experience with Python! It IS one of the best beginner languages. It is concise, elegant, explicit and versatile. Just because it's capable of OOP and has upper-level data structures built in doesn't mean you have to use them when you're just starting out. Plus, with modules like PyGame (an SDL wrapper) you have a great way to learn basic game programming, OOP and how to use those advanced structures (without having to roll your own like you would in C++) while you create simple games right from the start. And since Python is written in C you have a good segue into C/C++ programming when the time comes for you to optimize your Python code with C++ calls.


I do have experience with Python myself, and more importantly with the horrible mess Python beginners tend to produce. Does

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
imports
code
function definition
global variables
code 
code
function definition
class definition
code
class definition
code
class definition
global variables
code
code
function definition
global variables
code


ring a bell? Python in itself is easy to use, but it's structure is very loose, so newbie programmers tend to produce that kind of code more often.
Last edited on
Just a warning that people who try to learn programming, especially c++ programming JUST for games are usually not going to stick around for it. because game programming is difficult and you basically end up needing to learn alot of stuff along the way, enough to get you jobs in programming probably.
closed account (zb0S216C)
Just a warning that people who try to learn programming, especially c++ programming JUST for games are usually not going to stick around for it. because game programming is difficult and you basically end up needing to learn alot of stuff along the way, enough to get you jobs in programming probably.

This is true. Learning C++ for game programming is OK. However, you may or will need to learn various libraries such as Nvidia's PhysX( If your game supports physics ), Direct3D for drawing your game, producing sound and I/O, and AI is far more complex than drawing a cube.

Once you know how to program in C++, you still have to learn the libraries that make game production possible( that's if you aren't writing all the libraries from scratch ).
that's if you aren't writing all the libraries from scratch

Not really. For graphics, writing own libs isn't really an option (well, except higher level functions for OpenGL or Direct3D). The only thing of those you'd normally even think about writing yourself (again, except for getting the whole thing on a higher level, or making the code more portable) would be the physics.

Though what you need for game programming is not exactly enough to get you a job- for example, one can have used C++ for years, and may have written games for a very long time... but may still not be able to write a clean assignment operator.
@Framework

Might I ask where you can get those libraries for Mac?
DirectX is windows exclusive. For Mac, you could try OpenAL, OpenGL, Allegro5 ... there is also a C++ bind for Panda3D, not sure but I think that one works on macs too.
I don't think I'll be putting my games on Panda3D, I don't think the website works for Mac either...
Ever since i can remember I have wanted to make games. Little ones, Big Ones, any game will do. But when I was reading through the 1994 book Beginning C++ I made it to the chapter on functions, and it used Tic-Tac-Toe has an example.

When I was able to display that grid it was pure ecstasy. The challenge was awesome seeing as before this I had only output a variable x to the screen in Basic.

But this. Tic-Tac-Toe. I will continue my trek through C++. If it gets hard that what you guys are for. Most of you seem to love it/hate it. But the love is still there.

If you want to be challenged then stick to it.

Set the difficulty to Insane and go with it.
Pages: 12