ow my head

Started by
14 comments, last by superpig 16 years, 1 month ago
Well ive spent a few days looking at Python and im sorry if this is a simpler language then I think i may have lots of problems ahead. I have managed to get the hello world program workign though I dont know how. Anyway long story short decided to go for C++ though. This http://www.gamedev.net/community/forums/forum.asp?forum_id=76 and my book should make it a nice easy way in. If im still having problems I may see if there is a nice course nearby. Laters. Brian.
Advertisement
C++ is a LOT harder of a language than Python. If you got confused with Python than what makes you think that C++ is a better choice? O_o.

The key to learning a programming language is to make lots of programs with it. You will get confused, you will make mistakes, but the key is to not rush and to work through it.

So here is my advice:

A) Stick with Python for now.

B) Keep working with it, reading tutorials, and trying to make your own programs.

C) Ask questions when you get stuck.

Good luck.
OK i appreciate your point and i was expecting it.

However ill try to explain this somewhat.

Firstly I can at least understand the C++ program hello world i understand what the various parts of it do.

However with Python i cant even figure out how to get that simple program done.

In the tutorial i am doing "A Byte of Python" i can understand that its an interpreted program therefore it doesnt get compiled and that at the >>> promt i can enter a command just like in old spectum basic. However after that i get confused.

I typed the program as suggested and it didnt work, i then guessed that i needed to do it in a new shell of IDEL so i didnt have all the copyright info and version details.

so i have this program called helloworld.py saved in my c:\python25\ directory. If i run it in the shell presing ctrl-f5 it runs but if i try to run it from the command line it doesnt.

Ok then my next issue is that a lot of the online books and documents that i have seen refer a lot to Linux and Unix shells which i have no knowledge about save that it exsits.

Well thats my spleen vented. Can you offer any advice?

Thanks
Brian.
And one very important thing; start out small.
I actually had a similar experience. I have been programming C++ for about 5 years now. I recently took a look at python and it confused me a bit. I understand it better now but the difference between tuples, lists, and dictionaries still is a little fuzzy for me.

My advice to brian, be sure to take the time to learn whatever language you decide one and don't expect it to come quickly. It may come quickly but just don't expect it to.

Once advantage to python is it handles a lot of the lower level details that you need to worry about with C++. It is also really easy to work with lists in Python, although given the right classes c++ can also have that same ease. Python also has a lot of premade libraries that are common for all platforms.

C++ obviously has the power and control advantages. It will also be more difficult to learn in more detail. I think that C++ can be a beginner programming language as long as whoever is learned sticks with it and give up because of frustration.

Either language will take time to learn but I do think that python is the better beginner language.

Best of luck to you.
My current game project Platform RPG
Quote:the difference between tuples, lists, and dictionaries still is a little fuzzy for me


An n-tuple is a tuple containing an ordered list of n objects. A tuple contains a fixed number of objects. A 2-tuple (or pair) of type (Integer, Integer) stores exactly two components of type Integer – an example is (2, 2) – it might be used as a representation of a point. A 3-tuple (triple) of type (String, String, Integer) comprises exactly two components of type String, followed by exactly one component of type Integer – an example might be ("John", "Smith", 123) – a first name, last name and some sort of ID, perhaps.

A list is an ordered collection of objects, all of which are of the same type (remembering that you can usually represent objects of different derived types as their common base type). [1, 3, 2, 4] is an example of a list of length 4 with elements of type Integer; it is ordered (3 is after 1, 2 is after 3, 4 is after 2) but unsorted (although it could be sorted, if desired).

A dictionary provides a 1:1 mapping (a bijection) from a set of keys to a set of values (in much the same way as its real-world namesake does – the word in a real-world dictionary is the key, and the definition the value). The keys and values need not be of the same type (so you might have a dictionary mapping keys of type Integer to values of type (String, String, Integer)). There are a number of different possible implementations, which vary in efficiency. For example (I don't know Python), someDictionary["John Smith"] = 123 might set the value associated with the key "John Smith" to 123. You could then retrieve that as someDictionary["John Smith"].
[TheUnbeliever]
it seems that you having problems with the IDE and not the language itself. It doesnt make sense to me that you would understand a hello world program perfectly in C++ and not in Python. I dont know much C++ but i do know that the hello world program is a bit more complicated than Pythons simple...

print "Hello World!"


So ya i think you just need to figure out how to use your interpreter better.. are you using IDLE?
Quote:Original post by TheUnbeliever
A dictionary provides a 1:1 mapping (a bijection) from a set of keys to a set of values (in much the same way as its real-world namesake does – the word in a real-world dictionary is the key, and the definition the value).


Er, really? Every key maps to a unique value, and it's therefore possible to get from the value back to the key?

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

ok so i have stuck at it and found a better book. :P

Im now working from Beggining Python by Magnus Hetland and it seems to be a lot clearer than the Byte of Python was.

Right then back to it.
Quote:Original post by shadowisadog
C++ is a LOT harder of a language than Python. If you got confused with Python than what makes you think that C++ is a better choice? O_o.


I can see where he's coming from actually. I've been programming in C/C++ for about 4 years now and recently I started learning Ruby, which in many ways is quite similar to Python or Perl. One of the main difficulites I found during my time working with Ruby was that sometimes I could write a statement and not know exactly what it was doing; the language is so high level that it's sometimes difficult to determine exactly what the effect of each statement is. It's always a decidedly dodgy business when you start writing code and you're not even sure what it is doing IMHO!

Not that I'm suggesting he should switch immediately to C++ however! But there can be such thing as going too far high-level also; sometimes it pays to get down to the nitty gritty and understand the fine details of how stuff gets done. If you do want to go down the C++ route however I'd suggest you stick to pure C for the time being and forget about all the object oriented features of C++ until you are comfortable with the language. There's also the possibility of using C#- something which I'd highly recommend. C# is one of the cleanest languages I've ever come across and if you get good with it you could jump into XNA afterwords to. Worth considering if you want to change language...

This topic is closed to new replies.

Advertisement