Python vs. C++ and other programming languages. .

Which one is better: Python or C++. I know that for Blender, of course, python would be the most beneficial to learn. However, what are other programs such as shake, after effects, or even gimp written with? Do these use C++ as well?

It depends on what you’re doing really
If you want to write scripts to use in Blender then Python is the obvious choice
If you want to develop Blender itself you’re better off knowing C
Games too are generally C++ but often have some sort of inbuilt scripting interface for creating events in the game, etc

C++ is reserved for those who want to commit to coding. However if you simply want additional flexibility Python is the way to go. However, take a look at XSI 7’s ICE – Crytek’s Flowgraphs. To be honest I believe that for most users that is the way that all these program will be going eventually (like within the next 2 years)

it depends on what your goals are. what do you want to make? how much time do you have to make it? python is popular because you can program qickly and get results. c launguages are better if you have the time, it runs faster. if you need the program to run faster use c++, if you just need something soon use python. infact alot of people use both. you dont have to compile python so you and quickly change the code and see it run. alot of people use pthon to get a program working, then code it in c to compile and make it run faster.
c++ is the language used by most comercial software if thats what you were asking. if you buy a program at the store it’s probably c++.

Dude, if youre serious about programming you’ll probably get to know a lot languages.
Python or C++ question has a easy answer: You as a beginner will be more powerful in Python.
C++ is one of the most complicated languages.

Today C/C++ makes faster compiled code, because they are closer to machine architecture. But that does not have to be the situation after some years. There is an interesting project “PyPy”, which aims to do the same things with Python.

When you are meazuring effectiveness, you should count the time consumed to learn programming and develepment time too. That way, Python is a way ahead. Python is more intelligent, it helps you think abstract, which is the key to make programs better and more easily understandably.

The open source goal is towards everyone able to learn things and make it themselves, to teach the theory behind things and to make usable documentation. When you choose programming language, you should think what you are aiming to, not what the tools today are.

Python is the choise.

This is like comparing apples to oranges. Both are fruits.

Just a few other languages you might consider
Java, SmallTalk, Lisp, Ruby, VisualBasic, C#, PHP, D

The thing to consider is that C, C++ and D do not have automatic memory management so all the choirs of setting up memory is handled by you while the other languages have automatic memory management (GarbageCollector is a good search word to get to know more about it) easing programming. Also most dynamic and memory managed languages do not have pointers taking away something that is complicated.

Also interpreted languages like Python, Ruby, PHP, LISP are easier since you do not need to compile code this is done on the run making it a lot easier to try stuff out. Some of these offer you a way to actually compile code. Also non compiled languages tend to be more dynamic and allow you to do stuff that is impossible in C or C++ like extending classes on the fly adding new functionality to existing code without compilation.

Once you have the basics down it should be easier to learn C and C++. And the basics are easier to learn with a script language like Python imho.

But saying one is better then the other is bshit. Every language has its advantages and disadvantages.

Also the statement about most commercial software being written in C and C++ isn’t true. There is tons of stuff out there that is written in other languages. Just consider all the web apps and websites scripts.

Python and C++ were made for different things, you can’t directly compare them. Python is interpreted, C++ is compiled. C++ has a large emphasis on OOP, Python doesn’t. Python was meant to be a scripting language, C++ takes a lot more code [initially] to do the same thing. ie, Hello World in Python is simply “print ‘Hello World’”, whereas in C++ it’s a couple more lines.

IMO you should start with something like C++, C# or Java. Their style is the most common (syntax, OOP, etc) and it will be much easier to pick up something like Python or Lua later.

Both are patently untrue. Python stands on even stronger OOP ground than C++ and it definitely was not meant as a scripting language, although it’s terseness of expression and powerful stdlib makes it suitable as such.

Martin

That’s news to me. I was unaware Python was more OO than C++. I suppose that’s true with larger programs or using frameworks like Django but I’ve never needed to use objects for what I use it for (small scripts), because it’s very good for scripting.

need performance? than C++ is the way to go. but c++ is really difficult.

need productivity? than you should definitely use python. Google, NASA, youtube and lot more big projects dominantly use python.

EDIT: double post, sorry

D does has garbage collector which can be turned on or off at your will.
Also some kind of garbage collecting in C/C++ is possible through some libraries as far as I know.

C#, I thought I’d just add another language in here to spice up the arguments.

No seriously, if you want to learn to program, just start with something like Python, then move to C++. Personally, I started with Visual Basic then moved to C++, which was dumb. You will learn more than 1 language if your going to get serious, so get ready.

It looks like everyone is moving to C# and .NET, Windows development that is. If you want something cross platform go with C++, Python, or Java. I personally hate Java but that’s just me :slight_smile:

I have a question. If I know C++ well and it doesnt seem complicated, am I pretty much ok not bothering with python?

No, not really. Python has some differences from C++, just how C++ has some differences from C and so on. ‘Mastering’ an OOP language only makes learning other OOP languages a little easier, it doesn’t mean you’ll know other OOP languages (if that makes sense).

you misunderstood. Of course knowing C++ doesn’t mean I know python. the question is, if I know c++ well, do I need to bother learning python, or can I do everything just fine in c++ with a similar amount of effort?

obviously, for the beginner, it is easier to grasp python syntax, but If you already know C++, what power does python have that C++ does not?

Python seems to have a quicker development time for smaller projects. It can be similar to why I use C# for some things and C++ for others. Some things can just be done quicker with C# than they can with C++.

Edit: (Posted before I finished)

I have minimal experience with Python, so don’t take me word for it :slight_smile:

No, of course you don’t have to bother with Python. You should, but you don’t have to. It’s a great language and simple to learn. It has tons of flexibility, can make easy web apps with Django and is very fast.

As I understand it, isn’t everything in Python an object? Or am I thinking of Ruby