Sign in to follow this  

Continue or Postpone.....

This topic is 3291 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

First off, I've been lurking these forums for a bit to find a suitable answer to my query so I wouldn't have to run the risk of embarrassing myself on probably an obvious issue by posting, but I have had no such luck. And so, hello. I am relatively young (15, freshmen in high school) and for the past few years I have held an interest in making a game. Recently though, my desire and interest to create something as increased and lulled me to pursue a more avid interest in programming (something that I wanted/needed to do from the start). This ultimately led me to buy C++ Primer Plus (fourth edition as the local bookstore did not seem to carry the firth) as I have made no progress with online tutorials as reading excessive text on a monitor strains my already horrible eyes even more so against a bright background, lack of depth, and generally unsuitable. I am having a difficult time grasping some of this now even, most likely because I just suck at this. This leads to my question....should I postpone learning C++ for pursuit of a simpler language or just push through it? I have tried Python but did not have much a taste for it....it seemed to be too simple, though maybe because I was approaching it in the wrong way. I have even taken a look at C#, but that also feels weird to me, after getting used to some of the basic C++ stuff (such as using 'cout<<' whereas in C# 'Console.WriteLine()'). I have only spoken to a couple of people about this (one advocating Python who loves to do everything with it, and another who prefers to do everything in C++) and I have trouble realizing which is best for me seeing as they are obviously biased. I don't know what to do really. I just want to start off simple, if you count a small, fundamental text RPG* simple, making games as a hobby right now to just sort of say I made/can make a game and maybe get into the industry later on. I am aware that there is a vast amount of work involved in pretty much everything though. To reiterate my question, continue to attempt to learn C++, seeing as I'm already into it some, or postpone and learn a simpler language to better fully understand the basics, giving Python or C# (is it classified as a "simple" language?) another shot? No matter the choice, I would feel better having someone Else's opinion and support on whatever I chose. Hopefully no one will go "tl;dr" :P. *by small and fundamental I mean just having a few player stats, a single quest, a basic turn based combat system and a simple town for a few various things EDIT: IF need be I'll start off on something else. I'll listen/do to whatever you guys advise.

Share this post


Link to post
Share on other sites
What feels like the best course of action to you?


You'll need to persist with whatever language you want to learn if you want to get anywhere, but if you're really stuck with C++ then another language may be a better option for you in the meantime - this depends on you personally though, and we can't really tell you that you'll be better off with either option.



I personally would recommend that as a beginner Python or C# may be more suitable to you than C++, but as I've said, C++ is still a valid option if you're willing to stick with it and push through the difficulties. While these languages (Python and C# that is) are simpler to use, they're still capable of very impressive results and will ultimately help you learn programming just as well (if not better) than C++ would. With joining the industry as a distant and only potential goal there's really no strong reason C++ needs to be your current language of choice unless it's your personal preference.

This is a personal choice, and we can't really guarantee that either option will be better suited to you. The important thing more than any other decision is to pick either option, even if it might be the 'wrong' one and stick with it enough to learn programming.

Share this post


Link to post
Share on other sites
Quote:
I have made no progress with online tutorials as reading excessive text on a monitor strains my already horrible eyes even more so against a bright background, lack of depth, and generally unsuitable.
Check your monitor's refresh rate. They often default at 60 hz which gives me a headache. If you can raise it to 85 or 100 it may help. Of course you should also tweak the brightness/contrast to your liking. Try setting the font to a larger size. Try ClearType on or off. Lower the resolution to 1024*768. There's a lot of little things like that can make reading more comfortable.
Quote:
I am having a difficult time grasping some of this now even, most likely because I just suck at this. This leads to my question....should I postpone learning C++ for pursuit of a simpler language or just push through it? I have tried Python but did not have much a taste for it....it seemed to be too simple, though maybe because I was approaching it in the wrong way.
People sometimes mistake simple for limited. Really anything you would be doing in C++ you can do in Python (assuming you wouldn't be creating your own device drivers or operating systems). All of the major languages are "Turing equivelent", which is a fancy term meaning any program can be translated from one to another, practicality issues aside.

Also, the tutorials you're reading are obviously going to start with the simplest constructs and work up slowly. You probably haven't gotten far enough to see how complex a Python program can truly be.
Quote:
I have even taken a look at C#, but that also feels weird to me, after getting used to some of the basic C++ stuff (such as using 'cout<<' whereas in C# 'Console.WriteLine()').

I have only spoken to a couple of people about this (one advocating Python who loves to do everything with it, and another who prefers to do everything in C++) and I have trouble realizing which is best for me seeing as they are obviously biased. I don't know what to do really. I just want to start off simple, if you count a small, fundamental text RPG* simple, making games as a hobby right now to just sort of say I made/can make a game and maybe get into the industry later on. I am aware that there is a vast amount of work involved in pretty much everything though.

To reiterate my question, continue to attempt to learn C++, seeing as I'm already into it some, or postpone and learn a simpler language to better fully understand the basics, giving Python or C# (is it classified as a "simple" language?) another shot?
Go with a simpler language. I recommend Python. Text processing is a breeze in Python. Yeah, when you move on to another language you will miss the methods you "got used too" but that's just life. You will eventually learn many languages and it won't be such a big deal. But for learning I will always try to steer people to Python. And you don't have to abandon it when you get more advanced. I personally changed to Python after years of C++ because I'm just so much more effecient with it. There are libraries for most game-related things you are likely to want, including high-performance 3D graphics.

And there are many Python pros here on the forums to help you along the way, if that's what you choose. Welcome, and good luck.

Share this post


Link to post
Share on other sites
Well at first I did try changing my monitor settings, but still had no effect. My eyes would still hurt! Fortunately though, that was when I had that old monitor. A bit back I have gotten a new computer (prebuilt, would rather build one on my own but do not simply have the time for it, especially since it would be my first time) and thus a new monitor with it whose clarity seems to be much better and easier on my eyes.

I worded my OP quite badly (correct grammar? o.O), and at 2 am in the morning, please forgive any discrepancies in my logic.

When I said that Python was "too simple" I did not mean it a negative fashion as in "Python should be counted as a language". In fact I don't even know why I said it. I have only had a first impression of Python and it wasn't exactly the best, rather dry and boring really.

I think I'll take another look in Python again. Using PyGame for something later on seems promising and interesting. If anything, I suppose I will find other uses for Python later on that I will be glad I had bothered with it.

I just really wanted a second opinion on this. Thank you guys for responding.

So I don't have to look for it, do any of you recommend any particular Python resources, tips, advice, etc? :P

Hopefully I'll become more active here and actually be a useful member...I have taken a liking to these forums. Once again, thanks guys for putting up with me.

Share this post


Link to post
Share on other sites
I think you should like python. I too thought it was too simple but gave it a shot. It is safe to say that I love it. I haven't used it for an extremely long time and today I am making an ASCII invaders game. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by steveworks
I think you should like python. I too thought it was too simple but gave it a shot. It is safe to say that I love it. I haven't used it for an extremely long time and today I am making an ASCII invaders game. :)


ASCII games...compared to other things, relatively simple? Or still somewhat difficult. Just sort of wondering.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kilom
So I don't have to look for it, do any of you recommend any particular Python resources, tips, advice, etc? :P
You can find a bunch of useful Python resources here. I personally liked How to Think Like a Computer Scientist -- Learning with Python, but your tastes may vary, so take a look at some of the other resources as well.

Just a quick tip - a new version of Python (3.0) has just been released, but as you're aiming for games and none of the game-related libraries have been updated yet I'd recommend starting out with 2.6 instead.

Hope that helps, good luck! [smile]

Share this post


Link to post
Share on other sites
Quote:
Original post by Kilom
Quote:
Original post by steveworks
I think you should like python. I too thought it was too simple but gave it a shot. It is safe to say that I love it. I haven't used it for an extremely long time and today I am making an ASCII invaders game. :)

ASCII games...compared to other things, relatively simple? Or still somewhat difficult. Just sort of wondering.
Compared to a graphical game usually much simpler and therefore good to practice your skills with when getting started (unless of course you take it to an extreme and do something like Dwarf Fortress). ASCII games do however sometimes have their own challenges (particularly if you're hell-bent on replicating a graphical effect in ASCII, less so if you're just working with text) and will still take some effort to work through as a beginner while you're still learning to solve the problems associated with developing any game.

Share this post


Link to post
Share on other sites
Quote:
ASCII games...compared to other things, relatively simple? Or still somewhat difficult. Just sort of wondering.
That depends on the game, right? Just because the interface presented to the player is a console doesn’t mean the underlying game itself is simple. Or vice versa. Looking at your first post, I’ll point you to the term “roguelike”, which you may already be familiar with.

Share this post


Link to post
Share on other sites
Quote:
Original post by oler1s
Quote:
ASCII games...compared to other things, relatively simple? Or still somewhat difficult. Just sort of wondering.
That depends on the game, right? Just because the interface presented to the player is a console doesn’t mean the underlying game itself is simple. Or vice versa. Looking at your first post, I’ll point you to the term “roguelike”, which you may already be familiar with.


Nope, no idea what that term means. Not quite sure what you are referring to anyways.

EDIT: Also about Python 3.0 A few hours ago I went to go download Python again and downloaded and installed 3.0 quickly just to have it set up for later....and moments afterward I read that thread floating around here saying to wait to upgrade due to libraries like PyGame not yet supporting it >_> Oh well,a trivial task to undo.

Share this post


Link to post
Share on other sites
Whatever you choose at this point, stick with it until you know it well. My main problem in getting started with programming was that I'd flip-flop between languages and never get past the basics of any of them. It wasn't until getting to uni and being forced to stick to one thing until I was past the very basics that I made any progress.

Python is good, but I don't think C++ is as scary as everyone makes it sound, as the difficult things (pointers, memory management...) can generally be ignored until you have a better grip on it. Go with whatever you think will hold your attention the longest.

Share this post


Link to post
Share on other sites
what is it about the programming that you're having trouble with? If it's a universal programing concept like loops, arrays, variables, etc. no amount of language swapping will really help you. Explain what your problem is and we may be able to tell you how to get around it...you might not even need to swap languages!

Share this post


Link to post
Share on other sites
Hi there Kilom, your favourite programming language is very much a question of taste.

Quote:
I have even taken a look at C#, but that also feels weird to me, after getting used to some of the basic C++ stuff (such as using 'cout<<' whereas in C# 'Console.WriteLine()').


I don't know if I'm correct, but from this it sounds to me a little bit like you may have some trouble with the object oriented view of programming? There's been a lot of arguments about whether it's good to start learning object oriented programming from the start. My personal opinion is that it is best to start off with simple procedural programming language and then progress to classes and objects once you are comfortable. But perhaps this is simply because it is how I learned and others may disagree :)

Python is certainly not elementary and will probably give you a very strong background in theoretical aspects of programming while C++ will undoubtedly give you a very strong understanding of how the machine actually operates. From your goals, it sounds like PyGame is probably the best choice for now :)

By the way: If you ever decide to try C++ again, you might consider learning C first since it gives you the necessary "machine" level understanding which is a requirement for really understanding how C++ "works" (which I'm afraid can be quite complicated (but also very rewarding) once you get into the details).

Share this post


Link to post
Share on other sites
Quote:
Original post by errantkid
C++ will undoubtedly give you a very strong understanding of how the machine actually operates.
Not really. While C++ will give you a lower level (and C slightly lower again) view of how things work than a language like Python it still doesn't really reflect the operation of a modern computer at all. C++ has no concept of the underlying virtualised memory layouts, processor pipeline, etc. This isn't really the place to discuss the matter however - I'd suggest a new thread on the topic if you really want to talk about why C++ isn't a good way to learn "how the machine operates".

Share this post


Link to post
Share on other sites
Quote:
Original post by Kilom
This ultimately led me to buy C++ Primer Plus (fourth edition as the local bookstore did not seem to carry the firth)

Are you sure you didn't get C++ Primer instead of C++ Primer Plus? The latest edition of C++ Primer is the 4th. More people seem to recommend C++ Primer, anyway, so it wouldn't be a bad thing if you did.

Share this post


Link to post
Share on other sites
Quote:
Original post by oler1s
Link.


Heh, I already looked it up. But still funny though.

Also, yes I am pretty sure I got C++ Primer Plus considering I have it right in front of me right now and it says "C++ Primer Plus" on the front cover. Like I said, bookstore only had fourth for some reason, and it was only $25.

Quote:
I don't know if I'm correct, but from this it sounds to me a little bit like you may have some trouble with the object oriented view of programming? There's been a lot of arguments about whether it's good to start learning object oriented programming from the start. My personal opinion is that it is best to start off with simple procedural programming language and then progress to classes and objects once you are comfortable. But perhaps this is simply because it is how I learned and others may disagree :)

Python is certainly not elementary and will probably give you a very strong background in theoretical aspects of programming while C++ will undoubtedly give you a very strong understanding of how the machine actually operates. From your goals, it sounds like PyGame is probably the best choice for now :)

By the way: If you ever decide to try C++ again, you might consider learning C first since it gives you the necessary "machine" level understanding which is a requirement for really understanding how C++ "works" (which I'm afraid can be quite complicated (but also very rewarding) once you get into the details).

I don't think C++ is as scary as everyone makes it sound, as the difficult things (pointers, memory management...) can generally be ignored until you have a better grip on it.


I haven't actually hit upon any thing relating to OOP yet, just a couple of concepts that by how useful and great it says they are makes me afraid to go ahead to the next chapters to even see if I will require understand of them to make any progression, which after typing this makes me realize I should have done that first before even posting this thread. I just don't understand pointers. I'm having trouble thinking of ways to put pointers to practical use (as far as creating games go, and even other uses as well). I find it easier to understand things when learning them to try to apply and associate them with my interests....something I have yet to do with C++ pointers. If anyone could clear this up for me, I'd appreciate it.

Also, I do plan on continuing C++...just not right now hence the "Postpone" part of this thread's title. :P And I actually haven't even looked at C, haven't thought about it.

Share this post


Link to post
Share on other sites
Ah, this why I say that C++ gives you an understanding of the machine ;). Think of it this way:

Pointers are a way of referencing large blocks of memory without actually having to copy memory. What really happens when you call a function? Every time a function is called the compiler needs to send the parameters to the function somehow. Your computer has a stack of memory (that you usually don't manipulate directly, but the compiler knows about it). You can put data onto the stack and you can take data off of the stack. These is called push (put data on the stack) and pop (take data off of the stack) operations.

For example suppose you have a function that prints out an integer like this:


void print(int number)
{
somePrintFunction(number + 10); // this prints out number to the screen
}

void main()
{
print(5);
}


This is not really what happens, but for illustration purposes I'm going to explain it like this (WARNING: this is not real code either)

In the "main()" function, the parameter is pushed onto the stack and print function is called

push 5
call print


In the "print(int number)" function the parameter is popped off of the stack into a local variable called "number"

pop number
push (number + 10)
call somePrintFunction


Now lets make a function that prints out an array of 5 integers like so:

void print(int numbers0, int numbers1, int numbers2, int numbers3, int numbers4)
{
somePrintFunction(numbers0 + 10);
somePrintFunction(numbers1 + 10);
somePrintFunction(numbers2 + 10);
somePrintFunction(numbers3 + 10);
somePrintFunction(numbers4 + 10);
}

void main()
{
int numbers[5] = { 34, 23, -2, 8, 1 }
print(numbers[0], numbers[1], numbers[2], numbers[3], numbers[4]);
}


You can imagine that the "main()" function now does something like this:

push numbers[0]
push numbers[1]
push numbers[2]
push numbers[3]
push numbers[4]
call print


That's obviously very slow (imagine that the array had 1000 numbers). Instead of pushing the entire array onto

the stack we'd rather push an address to the memory where numbers is stored onto the stack. This "address" is what a pointer is.

So we rewrite the function like this:

void print(int *numbers)
{
for(int c = 0; c < 5; c++)
{
somePrintFunction(numbers[c] + 10);
}
}

void main()
{
int numbers[5] = { 34, 23, -2, 8, 1 }
print(numbers); // the compiler knows that when you are write numbers
// without adding [] you are actually saying "a pointer to
// numbers". Admittedly, this is a little confusing in the
// beginning.
}

And main() looks like this:

push address of numbers onto the stack
call print


There's all sorts of silly things you can do with pointers. For example:

numbers[2] = 5;

is actually equivalent to

*(numbers + 2) = 5;


Sorry, I hope that's helpful. I'm not sure I wrote a very good explanation :P Other languages like python hide their pointers from you because they figure out what to do internally so that you don't have to worry about it.

Share this post


Link to post
Share on other sites
Quote:
Original post by errantkid
Ah, this why I say that C++ gives you an understanding of the machine ;)
While from a quick glance everything you just wrote appears to be reasonably correct you completely missed my earlier point: the machine itself does not physically work that way, so all you've just demonstrated is that C++ gives you a better understanding of how C++ works, and hints at how assembly works.

You've given a decent (although I suspect to a beginner potentially confusing) explanation of pointers, but this still doesn't (and shouldn't neccesarily) give any real indication of how the computer itself works.

Share this post


Link to post
Share on other sites
@jbadams: I realize that C++ doesn't reflect the workings of your computer directly, I'm just trying to explain in terms a beginner will understand. Perhaps I should have said C is a "systems programming language", but how do you really understand what that means if this is your first time programming?
Besides, it is far more likely that you will learn about heap and stack memory, paging, SIMD, caches etc after a few years of C++ than after a few years in Python. You don't need to know the physical properties of semi-conductive materials to know what a transistor does. But then again, perhaps it's good to at least let the student know that there is such a thing as semi-conductive materials beneath those transistors even if we don't explain it :)

@Kilom: I felt I should maybe just add something as clarification because my explanation was a little technical. You can think of your computer's memory as a huge array and a pointer is simply an index into that array. In other words a pointer is just another number. The only tricky bit is that the compiler knows what type of object a pointer is pointing to so it knows that an int is 4 bytes (typically) and a char is 1 byte.

So when you have a pointer to an int and you add 1 to it then the pointer automatically moves 4 bytes forward:

int* pointer;
pointer = pointer + 1; // moves the pointer forward 4 bytes


In any case, good luck with your future endeavors!

[Edited by - errantkid on December 11, 2008 3:58:32 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by errantkid
@jbadams: I realize that C++ doesn't reflect the workings of your computer directly
Sure, I'm just continuing my quest to try stamping out phrases like "closer to the machine" when describing C or C++ - as you've just acknoleged, it simply isn't true. [smile]

Share this post


Link to post
Share on other sites
Hey kilom i decided i will tell you what i did when i started. I am 14 now, started programming about a year and a half ago and i was having some trouble deciding on a language to. When there was a sale at borders my parents picked up some c, c++, and python books for me. I tried out python but eventually switched to c++. Oh yeah before that i tried out game maker but did not stick with that for long. The main thing that helped me learn c++ was about half a year ago when my parents ordered a couple gameinstitute.com courses on c++.

P.S If you do not mind spending some time you could try see.stanford.edu and you could start with cs106a to start with basic programming concepts then go to cs106b to learn more advanced topics using c++.

Share this post


Link to post
Share on other sites
Quote:
Original post by errantkid
@Kilom: I felt I should maybe just add something as clarification because my explanation was a little technical. You can think of your computer's memory as a huge array and a pointer is simply an index into that array. In other words a pointer is just another number. The only tricky bit is that the compiler knows what type of object a pointer is pointing to so it knows that an int is 4 bytes (typically) and a char is 1 byte.

So when you have a pointer to an int and you add 1 to it then the pointer automatically moves 4 bytes forward:
*** Source Snippet Removed ***
In any case, good luck with your future endeavors!


How would that, using your example of pushing a 1000 element array onto the stack, increase its speed/efficiency by using pointers? Technically are you not still pushing the same stuff onto the stack? I kinda don't want to just accept that it just does, would like to know why. :P



EDIT: Wait, is it like after initially pushing the data onto the stack, instead of copying it again into the stack or moving (or whatever), you can simply "point" to where it's at so the program can gather it from there? Is that close or far off description of it? I just suddenly thought of this and wondered if this is right.

[Edited by - Kilom on December 11, 2008 9:23:41 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Kilom
EDIT: Wait, is it like after initially pushing the data onto the stack, instead of copying it again into the stack or moving (or whatever), you can simply "point" to where it's at so the program can gather it from there? Is that close or far off description of it? I just suddenly thought of this and wondered if this is right.
Bingo, I think you're starting to get the idea there. Another useful thing with using pointers in this way is that you don't have to know in advance how many items of data there will be - you can just create them when needed and use your pointer to refer to them.

Share this post


Link to post
Share on other sites

This topic is 3291 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this