Python and C++

Started by
31 comments, last by wodinoneeye 17 years, 1 month ago
"That doesn't make sense. A feature can not be both primitive and advanced. And the proper way to learn in C++ is to start by using the very robust features of the Standard Library, expanding to lower-level functionality as needed."

no, perhaps let me give you examples (in C++)

primative: built in types (int, char), built in meta types (function, array), control constructs (if statements). Essentially primatives are what the compiler handles
nonprimative: the standard library, your own code. Essentially stuff that is implemented.

beginner: stuff that beginners should start with
advanced: things with complications

so for example the int type is primative (handled by the compiler) and beginner level (suitable for beginners). Arrays are primative (handled by the compiler) but are advanced (beginners should use string and vector instead)

"You realize that the compiler can not determine the error in your example?"

yes, and that is exactly the kind of error that causes me the most trouble. C++ cannot catch a typographical error in a string. It can catch other types of typographical errors. Languages without compile-time type checking are able to catch fewer typographical errors at compile-time. Python is such a language. This concept can be extended. I was working on Python once and using a poorly documented API. It took me a while to realize that the function that I was calling was returning a tuple of types a and b rather than just b. If it were checked at compile-time I would have gotten an error message along the lines of:

Error # 3495734975 on line 63: cannot convert a,b to a

which would have immediately alerted me to the problem. Furthermore if you don't know what the error message is you can pop it into your help files or google, or post the error message on GameDev.

"*yawn* Collegiate example. C'mon... impress me!"

well... if you must know I am making it because I am dissatisfied with C++... but I still like C++ far better than Python or any other language.
Advertisement
Quote:Original post by Oluseyi
If you're a Windows user, I recommend Microsoft Visual C++ 2005 Express Edition for C++ and ActiveState ActivePython for Python. Both are free. The latter (ActivePython) is a much smaller download with much lower system requirements.


I can't tell what that size/system req comment is comparing (ActivePython vs MSVC or ActivePython vs some other Python distro), but just to let people know, the official Python distribution from python.org and ActivePython are essentially the same distribution. If ActivePython claims lower system requirements (I'm not able to find them anywhere..), then they're lying. ActivePython contains the exact same interpreter (though it's usually a version or two behind), and comes with a few extra packages you'll probably never use.

It's recommended (by #python) to use the python.org Python distribution, as it's the most up to date. At the time of writing this ActivePython isn't even on 2.4.4, while the python.org release is on 2.5.

[Edited by - Ra on March 6, 2007 7:45:59 PM]
Ra
Quote:Original post by biggjoee5790
Ive been deciding between learning Python or C++ as a first ever language and first time programming. From what I am reading, Python is easier to learn but doesnt have the same abilities as C++. On the other hand C++ is alot harder to learn but is more extensive. Which do you think would really be best for a beginner hoping to eventually program games? I read somewhere that some consider Python to be minimalist because the program does away with many problems associated with other languages. I just dont want to take shortcuts in my learning, It seems like learning C++ introduces you to almost every aspect of programming while Python kind of sugar coats some things. This is just how it seems to me based on my reading, I might be totally wrong. So please suggest which language would benefit me more. I also need to know what I need to be able to write code and turn it into a program? Can these languages be dealt with totally in Windows or do I need a Unix system?



If you have not done any programming before, Python is probably better because there will be less confusion when you are attempting to absorb the basics of programming. You want to be able to get a program to work for the simplest concepts and C++ probably would take more effort/frustration to do that. You dont need extra distractions.

Later once you understand the basics and fundamental way that programs work and the whole mentality (ie- breaking problems down, program flow, etc..) you can make use of the more complex abilities. You can likewise move to other programming languages because you would now understand what they have in common and then vuild from there.

I used 3 different primary languages (BASIC, FORTRAN, PASCAL) before I ever used C (and C++ after that) and each built additional concepts and flavors of manipulations. I actually only started using Python a few months ago and had little problem picking up using it (including tricky stuff like embedding it in another language for game programming).



--------------------------------------------[size="1"]Ratings are Opinion, not Fact

This topic is closed to new replies.

Advertisement