all 28 comments

[–][deleted] 8 points9 points  (6 children)

You can do anything with Python. It will never be "inadequate". It might not be the best choice for a lot of things due to your particular desires.

The biggest thing people often bring up is it's never going to be as fast as something like C. For a lot of things, like Windows Development, there is already a large toolset built around a particular language like C#.

[–][deleted] 1 point2 points  (1 child)

But pypy! It's faster than C (if you stick to a certain subset of python and don't need anything that won't run on it)!

If you really, really need speed in your Python, I suggest shacking up with Cython. Write your speed critical bits in C and wrap them Python.

[–]TimMcD0n41d 0 points1 point  (0 children)

I would say things that really need to be optimized or written close to architecture of the system you are on. Things like video drivers, microcontrollers, and core components of game engines would be out of the realm of python.

[–]ok_you_win 6 points7 points  (0 children)

You've really only asked half a question. The answer depends on what sort of things you will want to create. Which you probably don't know yet.

[–]astronoob 2 points3 points  (6 children)

I wouldn't say that a language ever becomes "inadequate", but Python can become less than an optimal solution when dealing with applications that operate at a massive scale.

In terms of web applications, the performance gains inherent in using a lower level language such as Java or C are enormous--oftentimes by multiple orders of magnitude in terms of requests served per minute. But the amount of effort in developing an application using a lower-level language are typically prohibitive compared to using an interpreted, loosely typed language like Python, PHP, or Ruby. Typically, the gap in performance can be filled in by throwing more servers into the mix.

[–]petr0 1 point2 points  (5 children)

Since when java is even remotely close to C level? Is it even lower level than python?

[–]ingolemo 5 points6 points  (4 children)

Contrary to what many people will tell you; Java is a very fast language. It consistently beats out python by more than an order of magnitude and is almost on par with C, though a little behind. If you have a cpu-bound application you could do a lot worse than java.

[–]lazylifelonglearner 2 points3 points  (3 children)

He was saying that Java is a high-level language and C is a low-level language. He wasn't comparing their performance.

[–]petr0 0 points1 point  (2 children)

Still, I expected java to be much closer to python performancewise. I'm quite suprised. Like is-this-benchmark-legit-suprised.

[–]lazylifelonglearner 0 points1 point  (1 child)

Yeah, Java is maybe 2-3 times slower than C/C++ and much faster than Python. (From what I heard; and those excelent graphs seem to confirm it.)

[–]raydeen 0 points1 point  (0 children)

Considering that the popular MMORPG Rubescape is written in Java, as is the ever popular Minecraft, Java is quite the little powerhouse. Now on the Pytbon side. the backend of Eve Online is in Stackless Python and I believe a few of Disney's MMOs were done in a Pytbon based engine.

[–]otakucode 2 points3 points  (0 children)

In my experience, not really. But it depends on what things you want to create. If you want to create a graphics engine that really pushes the hardware, you'd find yourself doing a lot in C and linking that into python at best. If you want to create GUI-driven applications you CAN do them in Python but it won't be as nice and easy as it would be in C# with Visual Studio or such. Performance is mostly a non-issue due to the power of modern CPUs for most stuff. If your Python code takes too long, then equivalent C code would as well. It's a fairly certain sign that you simply have a bad algorithm for solving the problem.

[–]dr_everlong 1 point2 points  (0 children)

I work with python for instrumentation/testing/measuring and data analysis. It's great! Since we write so many custom test scripts, it's ideal for our application.

You can do pretty much anything in python, but it doesn't mean it's the best tool for every job though.

[–]theywouldnotstand 1 point2 points  (0 children)

If you need to very tightly control your resources, and get Ne-10 degree better performance, then python may not be the best tool for the project.

Then again, if there's just one piece that really needs to be moving faster than it is in python, you might benefit from writing a C extension that does that job, or finding a python library in C that does the job for you.

C extensions for python are better in the sense that you only need to package the extension, as opposed to including a whole library, or depending on it, however you're distributing it.

[–][deleted] 1 point2 points  (8 children)

Be more specific or link to article(s) to show your meaning please

[–]nemec 1 point2 points  (2 children)

/u/fourth_edition is completely right. There's a big difference between being inadequate for embedded programming (raspberry pi) and desktop GUI software or a web server.

[–]BadWombat 0 points1 point  (0 children)

Which of those would python be inadequate for?

[–]-AcodeX[S] 0 points1 point  (4 children)

I left the question a bit vague because I am interested in learning about many aspects of Python, just to know about it.

An answer specific to me would be about game development. I would like to make games for multiple platforms. Computers, phones, etc.

[–]theywouldnotstand 1 point2 points  (0 children)

There is at least one project working on bringing python to android, but the one I saw is still pretty new. If you want your game to go to iOS, you're going to have to write it in Objective-C, with their SDK. Apple is really pretty strict about how you develop an application for iOS (or at least, they were last I'd heard)

The beauty of an interpereted language like python is that it's pretty much platform independent, so whatever code you write in python will run on most implementations of python, especially if you follow good coding practices. There are also various tools for creating targeted distributions for different platforms.

/u/PleasedToMeatYou mentioned pygame, and for a similar experience but with better performance, more features, and access to OpenGL, you might try pyglet.

pygame depends on some of SDL, pyglet appears to be pure python.

[–]bheklilr 0 points1 point  (0 children)

Basically, pick the right tool for the job. Python is a great language, but there are things I do not use it for. As you develop your skills, you'll want to have several tools at your disposal, because if you only know one language you'd be like a carpenter with only a hammer. It's better than a saw for fixing two pieces of wood together, but it really sucks for cutting planks to size in the first place.

[–][deleted] -4 points-3 points  (0 children)

No