Presentation is loading. Please wait.

Presentation is loading. Please wait.

PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are.

Similar presentations


Presentation on theme: "PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are."— Presentation transcript:

1 PHP vs. Python

2 Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are easy to learn are easy to extend in C, C++ and Java are extremely portable. They run on almost all platforms in existence without recompilation. support for variable number of function arguments.

3 Similarities have the ability to freeze live objects in a string representation (for storing arbitrary objects on disk, moving them over the network, etc); they can then be converted back to identical objects with data intact.

4 Differences – What Python Lacks syntax from C and Perl, with lots curly braces and dollar signs the 'switch' statement and 'do... while' construct increment and decrement and assignment operators (assignment is a statement only in Python) the ternary operator/statement (... ?... :...)

5 Differences – What Python Lacks schizophrenic tableau of function names. The builtin library has a wide variety of naming conventions. There are no namespaces, so functions often have prefixes to denote their source (but often not). Functions are often placed into classes to simulate namespaces.

6 Differences – What Python Lacks a very casual language where all variables are "set" (to NULL), and a somewhat weak type system (not to be confused with dynamic types) an expedient (commonly installed) environment references ('$a =& $b' means that when $b changes, $a changes also)

7 Differences – What Python Lacks one array type that doubles as a list and a dictionary. Dictionary keys are iterated in their original order. private, protected and public modifiers for both properties and methods abstract and final modifiers for both classes and methods interfaces

8 Differences – What PHP Lacks a general purpose programming language (not just for the web) indentation is used to mark out block structure rather than curly braces namespaces and modules a small core very clear, concise, and orthogonal syntax

9 Differences – What PHP Lacks it is self documenting with docstrings and pydoc keyword arguments to functions and methods, easy support for default arguments true object orientation and 'first class' classes and functions

10 Differences – What PHP Lacks classes are used extensively in the standard library a notion of private attributes multiple inheritance object-oriented file handling method chaining excellent introspection

11 Differences – What PHP Lacks everything is a reference one 'del' statement for all data types. consistent case sensitivity (PHP functions are case insensitive, but variables are case sensitive) a simple array slicing syntax lambdas and other builtin functional programming constructs

12 Differences – What PHP Lacks iterators structured exception handling operator overloading SWIG integration threading an excellent profiler several debuggers and IDEs lots of high-level data types (lists, tuples, dicts, mx.DateTimes, NumPy arrays, etc.)

13 Differences – What PHP Lacks differentiation between arrays (lists) and associative arrays (dictionaries). dates that aren't limited to UNIX timestamps ( 2038) cached byte-code compilation a standardized database API support for all major GUI frameworks strong internationalization and UNICODE support

14 Differences – What PHP Lacks maturity, stability and upward- compatibility tends to lead to much more scalable applications -- importing modules is safer than textually including code as in PHP: global variables are not used to exchange information.

15 Benchmarking

16 Benchmarking

17 Conclusion PHP’s big core uses huge amount of resources as compared to Python.

18 References http://xodian.net/serendipity/index.php?/ar chives/27-Benchmark-PHP-vs.-Python-vs.- Perl-vs.-Ruby.html http://xodian.net/serendipity/index.php?/ar chives/27-Benchmark-PHP-vs.-Python-vs.- Perl-vs.-Ruby.html http://wiki.python.org/moin/PythonVsPhp http://frcchang.blogspot.com/2005/07/php -note-difference-between-php-and.html http://frcchang.blogspot.com/2005/07/php -note-difference-between-php-and.html http://www.wellho.net/mouth/67_Object- Oriented-Programming-in-PHP.html http://www.wellho.net/mouth/67_Object- Oriented-Programming-in-PHP.html


Download ppt "PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are."

Similar presentations


Ads by Google