views:

513

answers:

11

From the moment I faced python the only thing I can say for it is "It is awesome". I am using Django framework for it and I am amazed how quick the things happen and how developer friendly this language is. But from many sides I hear that Python is scripting language, and very useful for small things, experiments etc.

So the question is can a big and heavy loaded application be build in python(and django). I am mainly focused on the web development so for examples I can give Stack Overflow, Facebook, Amazon etc.

P.S. According to many of the answers maybe I have to rephrase the question. There are several big application working on Python(the best example You Tube) so it can handle them but why then it is no so popular for large projects as(for example) JAVA, C++ and .NET.

+9  A: 

Google tend to use python for a lot, so I assume its ready for big time. We use python as glue for our products so we're happy with it.

Preet Sangha
Ilian Iliev
It is useful for small things and experiments because you will write things much faster in python then in most other languages, and when you experimenting you don't want to waste too much time you could spend on actual development. People tend to develop and test in python then write it down in C/C++ for example and bind it into python if they need speed.
rebus
I would counter that by saying - that if a language/technology stack works in the small but doesn't scale then yes you'd do this. However I would suggest that python does scale in the main. However it may not for your use case, in which case another stack may be a better 'implementation in the large' option.
Preet Sangha
+3  A: 

In general, yes you can.

I am mainly focused on the web development so for examples I can give Stack Overflow, Facebook, Amazon etc.

Reddit.com is written in Python. It has a large user base and receives a fair amount of traffic and seems to be doing well. Reddit doesn't use Django though.

Manoj Govindan
+2  A: 

Python is ideal for web development. It's light, easy, and excels at gluing other bits together, and working with high level interfaces. If and when I do "web" development, I wouldn't use anything else.

Update0

It's also a superior language for scripting, small cross platform applications and prototyping. It only really starts to crumble when extreme performance requirements are stringent. That is, it's holding things up in a big way. I also find it's difficult to refactor (a property of dynamic typing), and to utilize platform specific bindings. These things can be worked around (quite easily, due to Python's C implementation, and numerous modules for this purpose), just as in most other good languages.

Python is the best high level language, the only language it can't replace is C.

Matt Joiner
What if it is not web?
Ilian Iliev
A: 

Performance wise - Yes, certainly for web frontends. The performance bottleneck is always the database.

gnibbler
not always. I would say that the bottle neck in mainstream large systems generally is inter machine communications. Sometimes this is DB, sometimes just plain an simple people writing code assuming that the functions will return within microseconds but not taking into account that the call is an rpc and could takes seconds.
Preet Sangha
@Preet, sure it's possible to write a crappy implementation in any language.
gnibbler
+2  A: 

See by yourself :

http://en.wikipedia.org/wiki/List_of_Python_software

I think it can handle big apps.

elblanco
+2  A: 

The back end of YouTube is almost entirely in Python. Here is a talk by Cuong Do Cuong, the engineering manager on the YouTube scalability team that goes into a lot of detail of the issues they faced and how they solved them. He points out that lanaguage speed is almost never a bottleneck.

I suspect that YouTube has a significantly higher load that whatever you are working on will.

Dave Kirby
+2  A: 

The answer to your question really boils down to what you have in mind when you say "big application". The simple answer will be "yes". Python serves as the backbone for incredibly complex systems and it does so elegantly (just take a look at how large yet well designed Twisted & Django are). However, it's a tool like any other. It contains performance tradeoffs that may or may not be well suited to your application domain.

If you're looking to build a high-performance flight simulator that must run complex calculations at over 1000Hz... then Python probably isn't the right choice for the whole project. If, on the other hand, single-CPU performance isn't a predominant factor or the application will be spread out over multiple servers to achieve scalability requirements, Python will likely be a good choice.

It's amazing how easily people forget just how expensive development time is. Python is well known for the incredible speed with which production quality applications can be developed. For almost anything non trivial, the development time saved will far outweigh the cost associated with tossing a few extra servers into the pool.

Rakis
on several forums I read django is not so well designed. Not a Python fault anyway.
joaquin
The "1000 Hz flight simulator" is probably not a good example, the vast majority of games are driven by scripting languages these days (more often LUA than Python, but that's because it offers more advanced embedding features), with only time-critical parts written in low level languages.
Luper Rouch
Rakis
Yes, it matters for time-critical parts. I don't see what a 1000 Hz simulator has that is so different than one running at 60, 80% of the execution time goes in 20% of the code.
Luper Rouch
Rakis
+10  A: 

Python is a pleasure to work with on big applications. Compared to other enterprise-popular languages you get:

  • No compilation time, if you ever worked on a large C++ project you know how time consuming this can get
  • A concise and clean syntax that makes reading code easier, also a big time saver when reading someone else's code or even yours when it was written long time ago
  • Portability at the core level, if it's important for your app to run on more than one platform it certainly helps
  • It's fast enough for most things, and when it's not, rewriting hot spots in C is trivial with tools such as Cython and numpy. People advocating against dynamic languages for speed reasons have forgotten the 80-20 rule (or never heard about it). The important thing to consider when choosing a language for a performance-critical application IMHO is how easily you can gain access to the C level when needed, and Python is great for that

It's not a magic language however, you need to use the same techniques used for big projects in other languages: TDD (some may argue that it's more important than in other languages because of the lack of type checking, but that's not a win for other languages, unit tests are always important in big projects), clean OO design, etc... or maintaining your application will become a nightmare.

The main reason for its lack of acceptance in enterprise compared to .NET, Java et al. is probably not having herds of consultants and "certified specialists" bragging about their tool being the best thing on Earth. I also heard Java was easily accepted because its syntax resembled C++... that may not be such a silly idea considering C# also chose to take this route.

Luper Rouch
All of these are very fine points. I could only add that python automatically compiles modules to bytecode and tools like memcache or fastcgi can also improve performance.
bogeymin
+1  A: 

In fact, Python give you all of the best power of programming. Easy, powerful and quick! Enjoy it in big your projoect!

Fredy87
A: 

There two very important factors with python:

1) Easy to use

2) Easy to interface with other programming languages

FACTOR 1

Because python a language that emphasizes , simplicity , readability of code both for its own syntax and libraries, that equal to writing less code. And for software that is big this is very important. Your is simple, easier to understand by someone else, easier to debug , easier to recode , rewrite and modify. Easy to exchange between a team of many people.

FACTOR 2

Why reinvent that wheel ? You want to use a C/C++ library ? How about a Java or .NET library ? Python will let you do exactly that and will even spoil you with allowing you to enjoy the experience without ever leaving python's syntax comfort zone. Jython, Ironpython, Cython, ctypes ,pyrex etc are excellent tools making python limitless with its capabilities let you code in all those diffirent languages/frameworks/runtimes always with python syntax. What more could you ask for ?

In the end its python flexibility that makes it accelerate in the gain of its popularity, always hand in hand with the ease of use . Power and ease of use is a huge temptation too hard to resist for small,big or huge developers alike.

Kilon
A: 

I'm going to answer your revised question about why would anyone use a different language or technology stack. First, I love Python. Great language and definitely has its merits. However, I choose C#/.NET as my technology of choice and use Python for scripting.

Yes, Python as a language is very simple/clean and there isn't compile time. However, I find it many times easier to work with a strongly/statically typed language. #1 reason is IntelliSense (and I mean GOOD IntelliSense - haven't been satisfied with Python editors in this regard). IntelliSense makes a huge difference in ease/speed of development.

C# is backed by Microsoft (for better or worse). While the h8t3rs out there can throw rocks, it is hard to deny that Microsoft has technology for the entire stack (desktop, server, web, mobile, etc.) and it all integrates very nicely. I also know that it is supported by hundreds of developers who are dedicated to providing the best experience possible. I also can go to a plethora of sites and watch videos, read articles, and find what I need for just about anything. Support is nice.

I know Python has an excellent (and large) range of libraries and frameworks at its disposal, but I have also felt a certain lack of continuity between the various projects. Use this 3rd-party library here, throw this 3rd party library in there, use this open source project here...And while I love open source, it takes a much longer time to reach the quality in which Microsoft has put out.

Lastly, Visual Studio is one of the most excellent IDE's I've ever experienced. I know there are many fine text editors out there (I love you VIM!), but it is hard to beat the integration of source control, code editing, compiling, building, publishing, testing, and deploying all wrapped into a most excellent package.

All this to say, Python is great and can perform wonderfully on large sites - don't get me confused. However, there are valid arguments for using enterprise technologies. It just depends on what resources you (or your team) will need, what you are already familiar with, and how you plan to scale when your application is successful. If you are comfortable with the technology and libraries, have a community to answer tough questions, and can compartmentalize your code so that if you ever do need to re-write it, it is already broken up, then I say you will do just fine.

j0rd4n