Michel Schwandner, Patrick Havel, Francis Oloo
Fundamentals and Concepts of Software Engineering-Winter 2012/13
 1. Scripting languages
 2. PHP
 3. Python
 4. Perl
 5. Comparison
 Definition:
Scripting languages, which can be embedded within
HTML, commonly are used to add functionality to a Web page, such
as different menu styles or graphic displays or to serve dynamic
advertisements. These types of languages are client-side scripting
languages, affecting the data that the end user sees in a browser
window. Other scripting languages are server-side scripting
languages that manipulate the data, usually in a database, on the
server.
(from: http://www.webopedia.com/TERM/S/scripting_language.html)
 Characteristics:
 implicit declared variables
▪ dynamic typecast
▪ valid for functions too
 automatic memory management
 Interpreted code
 fields of application:
 command-line interpreters
▪ sh
▪ cmd
 Scripting languages in internet applications
▪ PHP
▪ Perl
▪ Python
 fields of application:
 Scripting languages in program library
▪ VBScript
▪ JScript
 Scripting languages in programs
▪ QuakeC
▪ UnrealScript
 comparison with programming languages
Scripting languages Programming languages
Interpreter Compiler
mostly imperative programming
paradigm
mostly object orientated programming
paradigm
slowly -> code interpretation during
runtime
very fast runtime
automatic memory management memory management (pointer
technique (C, C++))
typeless strict type handling
 introductory and historical aspects
 development began in 1994
 started with a set of Perl scripts calling "Personal
Home PageTools“
 free software released under the PHP License
 almost 80% of the web pages using PHP
 final version 6 will publish soon
 Characteristics:
 own scripting language with its own interpreter
 close to C or Java syntax
 support of object orientated approach
 extensive function library
 Characteristics:
 server-side
scripting language
 embedded into an
HTML source document or
in a proper PHP file
 Fields of application:
 originally designed forWeb development
 Database connection
 HTML forms
 Dynamic generation of graphs and file upload
 most famous application is the LAMP
Pros Cons
easy to learn -> close to C, java and
human languages
no byte code cache
a lot of fields of applications procedural programming in object
orientated library
separation of code and layout weak typecast
feature rich security problem
Free interpreted language -> slow runtime
browser independency automatic memory management
useable on each OS
young language
 Examples:
 embedded in HTML Code
▪ <script language="php"> ... </script>
▪ file extension .html
 own PHP document
▪ <?PHP .... ?>
▪ <? .... ?>
▪ file extension .php
 Code examples:
 Introduction and History
 Python from Monty Python Python fun to use
 1989: implementation by Guido van Rossum
(Netherlands)
 1991: appearance
 2000: version 2.0
 2008: version 3.0 (backwards incompatible)
 2007/2010:TIOBE Programming Language of theYear Award
 actual versions:
▪ 3.3.0 (sept. 2012)
▪ 2.7.3 (april 2012)
 Characteristics
 language integration: C, C++, Java
 full modularising
 standard libraries for GIS, databases, important
internet protocols, mathematics, statistics, …
 Block structures
 everything is an object
 Multi-paradigm language: object-oriented style,
the traditional procedural style or a mix of those
Pro Cons
easy to learn no special syntax to distinguish methods
and functions (methods -> self)
clean and elegant design not as fast as C or C++
include high-level data types script length
easily build GUI (Tkinter) Slow run-time
exception handling Version 3.0: downward incompatibility
well-established development
community and a central Web site
(Python tools and extension modules)
large standard library
open source
for many platforms
(Unix,Windows, Mac OS X,…)
 Applications
 Web applications (Apache web server)
 Scientific: NumPy, SciPy, Matplotlib,ArcPy
 3D animation packages (Blender, Cinema 4D…)
 GIS-Software:ArcGIS , Quantum GIS,Grass GIS,
etc.
 Others:Youtube, BitTorrent, Google, NASA,
CERN,…
Example 1:
Example 2:
 Perl : Practical Extraction and Reporting Language
 Originally developed by LarryWall in 1987
 An interpreted language: does not need to be
compiled as separate step
 Perl programs are text files run through an
interpreter
 Current version 5.16.2
 Characteristics
 Can run both onWindows and UNIX/Linux
 InWindows can be run through the Command line
editor
 You need to define the location of Perl Script
 The version can be stated within the script
 Typical applications
 Text processing
 System administration: tying smaller scripts, working with file
systems and networking
 Web programming: Used to process and generate HTML
 Database interaction
 Mail processing: automated processing of internet emails including
filtering by address and content
 Automating file retrieval via FTP
 Applications in geoinformatics
 A number of modules exist at CPAN for handling
geographic data, GPS
http://www.cpan.org/modules/01modules.index.html
 Can be used for constructing GIS tools for
handling and editing geocoded data on a map
http://www.isprs.org/proceedings/xxxv/congress/yf/papers/934.pdf
Pros Cons
Portable Poor documentation/ Informal support,
mainly through volunteers
Very dense code thus saving on coding
time
Is an interpreted language, therefore not
as fast
Good with text handling Protecting proprietary code; not
compiled thus can only distributed as
codes
Backward compatibility Maintainability of scripts
Very flexible
Massive library of reusable codes
•The program should be saved as a .pl format
 Hash:Two dimensional arrays with keys and
values e.g
criteria Python PHP Perl
object oriented
programing
simple but
effective approach
 downright easy
weak -> most of the of
approaches aren’t
implemented
providesOOP features
of data encapsulation
and inheritance using
modules and packages
runtime Worst of these
three
relatively fast in procedural
approach
Very good speeds
especially for test
processing
modularity Full modularising store repeated code in
separated functions
Full modularising
through modules and
packages
code length Depending on
application, but
over all worse
different possibilities how
to write the code
Highly optimized
security modules and
“community” for
security
not that safe (include, user
interactions)
User input vulnerability
Many thanks
-
Comments??

Scripting languages presentation_michel_patrickfrancis

  • 1.
    Michel Schwandner, PatrickHavel, Francis Oloo Fundamentals and Concepts of Software Engineering-Winter 2012/13
  • 2.
     1. Scriptinglanguages  2. PHP  3. Python  4. Perl  5. Comparison
  • 3.
     Definition: Scripting languages,which can be embedded within HTML, commonly are used to add functionality to a Web page, such as different menu styles or graphic displays or to serve dynamic advertisements. These types of languages are client-side scripting languages, affecting the data that the end user sees in a browser window. Other scripting languages are server-side scripting languages that manipulate the data, usually in a database, on the server. (from: http://www.webopedia.com/TERM/S/scripting_language.html)
  • 4.
     Characteristics:  implicitdeclared variables ▪ dynamic typecast ▪ valid for functions too  automatic memory management  Interpreted code
  • 5.
     fields ofapplication:  command-line interpreters ▪ sh ▪ cmd  Scripting languages in internet applications ▪ PHP ▪ Perl ▪ Python
  • 6.
     fields ofapplication:  Scripting languages in program library ▪ VBScript ▪ JScript  Scripting languages in programs ▪ QuakeC ▪ UnrealScript
  • 7.
     comparison withprogramming languages Scripting languages Programming languages Interpreter Compiler mostly imperative programming paradigm mostly object orientated programming paradigm slowly -> code interpretation during runtime very fast runtime automatic memory management memory management (pointer technique (C, C++)) typeless strict type handling
  • 9.
     introductory andhistorical aspects  development began in 1994  started with a set of Perl scripts calling "Personal Home PageTools“  free software released under the PHP License  almost 80% of the web pages using PHP  final version 6 will publish soon
  • 10.
     Characteristics:  ownscripting language with its own interpreter  close to C or Java syntax  support of object orientated approach  extensive function library
  • 11.
     Characteristics:  server-side scriptinglanguage  embedded into an HTML source document or in a proper PHP file
  • 12.
     Fields ofapplication:  originally designed forWeb development  Database connection  HTML forms  Dynamic generation of graphs and file upload  most famous application is the LAMP
  • 13.
    Pros Cons easy tolearn -> close to C, java and human languages no byte code cache a lot of fields of applications procedural programming in object orientated library separation of code and layout weak typecast feature rich security problem Free interpreted language -> slow runtime browser independency automatic memory management useable on each OS young language
  • 14.
     Examples:  embeddedin HTML Code ▪ <script language="php"> ... </script> ▪ file extension .html  own PHP document ▪ <?PHP .... ?> ▪ <? .... ?> ▪ file extension .php
  • 15.
  • 17.
     Introduction andHistory  Python from Monty Python Python fun to use  1989: implementation by Guido van Rossum (Netherlands)  1991: appearance  2000: version 2.0  2008: version 3.0 (backwards incompatible)  2007/2010:TIOBE Programming Language of theYear Award  actual versions: ▪ 3.3.0 (sept. 2012) ▪ 2.7.3 (april 2012)
  • 18.
     Characteristics  languageintegration: C, C++, Java  full modularising  standard libraries for GIS, databases, important internet protocols, mathematics, statistics, …  Block structures  everything is an object  Multi-paradigm language: object-oriented style, the traditional procedural style or a mix of those
  • 19.
    Pro Cons easy tolearn no special syntax to distinguish methods and functions (methods -> self) clean and elegant design not as fast as C or C++ include high-level data types script length easily build GUI (Tkinter) Slow run-time exception handling Version 3.0: downward incompatibility well-established development community and a central Web site (Python tools and extension modules) large standard library open source for many platforms (Unix,Windows, Mac OS X,…)
  • 20.
     Applications  Webapplications (Apache web server)  Scientific: NumPy, SciPy, Matplotlib,ArcPy  3D animation packages (Blender, Cinema 4D…)  GIS-Software:ArcGIS , Quantum GIS,Grass GIS, etc.  Others:Youtube, BitTorrent, Google, NASA, CERN,…
  • 21.
  • 24.
     Perl :Practical Extraction and Reporting Language  Originally developed by LarryWall in 1987  An interpreted language: does not need to be compiled as separate step  Perl programs are text files run through an interpreter  Current version 5.16.2
  • 25.
     Characteristics  Canrun both onWindows and UNIX/Linux  InWindows can be run through the Command line editor  You need to define the location of Perl Script  The version can be stated within the script
  • 26.
     Typical applications Text processing  System administration: tying smaller scripts, working with file systems and networking  Web programming: Used to process and generate HTML  Database interaction  Mail processing: automated processing of internet emails including filtering by address and content  Automating file retrieval via FTP
  • 27.
     Applications ingeoinformatics  A number of modules exist at CPAN for handling geographic data, GPS http://www.cpan.org/modules/01modules.index.html  Can be used for constructing GIS tools for handling and editing geocoded data on a map http://www.isprs.org/proceedings/xxxv/congress/yf/papers/934.pdf
  • 28.
    Pros Cons Portable Poordocumentation/ Informal support, mainly through volunteers Very dense code thus saving on coding time Is an interpreted language, therefore not as fast Good with text handling Protecting proprietary code; not compiled thus can only distributed as codes Backward compatibility Maintainability of scripts Very flexible Massive library of reusable codes
  • 29.
    •The program shouldbe saved as a .pl format
  • 30.
     Hash:Two dimensionalarrays with keys and values e.g
  • 31.
    criteria Python PHPPerl object oriented programing simple but effective approach  downright easy weak -> most of the of approaches aren’t implemented providesOOP features of data encapsulation and inheritance using modules and packages runtime Worst of these three relatively fast in procedural approach Very good speeds especially for test processing modularity Full modularising store repeated code in separated functions Full modularising through modules and packages code length Depending on application, but over all worse different possibilities how to write the code Highly optimized security modules and “community” for security not that safe (include, user interactions) User input vulnerability
  • 32.