Python and C++
Awsome, then it appears that theres really no reason for me to begin with C++. If I can do everything with Python that I can do with C++, and Python will help a beginner learn better and get a better understanding of things, Python seems like the way to go. Anyway, I can always learn a new language once I can use Python fluently and create programs with it. Im going to download that Active Python program once I get a good book that teaches it. Any suggestions on a really good Python book, something that caters to a beginner?
I'm not going to tell you to choose C++ over Python but I am going to make this discussion less one-sided
C++ has some trick areas, for example someone above listed:
"Pointers, references & C sytle arrays[]"
Now you see pointers and C style arrays are advanced features (references are easy). A beginner wouldn't start out with them. So they shouldn't be an obstacle to learning. I say shouldn't but a lot of C++ tutorials are really C tutorials in disguise. So if you were my neighbor you would have no problem learning C++ because I would guide you through the topics in an order that makes them easy to learn. However if you try to learn using the internet you are likely to stray.
Ok but now here is the catch: pointers are tricky and yet so called easy languages (C#, java) expose you to them early. I don't remember whether Python does but I'm almost certain that it does. Pointers are tricky and so I think that these high level languages can be harder to learn. They might not seem harder but that often just means that you are ignorant of how your language actually works. I was trying to explain C++ references to my brother (who only knows pascal and java, he's in highschool) and to give him and example I asked him to write a swap function in java. He actually thought that he could but it isn't possible (maybe with some advanced trickery it is but I am talking about a simple swap function).
With C++ you use pointers less frequently and when you do use them it is your choice. With other languages you use pointers more frequently and usually the language choses when you do.
Ok enough about pointers. My biggest objection to Python is that it does not have compile-time type checking. Compile-time type checking allows the compiler to automatically find a whole category of errors for you. You are a human, and humans make mistakes. I had to use Python in Robotics II at college and it drove me insane. I cursed Python every day. I really don't like the language because of the suffering that it has caused me. When I program in C++ I never have to deal with that category of error. The compiler just finds it for me and I simply fix it. So now the errors that frusterate me most are those relating to string literals. There are techniques to minimize those but it would be even nicer if the compiler could just do it for me.
So I would go with C++ if I were you. It really isn't that hard if you learn it correctly. This website has a series on learning with the book Accelerated C++. My wife bought my brother a copy for $5.
C++ has some trick areas, for example someone above listed:
"Pointers, references & C sytle arrays[]"
Now you see pointers and C style arrays are advanced features (references are easy). A beginner wouldn't start out with them. So they shouldn't be an obstacle to learning. I say shouldn't but a lot of C++ tutorials are really C tutorials in disguise. So if you were my neighbor you would have no problem learning C++ because I would guide you through the topics in an order that makes them easy to learn. However if you try to learn using the internet you are likely to stray.
Ok but now here is the catch: pointers are tricky and yet so called easy languages (C#, java) expose you to them early. I don't remember whether Python does but I'm almost certain that it does. Pointers are tricky and so I think that these high level languages can be harder to learn. They might not seem harder but that often just means that you are ignorant of how your language actually works. I was trying to explain C++ references to my brother (who only knows pascal and java, he's in highschool) and to give him and example I asked him to write a swap function in java. He actually thought that he could but it isn't possible (maybe with some advanced trickery it is but I am talking about a simple swap function).
With C++ you use pointers less frequently and when you do use them it is your choice. With other languages you use pointers more frequently and usually the language choses when you do.
Ok enough about pointers. My biggest objection to Python is that it does not have compile-time type checking. Compile-time type checking allows the compiler to automatically find a whole category of errors for you. You are a human, and humans make mistakes. I had to use Python in Robotics II at college and it drove me insane. I cursed Python every day. I really don't like the language because of the suffering that it has caused me. When I program in C++ I never have to deal with that category of error. The compiler just finds it for me and I simply fix it. So now the errors that frusterate me most are those relating to string literals. There are techniques to minimize those but it would be even nicer if the compiler could just do it for me.
So I would go with C++ if I were you. It really isn't that hard if you learn it correctly. This website has a series on learning with the book Accelerated C++. My wife bought my brother a copy for $5.
Hehe Im really bad when faced with multiple options :) Im always worried that I will make a choice that makes my learning harder. Sometimes I wish there was 1 path to everything haha. Well I can see where C++ and Python have their strong points, I just dont have enough knowledge to make an educated decision. I did order 2 books from amazon that are an intro to programming. They do not deal with any specific languages, just lay down the foundations of programming and whats involved (pointers, etc) Im going to decide on a language definetely after I read through the books. They should help me understand more about how programming works, after I know all that, maybe Ill be able to decide on a language easier. As of now, Python seems to make the most sense to me, It seems very approachable to a newbie, and like everyone said, I can always learn more languages later
Quote:Original post by biggjoee5790
Awsome, then it appears that theres really no reason for me to begin with C++. If I can do everything with Python that I can do with C++, and Python will help a beginner learn better and get a better understanding of things, Python seems like the way to go. Anyway, I can always learn a new language once I can use Python fluently and create programs with it. Im going to download that Active Python program once I get a good book that teaches it. Any suggestions on a really good Python book, something that caters to a beginner?
I'm going through this book right now and it's pretty good so far and fun since it's game programming oriented.
Glak, I can't imagine what you're referring to saying that C# and Java "throw pointers at you early". First, C++ certainly does that, as does C, as you have to use pointers to do anything useful at all. Second, Java does not have pointers. Its variables holding references to objects are just that -- references. The syntax is transparent and for all practical purposes it's about the same as using Python object references.
Quote:Original post by biggjoee5790A lot easier; your first language will be by far the hardest to learn. You don't need to learn a language but rather need to learn programming, for which a more elegent language such as Python is an excellent choice.
It seems like once you know a language well, learning others becomes easier.
Quote:I'm going to try to get everything I need to begin learning Python, hopefully I can get some good books.Fruny listed some good Python tutorials/references in the 'noteworthy threads' sticky (linked above by parawizard). As an added bonus, many of the materials are available for free online unless you'd prefer to invest the cash in a hardcopy book. I personally liked How to Think Like a Computer Scientist -- Learning with Python when I was first getting started with the language, but take a look at a few of the different options and pick something that you think may suit you.
Quote:Now I do want to know, can you use Python to program games well? both 2d and 3d?Python has been used to varying degrees in Toontown Online, Eve Online and Civilization 4 amongst others. You can also see some examples of (mostly hobbyist) games developed with PyGame at the PyGame website.
Quote:I know that at first I wont be making any games. Im guessing Id start with simple text based apps and then move up from thereCorrect. The good news though is that those who begin with Python generally get to start playing with some graphics and making small "real games" a lot sooner than many of those who decide to start with C or C++.
Quote:I just dont have enough knowledge to make an educated decision.The important thing is not so much making the right decision, but simply making a decision at all. Gather whatever information you think will help you (you're already doing that right now!), then pick a language and get started with it. Remember that even (perhaps especially) failed attempts at programming are a great learning experience as long as you choose to learn from your experience and stick with it rather than allowing it to frustrate you and turn you off programming altogether. Reading through your books and then making a decision is a good idea, but also keep in mind that reading a book is no substitute for actually trying things out. [smile]
Hope that helps.
A quick word... If you wish to change from python to C++ later on, I'm guessing that going from weakly-typed Python to strongly (occasionally annoyingly strong) typed C++ might make you go a little insane. Just a thought. (I personally started C++ and went to python, and found the weakly-type-ness-thinger of it to be a pure annoyance, so I'm only guessing at the reverse being more or less the same).
G'luck with Python!
A helpful link (not sure this was said yet, but w/e):
http://www.vex.net/parnassus/
G'luck with Python!
A helpful link (not sure this was said yet, but w/e):
http://www.vex.net/parnassus/
Quote:Original post by Atash
A quick word... If you wish to change from python to C++ later on, I'm guessing that going from weakly-typed Python to strongly (occasionally annoyingly strong) typed C++ might make you go a little insane. Just a thought. (I personally started C++ and went to python, and found the weakly-type-ness-thinger of it to be a pure annoyance, so I'm only guessing at the reverse being more or less the same).
Just to get the terminology right:
Python: dynamically and strongly typed
C++: statically and weakly typed
Quote:Original post by Glak
I'm not going to tell you to choose C++ over Python but I am going to make this discussion less one-sided
Ooh! Goody!
Quote:Now you see pointers and C style arrays are advanced features (references are easy).
Actually, arrays are such a fundamental concept in programming that your calling them "advanced features" is quite mirth-inducing. The problem is, C really doesn't have any high level data structures (struct is basically a contiguous memory aggregation, with a few offset optimizations that came along later), so it turns the whole thing into a tragic mess. Arrays, for example, really don't exist in C; all you have is a pointer (ie, a memory address) and an offset. There is no bounds checking, and the array is completely oblivious to its own extents.
So, no, you're wrong. Pointers and C-style arrays are primitive features, not advanced.
Quote:A beginner wouldn't start out with them.
Wrong again, at least about arrays. A language that makes a simple array - a linear list! - a complex, "advanced" feature is an obstacle to learning. Incidentally, C++ introduces std::vector and other container types because they are such data structures.
Quote:Ok but now here is the catch: pointers are tricky and yet so called easy languages (C#, java) expose you to them early. I don't remember whether Python does but I'm almost certain that it does.
Wrong and wrong. Java has no pointer types; everything is a reference. C# requires you to use unsafe blocks - an advanced feature - to access pointers. Python only has references to values, too.
Quote:With C++ you use pointers less frequently and when you do use them it is your choice. With other languages you use pointers more frequently and usually the language choses when you do.
And this confirms that you don't know what pointers are, because they are intrinsic to C++ programming. In fact, the interface of container iterators was designed to match pointers - technically, pointers conform to the iterator concept, but I digress.
Quote:My biggest objection to Python is that it does not have compile-time type checking. Compile-time type checking allows the compiler to automatically find a whole category of errors for you.
a.) Not really. Compile time type checking in a language like C++ is undermined by the fact that type coercion is trivial.
b.) There are dynamic languages (Python is a dynamic language) that have static checking.
Quote:When I program in C++ I never have to deal with that category of error. The compiler just finds it for me and I simply fix it.
The compiler is useful to determine syntax errors, but it doesn't help in the slightest with logic errors.
Quote:So now the errors that frusterate me most are those relating to string literals. There are techniques to minimize those but it would be even nicer if the compiler could just do it for me.
Did you know that you never have string literal errors in Python? For two reasons. First, strings are constant. All strings, no matter what. They are never, ever mutable. Ever. Second, strings are a language intrinsic type, so they always behave as expected. You can call all string methods on literals without having to obtain a reference to an instance.
Quote:So I would go with C++ if I were you. It really isn't that hard if you learn it correctly.
Don't take this the wrong way, but I'm not sure you've learned it correctly.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement