Upload
murtaza-abbas
View
2.062
Download
2
Tags:
Embed Size (px)
DESCRIPTION
A brief comparison between the two most happening languages of the past decade.
Citation preview
Murtaza A
Introductory Comparison- PHPandPython
13 Slides
ApplesandOranges
2
A little bit of history
A little bit of comparison
To py or not to py
Summary
1
2
3
when I see a bird that walks like a duck and swims like a duck and quacks like a duck, I call that bird a duck.
3
Personal Homepage
A little bit of history
Rasmus Lerdorf (1995) took Perl by the throat PHP 1&2
Andi Gutmans & Zeev Suraski (1997) took PHP by the throat PHP 3
Zend Core Engine (2000) PHP 4
Object-Oriented PHP (2004) PHP 5
4
PHP Hypertext Processor
A little bit of history
PHP 5.3 supports scripting in multiple languages and namespaces
PHP 5.3 is fully x64 aware
PHP 6 is in parallel development
PHP is installed on more than 30,000,000 websites and 2,000,000 web servers
5
Python
A little bit of history
Guido van Rossum (1980) took ABC by the throat Python 0.1
van Rossum (1991) opens up Python 0.9
Python 1.0 (1994) followed by GNU-compatible Python 1.6 (1998)
With Garbage Collector and Unicode Support (2000) Python 2.0
6
Just Py
A little bit of history
Python Software Foundation (2001) owns rights to Python code v2.1a onwards
Python 3000 (2008) “reduce feature duplication by removing old ways of doing things”
Multi-paradigm (OO, Struct, Func)
Backwards Incompatibility
7
What PHP can do
to py or not to py
Server Side Scripting
Command Line Scripting
Write Desktop Apps
Interface with RDBMS
Run on any OS or platform, free of charge
8
Why PHP
to py or not to py
RAD with CakePhp, ZendFramework
Uses widely familiar C++ Syntax
The most popular web scripting language
Yahoo, Facebook, Joomla, Digg, Wikipedia, YouTube, WordPress, Tagged
FOSS
9
What Py can do
to py or not to py
Server Side Scripting / CLS
Write Desktop Apps
Develop non-critical areas of Linux & Symbian
Write 2D/3D Apps (incl. Video Games)
Run on any OS or platform, free of charge
10
Why Py
to py or not to py
RAD/Glue with Django, Zope
Combines Java, Haskell, Modula-3, Perl, C++
IronPython, Jython, CPython, Pyjamas
Yahoo, Google, Nokia, CERN, NASA, YouTube, BitTorrent
FOSS
11
Apples
A little bit of comparision
Oranges
12
Python PHP
• Python uses whitespace indentation • Codes with lots curly braces [{ }] and dollar signs [ $]
• Case Sensitive • PHP variable names are case sensitive, but the names of functions are case insensitive.
• Doesn’t support a native switch statement
•The 'switch' statement and 'do ... while' construct
•Clear, concise syntax •C++ style syntax
• Functions are declared with the "def" keyword.
• Functions often have prefixes to denote their source
•Duck Typing •Late Static Binding
A little bit of comparision
13
Python PHP
•Strongly typed •Weakly typed
•General purpose language • Predominantly Web scripting langauge
•Java-style self-documenting (pyDoc) •No such documenting features (may be in PHP 6)
•Multiple inheritance •Supports Java-style ‘Trails’
• C++ style Operator overloading • Can be ‘emulated’ using compiler extensions
•Multi-threading •Threading may be introduced in PHP 6
A little bit of comparision
Thankyou
Misfortune shows those who are not really friends. -Aristotle