Continue or Postpone.....

Started by
28 comments, last by bepawuca 15 years, 4 months ago
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.
Advertisement
Quote:Nope, no idea what that term means. Not quite sure what you are referring to anyways.
Link.
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.
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!

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).
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".

- Jason Astle-Adams

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.
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.
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.
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.

- Jason Astle-Adams

This topic is closed to new replies.

Advertisement