Kllrnohj wrote:

In some cases with some tricky programming, Python can be faster than Java Wink

But I assume he meant speed of development.


Well, compiled python is certainly faster than C++.

And yes, speed of development is what I meant. I'm new to this world of programming, you see, so anything that makes the harder aspects easier is always a good option to consider for me.
Sigfig wrote:
Well, compiled python is certainly faster than C++.


Source?
Ultimate Dev'r wrote:

Source?


I've read it in numerous places. I don't actually use C++ that much, but when I do, it takes forever to do anything.
Sigfig wrote:
Ultimate Dev'r wrote:

Source?


I've read it in numerous places.


Quick note: "I've read it in numerous places" != Source.

A source would be a link supporting your position, i.e. http://furryland.org/~mikec/bench/, which shows that Python is *NOT* faster than C++.

Quote:
I don't actually use C++ that much, but when I do, it takes forever to do anything.


You're doing it wrong.
Ultimate Dev'r wrote:

Quick note: "I've read it in numerous places" != Source.

A source would be a link supporting your position, i.e. http://furryland.org/~mikec/bench/, which shows that Python is *NOT* faster than C++.

Quote:
I don't actually use C++ that much, but when I do, it takes forever to do anything.


You're doing it wrong.


I didn't go looking for one when I replied.
I remember reading something about it on http://www.farbs.org/.

I also probably am doing it wrong. I'm going to assume you mean optimized C++ code written by an expert is faster than python code.
Sigfig wrote:
Ultimate Dev'r wrote:

Quick note: "I've read it in numerous places" != Source.

A source would be a link supporting your position, i.e. http://furryland.org/~mikec/bench/, which shows that Python is *NOT* faster than C++.

Quote:
I don't actually use C++ that much, but when I do, it takes forever to do anything.


You're doing it wrong.


I didn't go looking for one when I replied.
I remember reading something about it on http://www.farbs.org/.


You mean
http://www.farbs.org/links.html wrote:
Python
Python is an astonishingly friendly scripting language. Check this out: I once wrote the same game twice, once in python then once again in C++. The python implementation was completed 7.4x as fast as the C++ version. By my calculation, using python has allowed me to make my games 7.4 times better than they otherwise would have been. Either that, or I'd have finished them in 1/7.4=0.135etc the time. And I used python to figure that out. Incredible!
that is completely unsubstantiated and doesn't even mention compiled Python?

Quote:
I also probably am doing it wrong. I'm going to assume you mean optimized C++ code written by an expert is faster than python code.


You don't need to be an expert in C++ to write faster code than in Python. C++ is actually a very powerful and fast programming language (generally not as fast as C though). You should learn more about it:
http://www.cplusplus.com/doc/tutorial/
http://cprogramming.com/
Pretty much any popular programming language will let you get the job done faster, easier (and with more fun) than in C or C++ these days. Of course, there are some things that you can only do in C or C++, but I'd imagine the majority of people wouldn't need such features.

I know very few people who'd rather develop in C or C++ instead of Python, Java, C#, Haskell, PHP, Ruby etc - and even then it's usually because they're very much more familiar with C or C++ the other languages.
Sigfig wrote:
Well, compiled python is certainly faster than C++.


No, absolutely not. For one, there aren't any Python compilers that aren't just proof of concepts (as in, that actually work beyond 1 or 2 packages). Second, Python is an *interpreted* language. The interpreter is most commonly CPython (the official implementation of python - the one from python.org), which is written in C. Now tell me, how is a language interpreted by a C runtime going to *EVER* be faster than just writing in C/C++? The answer, of course, is NEVER. Python can *NEVER* be faster than C/C++ assuming a competent programmer.

Quote:
I've read it in numerous places. I don't actually use C++ that much, but when I do, it takes forever to do anything.


No, you haven't. You probably misread and they said speed of development, or they are completely retarded. Also, please provide some semblance of an example of when you used C++ and it was slow.

Quote:
I also probably am doing it wrong. I'm going to assume you mean optimized C++ code written by an expert is faster than python code.


An expert in Python couldn't keep up with a rookie in C++. C++ is wicked fast. Very few languages are faster by any significant amount. Hand coded assembly is pretty much the next step if you want more speed.

Quote:
I know very few people who'd rather develop in C or C++ instead of Python, Java, C#, Haskell, PHP, Ruby etc - and even then it's usually because they're very much more familiar with C or C++ the other languages.


I happen to like C/C++, as do a couple of my friends. I prefer coding in Python, followed by C++, followed by C#.
Python is a fun language, and fairly fast as far as scripting languages go, but even when you compile it, you still have all the overhead of a dynamic language (look at the code generated by Cython or Pyrex).
Kllrnohj wrote:

No, absolutely not. For one, there aren't any Python compilers that aren't just proof of concepts (as in, that actually work beyond 1 or 2 packages). Second, Python is an *interpreted* language. The interpreter is most commonly CPython (the official implementation of python - the one from python.org), which is written in C. Now tell me, how is a language interpreted by a C runtime going to *EVER* be faster than just writing in C/C++? The answer, of course, is NEVER. Python can *NEVER* be faster than C/C++ assuming a competent programmer.

If you're correct, wouldn't C++ have to be interpreted too, putting them on the same level? I referred to C++, not C.

Kllrnohj wrote:

No, you haven't. You probably misread and they said speed of development, or they are completely retarded. Also, please provide some semblance of an example of when you used C++ and it was slow.

Compiling a basic application using the openGL library. Very basic. It was just to render a few images at a time, but it didn't behave very well. I can try and find the files if you want to see.

Kllrnohj wrote:

An expert in Python couldn't keep up with a rookie in C++. C++ is wicked fast. Very few languages are faster by any significant amount. Hand coded assembly is pretty much the next step if you want more speed.

Let's say you coded something in python, and I attempted something in C++. Assuming I actually finish my project, who's is going to be faster?

Kllrnohj wrote:

I happen to like C/C++, as do a couple of my friends. I prefer coding in Python, followed by C++, followed by C#.


I'm sorry, maybe it's just the learning curve that's getting to me, but I am actually afraid of C++ now. I worry that if I keep VC++2005 installed on my computer for too long, it will kill me in my sleep.
Sigfig wrote:
Kllrnohj wrote:

No, absolutely not. For one, there aren't any Python compilers that aren't just proof of concepts (as in, that actually work beyond 1 or 2 packages). Second, Python is an *interpreted* language. The interpreter is most commonly CPython (the official implementation of python - the one from python.org), which is written in C. Now tell me, how is a language interpreted by a C runtime going to *EVER* be faster than just writing in C/C++? The answer, of course, is NEVER. Python can *NEVER* be faster than C/C++ assuming a competent programmer.

If you're correct, wouldn't C++ have to be interpreted too, putting them on the same level? I referred to C++, not C.


No. Take a look here for the difference between interpreted and compiled languages.

Sigfig wrote:
Kllrnohj wrote:

An expert in Python couldn't keep up with a rookie in C++. C++ is wicked fast. Very few languages are faster by any significant amount. Hand coded assembly is pretty much the next step if you want more speed.

Let's say you coded something in python, and I attempted something in C++. Assuming I actually finish my project, who's is going to be faster?


The C++ coder.

Sigfig wrote:
Kllrnohj wrote:

I happen to like C/C++, as do a couple of my friends. I prefer coding in Python, followed by C++, followed by C#.


I'm sorry, maybe it's just the learning curve that's getting to me, but I am actually afraid of C++ now. I worry that if I keep VC++2005 installed on my computer for too long, it will kill me in my sleep.


:facepalm: C++ is pretty easy to learn; it just takes more steps to do what you want as it is a lower level (and thus more powerful) than Python, which is a very high level language (Read This and This)
Ultimate Dev'r wrote:

No. Take a look here for the difference between interpreted and compiled languages.

Alright. I never really understood the difference. That's probably why I'm in this argument in the first place. Smile

Ultimate Dev'r wrote:

The C++ coder.

If I were the coder, I'd be willing to bet that wasn't the case.

Ultimate Dev'r wrote:

:facepalm: C++ is pretty easy to learn; it just takes more steps to do what you want as it is a lower level (and thus more powerful) than Python, which is a very high level language (Read This and This)

Those added steps are the problem. Currently, I'm not worried about power or optimization. I just want something that works.
Sigfig wrote:
Ultimate Dev'r wrote:

The C++ coder.

If I were the coder, I'd be willing to bet that wasn't the case.


Your program would only be slower if you used bad logic. Not knowing the language well wouldn't cause you to write slow code.
Sigfig wrote:
Ultimate Dev'r wrote:

The C++ coder.

If I were the coder, I'd be willing to bet that wasn't the case.


You and I should play poker then Very Happy
Ultimate Dev'r wrote:
Sigfig wrote:

If I were the coder, I'd be willing to bet that wasn't the case.


You and I should play poker then Very Happy


Haha, that would be fun.
Um... you know he was making fun of you, right?
I honestly don't care.
Well at least one of you understands sarcasm Wink
Sigfig wrote:
If you're correct, wouldn't C++ have to be interpreted too, putting them on the same level? I referred to C++, not C.


Why would it?

You *have* to compile C++ before you can run it, you *can't* compile Python.

And C and C++ are pretty close to the same thing. C++ just adds more features to C. Making the distinction in this case just shows you don't know anything about C or C++.

Quote:
Compiling a basic application using the openGL library. Very basic. It was just to render a few images at a time, but it didn't behave very well. I can try and find the files if you want to see.


Compiling is *NOT* running. Compiling C++ is slower than Python because you NEVER COMPILE PYTHON.

Get it through your head. C++ is compiled, Python is *NOT* compiled. Python is *NEVER* compiled

Note that by compiled I mean compiled to x86, assembled, and linked.

And I promise you, a C++ OpenGL application is *NEVER* slower than a comparable Python OpenGL application. If it was, games would be written in Python. They aren't. Games are usually written in C++.

Quote:
Let's say you coded something in python, and I attempted something in C++. Assuming I actually finish my project, who's is going to be faster?


Yours, easily. It won't even be close. Every single line of Python code ultimately ends up being hundreds of lines of C code.

Here, look, Python is up to 300 TIMES SLOWER than C++

http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=gpp&lang2=python&box=1

It just isn't possible to optimize such a difference away.

Quote:
I'm sorry, maybe it's just the learning curve that's getting to me, but I am actually afraid of C++ now. I worry that if I keep VC++2005 installed on my computer for too long, it will kill me in my sleep.


C/C++ is definitely harder than Python.
Kllrnohj wrote:
Compiling is *NOT* running. Compiling C++ is slower than Python because you NEVER COMPILE PYTHON.

Get it through your head. C++ is compiled, Python is *NOT* compiled. Python is *NEVER* compiled
It's perfectly possible to compile Python. C++ is slow to compile owing to an archaic (and, frankly, silly) compilation model; languages with saner (ie easier-to-parse) syntax compile significantly faster.
Quote:
And I promise you, a C++ OpenGL application is *NEVER* slower than a comparable Python OpenGL application. If it was, games would be written in Python. They aren't. Games are usually written in C++.
There are many reasons commercial games are developed in C++. Most consoles only offer decent C++ compilers at the moment, and game companies often have large amounts of legacy code written in C++; you can't just throw all that (and developer training) away!

Using Unity will allow you to compile Python games for the iPhone and Wii.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 5
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement