See All Titles |
![]() ![]() Python and Other LanguagesScripting languages, as everyone knows, are slower than compiled languages. Python uses its interpreter to manage most of the things you need to worry about when using compiled languages. The consequence is that you have a productive application in a short period. However, the application doesn't run as fast as a compiled version. Okay; it is slower, but who cares? Nowadays, the development time is a great differential between companies. It doesn't matter whether an application runs slower or faster in Python than in other languages. The fact is that you have saved a considerable amount of time. And by the way, it's not as slow as many people say. Python incorporates the best of scripting languages (Perl, Tcl, Awk) and systems languages (Java, C, C++). If you work in large projects, the use of Python will give you fast and reliable results. However, Python doesn't beat other languages all the time. C and C++ are good for performance-critical modules of an application because they are system languages that talk almost directly to the processor. For that reason, many programmers create Python extensions using these languages when time is crucial for the project. Python Versus C/C++The following is a list of differences between Python and C/C++:
In general, Python is a great tool to test C/C++ applications. Python adds some contribution to C/C++ projects by gluing components and handling interfaces to test them. In addition to C/C++, Python is often compared to Perl, Java, and Tcl. Python Versus PerlPython is easier to learn than Perl, and it presents a more readable code. Perl is an excellent language too. Perl is great for work that requires text manipulation and data extraction, and it is also a great language for system administrators. The Windows distribution of Perl is apparently pretty good, so it can be used productively under Windows. However, Perl is much more productive when used in a UNIX environment. Python's productivity is platform-independent. Another important difference is that Python was designed to be fully object-oriented and Perl had object-orientation implemented later as an add-on to the language. One problem with Perl is that because "there's more than one way to do it," different programmers in large projects might know different subsets of the language and will not be able to read each other's code. Python Versus TclPython's syntax is much clearer than Tcl's. Besides, it is the fastest one, and it needs less C extensions than those Tcl requires when doing the same job. Similar to Tcl, Python uses Tk as its standard GUI. Also, Python has more data types than just strings. Python Versus SmalltalkThe following list shows some differences between Python and Smalltalk:
Python Versus JavaPython offers dynamic typing and a rapid development environment that requires less code and no compilation phase. Although Python runs slower than Java, it is the more portable one. JPythonIt's a new Python implementation that is 100% written in Java. You can use all the features of Python languages along with the entire universe of Java classes. The integration between JPython and Java is better than the integration between Python and C++ because JPython can use Java classes without needing a wrapper generator. Several other reasons why you should consider giving JPython a try are as follows:
By the way, JPython programmers also refer to Non-Java Python as CPython in order to distinguish Python's Java Implementation from Python's C implementation. ConclusionNow, just imagine projects that require several layers of application design. Do you think that these projects'leaders have some kind of problem to scale up their applications? If you've been in a situation like that, have you ever thought about using the same language for all your needs? Are you going to have a programmer coding in JavaScript? (That language doesn't support exception handling.) Say that you need to create some Java routines, using Servlets, for the back end. What if this programmer doesn't know Java? Are you going to explain Java to him, or are you going to hire a Java programmer? Nowadays, technology and projects are moving too fast. You don't have time to teach new technologies to the people who are coding your applications. This is one more reason to stick with Python. You have the flexibility to play in all bases and do almost everything using the same language. I am sure you are satisfied now that you know the reasons why Python is a fantastic language. What are you waiting for? I strongly encourage you to use Python now. For more information about Python versus other languages, check out the following URL: http://www.python.org/doc/Comparisons.html.
|
Index terms contained in this sectionC programming languagevs. Python C++ programming language vs. Python Java programming language vs. Python JPython languages C and C++ vs. Python Java vs. Python Perl vs. Python Smalltalk vs. Python Perl programming language vs. Python Python vs. C and C++ vs. Java vs. Perl vs. Smalltalk Smalltalk programming language vs. Python |
© 2002, O'Reilly & Associates, Inc. |