SlideShare ist ein Scribd-Unternehmen logo
1 von 60
Downloaden Sie, um offline zu lesen
Programming Languages are Not the Same

                                 Dr.Haitham A. El-Ghareeb

                                  Information Systems Department
                           Faculty of Computers and Information Sciences
                                        Mansoura University
                                       helghareeb@gmail.com


                                     September 23, 2012




Dr.Haitham A. El-Ghareeb (CIS)     Data Structures and Algorithms - 2012   September 23, 2012   1 / 29
Programming Languages




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   2 / 29
Programming Languages
     used for controlling the behavior of a machine (often a computer).




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   2 / 29
Programming Languages
     used for controlling the behavior of a machine (often a computer).
     programming languages conform to rules for syntax and semantics.




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   2 / 29
Programming Languages
     used for controlling the behavior of a machine (often a computer).
     programming languages conform to rules for syntax and semantics.
     There are thousands of programming languages and new ones are
     created every year.




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   2 / 29
Programming Languages
     used for controlling the behavior of a machine (often a computer).
     programming languages conform to rules for syntax and semantics.
     There are thousands of programming languages and new ones are
     created every year.
     Few languages ever become sufficiently popular that they are used by
     more than a few people




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   2 / 29
Programming Languages
     used for controlling the behavior of a machine (often a computer).
     programming languages conform to rules for syntax and semantics.
     There are thousands of programming languages and new ones are
     created every year.
     Few languages ever become sufficiently popular that they are used by
     more than a few people
     professional programmers may use dozens of languages in a career.




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   2 / 29
Basis for Comparing Programming Languages
 1   Object Orientation
 2   Static vs. Dynamic Typing
 3   Generic Classes
 4   Inheritence
 5   Feature Renaming
 6   Method Overloading
 7   Operator Overloading
 8   Higher Order Functions & Lexical Closures
 9   Garbage Collection




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   3 / 29
Basis for Comparing Programming Languages (Cont.)
 10   Uniform Access
 11   Class Variables/Methods
 12   Reflection
 13   Access Control
 14   Design by Contract
 15   Multithreading
 16   Regular Expressions
 17   Pointer Arithmetic
 18   Language Integration
 19   Built-In Security




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   4 / 29
Object Orientation
There are several qualities for Object Oriented Languages:




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   5 / 29
Object Orientation
There are several qualities for Object Oriented Languages:
      Encapsulation / Information Hiding




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   5 / 29
Object Orientation
There are several qualities for Object Oriented Languages:
      Encapsulation / Information Hiding
      Inheritance




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   5 / 29
Object Orientation
There are several qualities for Object Oriented Languages:
      Encapsulation / Information Hiding
      Inheritance
      Polymorphism/Dynamic Binding




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   5 / 29
Object Orientation
There are several qualities for Object Oriented Languages:
      Encapsulation / Information Hiding
      Inheritance
      Polymorphism/Dynamic Binding
      All pre-defined types are Objects




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   5 / 29
Object Orientation
There are several qualities for Object Oriented Languages:
      Encapsulation / Information Hiding
      Inheritance
      Polymorphism/Dynamic Binding
      All pre-defined types are Objects
      All operations performed by sending messages to Objects




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   5 / 29
Object Orientation
There are several qualities for Object Oriented Languages:
      Encapsulation / Information Hiding
      Inheritance
      Polymorphism/Dynamic Binding
      All pre-defined types are Objects
      All operations performed by sending messages to Objects
      All user-defined types are Objects




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   5 / 29
Static vs. Dynamic Typing




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   6 / 29
Static vs. Dynamic Typing
     The debate between static and dynamic typing has raged in
     Object-Oriented circles for many years with no clear conclusion.




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   6 / 29
Static vs. Dynamic Typing
     The debate between static and dynamic typing has raged in
     Object-Oriented circles for many years with no clear conclusion.
     Proponents of dynamic typing contend that it is more flexible and
     allows for increased productivity.




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   6 / 29
Static vs. Dynamic Typing
     The debate between static and dynamic typing has raged in
     Object-Oriented circles for many years with no clear conclusion.
     Proponents of dynamic typing contend that it is more flexible and
     allows for increased productivity.
     Those who prefer static typing argue that it enforces safer, more
     reliable code, and increases efficiency of the resulting product.




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   6 / 29
Static vs. Dynamic Typing
     The debate between static and dynamic typing has raged in
     Object-Oriented circles for many years with no clear conclusion.
     Proponents of dynamic typing contend that it is more flexible and
     allows for increased productivity.
     Those who prefer static typing argue that it enforces safer, more
     reliable code, and increases efficiency of the resulting product.
     A dynamic type system doesnt require variables to be declared as a
     spe- cific type. Any variable can contain any value or object.




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   6 / 29
Static vs. Dynamic Typing
     The debate between static and dynamic typing has raged in
     Object-Oriented circles for many years with no clear conclusion.
     Proponents of dynamic typing contend that it is more flexible and
     allows for increased productivity.
     Those who prefer static typing argue that it enforces safer, more
     reliable code, and increases efficiency of the resulting product.
     A dynamic type system doesnt require variables to be declared as a
     spe- cific type. Any variable can contain any value or object.
     Statically-typed languages require that all variables are declared with
     a specific type.




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   6 / 29
Generic Classes




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   7 / 29
Generic Classes
      refer to the ability to parameterize a class with specific data types.




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   7 / 29
Generic Classes
      refer to the ability to parameterize a class with specific data types.
      A common example is a stack class that is parameterized by the type
      of elements it contains.




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   7 / 29
Generic Classes
      refer to the ability to parameterize a class with specific data types.
      A common example is a stack class that is parameterized by the type
      of elements it contains.
      it allows statically typed languages to retain their compile-time type
      safety




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   7 / 29
Generic Classes
      refer to the ability to parameterize a class with specific data types.
      A common example is a stack class that is parameterized by the type
      of elements it contains.
      it allows statically typed languages to retain their compile-time type
      safety
      Dynamically typed languages do not need parameterized types in
      order to support generic programming




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   7 / 29
Inheritence




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   8 / 29
Inheritence
      the ability for a class or object to be defined as an extension or
      specialization of another class or object.




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   8 / 29
Inheritence
      the ability for a class or object to be defined as an extension or
      specialization of another class or object.
      Most object-oriented languages support class-based inheritance




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   8 / 29
Inheritence
      the ability for a class or object to be defined as an extension or
      specialization of another class or object.
      Most object-oriented languages support class-based inheritance
      others such as SELF and JavaScript support object-based inheritance




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   8 / 29
Inheritence
      the ability for a class or object to be defined as an extension or
      specialization of another class or object.
      Most object-oriented languages support class-based inheritance
      others such as SELF and JavaScript support object-based inheritance
      A few languages, notably Python and Ruby, support both class- and
      object-based inheritance, in which a class can inherit from another
      class and individual objects can be extended at run time




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   8 / 29
Inheritence
      the ability for a class or object to be defined as an extension or
      specialization of another class or object.
      Most object-oriented languages support class-based inheritance
      others such as SELF and JavaScript support object-based inheritance
      A few languages, notably Python and Ruby, support both class- and
      object-based inheritance, in which a class can inherit from another
      class and individual objects can be extended at run time
      Though there are identified and classified as many as 17 different
      forms of inheritance. Even so, most languages provide only a few
      syntactic constructs for inheritance




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   8 / 29
Inheritence
      the ability for a class or object to be defined as an extension or
      specialization of another class or object.
      Most object-oriented languages support class-based inheritance
      others such as SELF and JavaScript support object-based inheritance
      A few languages, notably Python and Ruby, support both class- and
      object-based inheritance, in which a class can inherit from another
      class and individual objects can be extended at run time
      Though there are identified and classified as many as 17 different
      forms of inheritance. Even so, most languages provide only a few
      syntactic constructs for inheritance
      Multiple Inheritence




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   8 / 29
Feature Renaming
Feature renaming is the ability for a class or object to rename one of its
features (a term used to collectively refer to attributes and methods) that
it inherited from a super class.




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   9 / 29
Method Overloading
     Method overloading (also referred to as parametric polymorphism) is
     the ability for a class, module, or other scope to have two or more
     methods with the same name.
     Calls to these methods are disambiguated by the number and/or type
     of arguments passed to the method at the call site.




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   10 / 29
Operator Overloading
ability for a programmer to define an operator (such as +, or *) for
user-defined types.




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   11 / 29
Higher Order Functions and Lexical Closures
Higher Order Functions:
    functions that can be treated as if they were data objects.
              they can be bound to variables (including the ability to be stored in
              collections)
              can be passed to other functions as parameters
              can be returned as the result of other functions
Lexical Closure: bundling up the lexical (static) scope surrounding the
function with the function itself, so that the function carries its
surrounding environment around with it wherever it may be used.




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   12 / 29
Garbage Collection
mechanism allowing a language implementation to free memory of unused
objects on behalf of the programmer
      Reference Counting
      Mark and Sweep
      Generational




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   13 / 29
Uniform Access
All services offered by a mod- ule should be available through a uniform
notation, which does not betray whether they are implemented through
storage or through computation.




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   14 / 29
Class Variables/Methods
Class variables and methods are owned by a class, and not any particular
instance of a class. This means that for however many instances of a class
exist at any given point in time, only one copy of each class
variable/method exists and is shared by every instance of the class.




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   15 / 29
Reflection
ability for a program to determine various pieces of information about an
object at run-time. Most object-oriented languages support some form of
reflection. This includes the ability to determine:
      the type of the object,
      its inheritance structure,
      and the methods it contains, including the number and types of
      parameters and return types.
      It might also include the ability for determining the names and types
      of attributes of the object.




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   16 / 29
Access Control
ability for a modules implementation to remain hidden behind its public
interface.




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   17 / 29
Design by Contract
Design by Contract (DBC) is the ability to incorporate important aspects
of a specification into the software that is implementing it. The most
important features of DBC are:
      Pre-conditions, which are conditions that must be true before a
      method is invoked
      Post-conditions, which are conditions guaranteed to be true after the
      invocation of a method
      Invariants, which are conditions guaranteed to be true at any stable
      point during the lifetime of an object




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   18 / 29
Multithreading
ability for a single process to process two or more tasks concurrently.




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   19 / 29
Regular Expressions
pattern matching constructs capable of recognizing the class of languages
known as regular languages.




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   20 / 29
Pointer Arithmetic
ability for a language to directly manipulate memory addresses and their
contents.




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   21 / 29
Language Integration
It is important for a high level language (particularly interpreted
languages) to be able to integrate seamlessly with other languages.




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   22 / 29
Built-In Security
language implementations ability to determine whether or not a piece of
code comes from a trusted source (such as the users hard disk), limiting
the permissions of the code if it does not.




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   23 / 29
Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   24 / 29
Quick Tour of C#
                                       Brief Overview




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   25 / 29
Namespaces

namespace Data Structur es . Professor {
class Haitham {
...
}
}




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   26 / 29
Classes

public class Haitham : Professor , IBlogger , IMozillaReMo {
public string name ;
public Haitham ( string name ) {
this . name = name ; // more fields and methods here
}




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   27 / 29
Attributes

class P r o f e s s o r H a i t h a m {
//...
[ Secre tOverri de ( ” . . . ” ) ] public void Teach ( Subjects ←
     d a t a s t ru c t u r e s 2 0 1 2 ) {
//...
}
}




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   28 / 29
Interfaces

interface IMozillaReMo {
IBrowser F a v o u r i te B r o w s e r { get ; s e t ; }
void Browse ( ) ;
}




 Dr.Haitham A. El-Ghareeb (CIS)     Data Structures and Algorithms - 2012   September 23, 2012   29 / 29
Enums

enum CoursesITeach {
DataStructuresAndAlgorithms ,
SystemAnalysisAndDesign ,
ResearchMethodologies ,
DataBase
}




Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   30 / 29
Struct

struct Faculty {
public float name ;
public Faculty ( String name ) {
//...
}
}




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   31 / 29
Methods

class Haitham {
//...
public void GoToLecture ( string LectureName ) {
Point location = this . targe tDataba se . Find ( targetName ) ;
this . FlyToLocation ( location ) ;
}
}




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   32 / 29
Virtual and Override Methods

class GiantRobot {
//...
public virtual void TravelTo ( Point destination ) {
this . TurnTowards ( destination ) ;
w h i l e ( this . Location != destination ) {
this . Trudge ( ) ;
}
}
}

class FlyingRobot : GiantRobot {
//...
public override void TravelTo ( Point destination ) {
i f ( this . WingState == WingState . Operational ) {
this . FlyTo ( destination ) ;
// whee !
} else {
base . TravelTo ( destination ) ; // oh well . . .
}
}
}


Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   33 / 29
Methods

class Haitham {
//...
public void GoToLecture ( string LectureName ) {
Point location = this . targe tDataba se . Find ( targetName ) ;
this . FlyToLocation ( location ) ;
}
}




 Dr.Haitham A. El-Ghareeb (CIS)   Data Structures and Algorithms - 2012   September 23, 2012   34 / 29

Weitere ähnliche Inhalte

Andere mochten auch

Automation for masses or story of creation yet another automation framework ...
Automation for masses or story of creation yet another automation framework  ...Automation for masses or story of creation yet another automation framework  ...
Automation for masses or story of creation yet another automation framework ...edrozim
 
Muro estructural final
Muro estructural finalMuro estructural final
Muro estructural finalCamilo Galvis
 
Basis for comparison programming languages
Basis for comparison programming languagesBasis for comparison programming languages
Basis for comparison programming languagesAbdo ELhais
 
Algorithm And analysis Lecture 03& 04-time complexity.
 Algorithm And analysis Lecture 03& 04-time complexity. Algorithm And analysis Lecture 03& 04-time complexity.
Algorithm And analysis Lecture 03& 04-time complexity.Tariq Khan
 
An introduction to uml
An introduction to umlAn introduction to uml
An introduction to umlTony Huynh
 
Abdomen agudo de causas urologicas no traumaticas
Abdomen agudo de causas urologicas no traumaticasAbdomen agudo de causas urologicas no traumaticas
Abdomen agudo de causas urologicas no traumaticasimagenescastex
 

Andere mochten auch (8)

Chapter 10
Chapter 10Chapter 10
Chapter 10
 
Automation for masses or story of creation yet another automation framework ...
Automation for masses or story of creation yet another automation framework  ...Automation for masses or story of creation yet another automation framework  ...
Automation for masses or story of creation yet another automation framework ...
 
Muro estructural final
Muro estructural finalMuro estructural final
Muro estructural final
 
Basis for comparison programming languages
Basis for comparison programming languagesBasis for comparison programming languages
Basis for comparison programming languages
 
Algorithm And analysis Lecture 03& 04-time complexity.
 Algorithm And analysis Lecture 03& 04-time complexity. Algorithm And analysis Lecture 03& 04-time complexity.
Algorithm And analysis Lecture 03& 04-time complexity.
 
Correas agricolas
Correas agricolasCorreas agricolas
Correas agricolas
 
An introduction to uml
An introduction to umlAn introduction to uml
An introduction to uml
 
Abdomen agudo de causas urologicas no traumaticas
Abdomen agudo de causas urologicas no traumaticasAbdomen agudo de causas urologicas no traumaticas
Abdomen agudo de causas urologicas no traumaticas
 

Ähnlich wie Lect01 120922175045-phpapp01

Lecture 9 - DSA - Python Data Structures
Lecture 9 - DSA - Python Data StructuresLecture 9 - DSA - Python Data Structures
Lecture 9 - DSA - Python Data StructuresHaitham El-Ghareeb
 
Reference Domain Ontologies and Large Medical Language Models.pptx
Reference Domain Ontologies and Large Medical Language Models.pptxReference Domain Ontologies and Large Medical Language Models.pptx
Reference Domain Ontologies and Large Medical Language Models.pptxChimezie Ogbuji
 
Large Language Models Bootcamp
Large Language Models BootcampLarge Language Models Bootcamp
Large Language Models BootcampData Science Dojo
 
Discuss the differences in object-oriented (OO) programming languages.docx
Discuss the differences in object-oriented (OO) programming languages.docxDiscuss the differences in object-oriented (OO) programming languages.docx
Discuss the differences in object-oriented (OO) programming languages.docxwviola
 
Generative AI Masterclass - Model Risk Management.pptx
Generative AI Masterclass - Model Risk Management.pptxGenerative AI Masterclass - Model Risk Management.pptx
Generative AI Masterclass - Model Risk Management.pptxSri Ambati
 
Terminology management as fitness v.2 iti
Terminology management as fitness v.2 itiTerminology management as fitness v.2 iti
Terminology management as fitness v.2 itiITIRussia
 
Supporting software documentation with source code summarization
Supporting software documentation with source code summarization Supporting software documentation with source code summarization
Supporting software documentation with source code summarization Ra'Fat Al-Msie'deen
 
A NOVEL APPROACH OF CLASSIFICATION TECHNIQUES FOR CLIR
A NOVEL APPROACH OF CLASSIFICATION TECHNIQUES FOR CLIRA NOVEL APPROACH OF CLASSIFICATION TECHNIQUES FOR CLIR
A NOVEL APPROACH OF CLASSIFICATION TECHNIQUES FOR CLIRcscpconf
 
MODELS2013_MDHPCL_Presentation
MODELS2013_MDHPCL_PresentationMODELS2013_MDHPCL_Presentation
MODELS2013_MDHPCL_PresentationDionny Santiago
 
Crafting Your Customized Legal Mastery: A Guide to Building Your Private LLM
Crafting Your Customized Legal Mastery: A Guide to Building Your Private LLMCrafting Your Customized Legal Mastery: A Guide to Building Your Private LLM
Crafting Your Customized Legal Mastery: A Guide to Building Your Private LLMChristopherTHyatt
 
Plume - A Code Property Graph Extraction and Analysis Library
Plume - A Code Property Graph Extraction and Analysis LibraryPlume - A Code Property Graph Extraction and Analysis Library
Plume - A Code Property Graph Extraction and Analysis LibraryTigerGraph
 
FOSDEM 2013: Operating Systems Hot Topics
FOSDEM 2013: Operating Systems Hot TopicsFOSDEM 2013: Operating Systems Hot Topics
FOSDEM 2013: Operating Systems Hot TopicsMartin Děcký
 
Linked Data Driven Data Virtualization for Web-scale Integration
Linked Data Driven Data Virtualization for Web-scale IntegrationLinked Data Driven Data Virtualization for Web-scale Integration
Linked Data Driven Data Virtualization for Web-scale Integrationrumito
 
Knowledge Graphs and Generative AI_GraphSummit Minneapolis Sept 20.pptx
Knowledge Graphs and Generative AI_GraphSummit Minneapolis Sept 20.pptxKnowledge Graphs and Generative AI_GraphSummit Minneapolis Sept 20.pptx
Knowledge Graphs and Generative AI_GraphSummit Minneapolis Sept 20.pptxNeo4j
 
Towards Standardisation in User Interface Development: the UsiXML Contribution
Towards Standardisation in User Interface Development: the UsiXML ContributionTowards Standardisation in User Interface Development: the UsiXML Contribution
Towards Standardisation in User Interface Development: the UsiXML ContributionJean Vanderdonckt
 

Ähnlich wie Lect01 120922175045-phpapp01 (20)

Lecture 9 - DSA - Python Data Structures
Lecture 9 - DSA - Python Data StructuresLecture 9 - DSA - Python Data Structures
Lecture 9 - DSA - Python Data Structures
 
DSA-2012-Lect00
DSA-2012-Lect00DSA-2012-Lect00
DSA-2012-Lect00
 
DSA - Lecture 04
DSA - Lecture 04DSA - Lecture 04
DSA - Lecture 04
 
Reference Domain Ontologies and Large Medical Language Models.pptx
Reference Domain Ontologies and Large Medical Language Models.pptxReference Domain Ontologies and Large Medical Language Models.pptx
Reference Domain Ontologies and Large Medical Language Models.pptx
 
Large Language Models Bootcamp
Large Language Models BootcampLarge Language Models Bootcamp
Large Language Models Bootcamp
 
Discuss the differences in object-oriented (OO) programming languages.docx
Discuss the differences in object-oriented (OO) programming languages.docxDiscuss the differences in object-oriented (OO) programming languages.docx
Discuss the differences in object-oriented (OO) programming languages.docx
 
Generative AI Masterclass - Model Risk Management.pptx
Generative AI Masterclass - Model Risk Management.pptxGenerative AI Masterclass - Model Risk Management.pptx
Generative AI Masterclass - Model Risk Management.pptx
 
Workshop8 18 12 09 Ingles
Workshop8   18 12 09 InglesWorkshop8   18 12 09 Ingles
Workshop8 18 12 09 Ingles
 
Terminology management as fitness v.2 iti
Terminology management as fitness v.2 itiTerminology management as fitness v.2 iti
Terminology management as fitness v.2 iti
 
DSA - Lecture 03
DSA - Lecture 03DSA - Lecture 03
DSA - Lecture 03
 
Supporting software documentation with source code summarization
Supporting software documentation with source code summarization Supporting software documentation with source code summarization
Supporting software documentation with source code summarization
 
A NOVEL APPROACH OF CLASSIFICATION TECHNIQUES FOR CLIR
A NOVEL APPROACH OF CLASSIFICATION TECHNIQUES FOR CLIRA NOVEL APPROACH OF CLASSIFICATION TECHNIQUES FOR CLIR
A NOVEL APPROACH OF CLASSIFICATION TECHNIQUES FOR CLIR
 
MODELS2013_MDHPCL_Presentation
MODELS2013_MDHPCL_PresentationMODELS2013_MDHPCL_Presentation
MODELS2013_MDHPCL_Presentation
 
Poles position
Poles positionPoles position
Poles position
 
Crafting Your Customized Legal Mastery: A Guide to Building Your Private LLM
Crafting Your Customized Legal Mastery: A Guide to Building Your Private LLMCrafting Your Customized Legal Mastery: A Guide to Building Your Private LLM
Crafting Your Customized Legal Mastery: A Guide to Building Your Private LLM
 
Plume - A Code Property Graph Extraction and Analysis Library
Plume - A Code Property Graph Extraction and Analysis LibraryPlume - A Code Property Graph Extraction and Analysis Library
Plume - A Code Property Graph Extraction and Analysis Library
 
FOSDEM 2013: Operating Systems Hot Topics
FOSDEM 2013: Operating Systems Hot TopicsFOSDEM 2013: Operating Systems Hot Topics
FOSDEM 2013: Operating Systems Hot Topics
 
Linked Data Driven Data Virtualization for Web-scale Integration
Linked Data Driven Data Virtualization for Web-scale IntegrationLinked Data Driven Data Virtualization for Web-scale Integration
Linked Data Driven Data Virtualization for Web-scale Integration
 
Knowledge Graphs and Generative AI_GraphSummit Minneapolis Sept 20.pptx
Knowledge Graphs and Generative AI_GraphSummit Minneapolis Sept 20.pptxKnowledge Graphs and Generative AI_GraphSummit Minneapolis Sept 20.pptx
Knowledge Graphs and Generative AI_GraphSummit Minneapolis Sept 20.pptx
 
Towards Standardisation in User Interface Development: the UsiXML Contribution
Towards Standardisation in User Interface Development: the UsiXML ContributionTowards Standardisation in User Interface Development: the UsiXML Contribution
Towards Standardisation in User Interface Development: the UsiXML Contribution
 

Lect01 120922175045-phpapp01

  • 1. Programming Languages are Not the Same Dr.Haitham A. El-Ghareeb Information Systems Department Faculty of Computers and Information Sciences Mansoura University helghareeb@gmail.com September 23, 2012 Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 1 / 29
  • 2. Programming Languages Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 2 / 29
  • 3. Programming Languages used for controlling the behavior of a machine (often a computer). Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 2 / 29
  • 4. Programming Languages used for controlling the behavior of a machine (often a computer). programming languages conform to rules for syntax and semantics. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 2 / 29
  • 5. Programming Languages used for controlling the behavior of a machine (often a computer). programming languages conform to rules for syntax and semantics. There are thousands of programming languages and new ones are created every year. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 2 / 29
  • 6. Programming Languages used for controlling the behavior of a machine (often a computer). programming languages conform to rules for syntax and semantics. There are thousands of programming languages and new ones are created every year. Few languages ever become sufficiently popular that they are used by more than a few people Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 2 / 29
  • 7. Programming Languages used for controlling the behavior of a machine (often a computer). programming languages conform to rules for syntax and semantics. There are thousands of programming languages and new ones are created every year. Few languages ever become sufficiently popular that they are used by more than a few people professional programmers may use dozens of languages in a career. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 2 / 29
  • 8. Basis for Comparing Programming Languages 1 Object Orientation 2 Static vs. Dynamic Typing 3 Generic Classes 4 Inheritence 5 Feature Renaming 6 Method Overloading 7 Operator Overloading 8 Higher Order Functions & Lexical Closures 9 Garbage Collection Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 3 / 29
  • 9. Basis for Comparing Programming Languages (Cont.) 10 Uniform Access 11 Class Variables/Methods 12 Reflection 13 Access Control 14 Design by Contract 15 Multithreading 16 Regular Expressions 17 Pointer Arithmetic 18 Language Integration 19 Built-In Security Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 4 / 29
  • 10. Object Orientation There are several qualities for Object Oriented Languages: Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 5 / 29
  • 11. Object Orientation There are several qualities for Object Oriented Languages: Encapsulation / Information Hiding Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 5 / 29
  • 12. Object Orientation There are several qualities for Object Oriented Languages: Encapsulation / Information Hiding Inheritance Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 5 / 29
  • 13. Object Orientation There are several qualities for Object Oriented Languages: Encapsulation / Information Hiding Inheritance Polymorphism/Dynamic Binding Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 5 / 29
  • 14. Object Orientation There are several qualities for Object Oriented Languages: Encapsulation / Information Hiding Inheritance Polymorphism/Dynamic Binding All pre-defined types are Objects Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 5 / 29
  • 15. Object Orientation There are several qualities for Object Oriented Languages: Encapsulation / Information Hiding Inheritance Polymorphism/Dynamic Binding All pre-defined types are Objects All operations performed by sending messages to Objects Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 5 / 29
  • 16. Object Orientation There are several qualities for Object Oriented Languages: Encapsulation / Information Hiding Inheritance Polymorphism/Dynamic Binding All pre-defined types are Objects All operations performed by sending messages to Objects All user-defined types are Objects Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 5 / 29
  • 17. Static vs. Dynamic Typing Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 6 / 29
  • 18. Static vs. Dynamic Typing The debate between static and dynamic typing has raged in Object-Oriented circles for many years with no clear conclusion. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 6 / 29
  • 19. Static vs. Dynamic Typing The debate between static and dynamic typing has raged in Object-Oriented circles for many years with no clear conclusion. Proponents of dynamic typing contend that it is more flexible and allows for increased productivity. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 6 / 29
  • 20. Static vs. Dynamic Typing The debate between static and dynamic typing has raged in Object-Oriented circles for many years with no clear conclusion. Proponents of dynamic typing contend that it is more flexible and allows for increased productivity. Those who prefer static typing argue that it enforces safer, more reliable code, and increases efficiency of the resulting product. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 6 / 29
  • 21. Static vs. Dynamic Typing The debate between static and dynamic typing has raged in Object-Oriented circles for many years with no clear conclusion. Proponents of dynamic typing contend that it is more flexible and allows for increased productivity. Those who prefer static typing argue that it enforces safer, more reliable code, and increases efficiency of the resulting product. A dynamic type system doesnt require variables to be declared as a spe- cific type. Any variable can contain any value or object. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 6 / 29
  • 22. Static vs. Dynamic Typing The debate between static and dynamic typing has raged in Object-Oriented circles for many years with no clear conclusion. Proponents of dynamic typing contend that it is more flexible and allows for increased productivity. Those who prefer static typing argue that it enforces safer, more reliable code, and increases efficiency of the resulting product. A dynamic type system doesnt require variables to be declared as a spe- cific type. Any variable can contain any value or object. Statically-typed languages require that all variables are declared with a specific type. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 6 / 29
  • 23. Generic Classes Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 7 / 29
  • 24. Generic Classes refer to the ability to parameterize a class with specific data types. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 7 / 29
  • 25. Generic Classes refer to the ability to parameterize a class with specific data types. A common example is a stack class that is parameterized by the type of elements it contains. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 7 / 29
  • 26. Generic Classes refer to the ability to parameterize a class with specific data types. A common example is a stack class that is parameterized by the type of elements it contains. it allows statically typed languages to retain their compile-time type safety Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 7 / 29
  • 27. Generic Classes refer to the ability to parameterize a class with specific data types. A common example is a stack class that is parameterized by the type of elements it contains. it allows statically typed languages to retain their compile-time type safety Dynamically typed languages do not need parameterized types in order to support generic programming Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 7 / 29
  • 28. Inheritence Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 8 / 29
  • 29. Inheritence the ability for a class or object to be defined as an extension or specialization of another class or object. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 8 / 29
  • 30. Inheritence the ability for a class or object to be defined as an extension or specialization of another class or object. Most object-oriented languages support class-based inheritance Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 8 / 29
  • 31. Inheritence the ability for a class or object to be defined as an extension or specialization of another class or object. Most object-oriented languages support class-based inheritance others such as SELF and JavaScript support object-based inheritance Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 8 / 29
  • 32. Inheritence the ability for a class or object to be defined as an extension or specialization of another class or object. Most object-oriented languages support class-based inheritance others such as SELF and JavaScript support object-based inheritance A few languages, notably Python and Ruby, support both class- and object-based inheritance, in which a class can inherit from another class and individual objects can be extended at run time Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 8 / 29
  • 33. Inheritence the ability for a class or object to be defined as an extension or specialization of another class or object. Most object-oriented languages support class-based inheritance others such as SELF and JavaScript support object-based inheritance A few languages, notably Python and Ruby, support both class- and object-based inheritance, in which a class can inherit from another class and individual objects can be extended at run time Though there are identified and classified as many as 17 different forms of inheritance. Even so, most languages provide only a few syntactic constructs for inheritance Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 8 / 29
  • 34. Inheritence the ability for a class or object to be defined as an extension or specialization of another class or object. Most object-oriented languages support class-based inheritance others such as SELF and JavaScript support object-based inheritance A few languages, notably Python and Ruby, support both class- and object-based inheritance, in which a class can inherit from another class and individual objects can be extended at run time Though there are identified and classified as many as 17 different forms of inheritance. Even so, most languages provide only a few syntactic constructs for inheritance Multiple Inheritence Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 8 / 29
  • 35. Feature Renaming Feature renaming is the ability for a class or object to rename one of its features (a term used to collectively refer to attributes and methods) that it inherited from a super class. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 9 / 29
  • 36. Method Overloading Method overloading (also referred to as parametric polymorphism) is the ability for a class, module, or other scope to have two or more methods with the same name. Calls to these methods are disambiguated by the number and/or type of arguments passed to the method at the call site. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 10 / 29
  • 37. Operator Overloading ability for a programmer to define an operator (such as +, or *) for user-defined types. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 11 / 29
  • 38. Higher Order Functions and Lexical Closures Higher Order Functions: functions that can be treated as if they were data objects. they can be bound to variables (including the ability to be stored in collections) can be passed to other functions as parameters can be returned as the result of other functions Lexical Closure: bundling up the lexical (static) scope surrounding the function with the function itself, so that the function carries its surrounding environment around with it wherever it may be used. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 12 / 29
  • 39. Garbage Collection mechanism allowing a language implementation to free memory of unused objects on behalf of the programmer Reference Counting Mark and Sweep Generational Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 13 / 29
  • 40. Uniform Access All services offered by a mod- ule should be available through a uniform notation, which does not betray whether they are implemented through storage or through computation. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 14 / 29
  • 41. Class Variables/Methods Class variables and methods are owned by a class, and not any particular instance of a class. This means that for however many instances of a class exist at any given point in time, only one copy of each class variable/method exists and is shared by every instance of the class. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 15 / 29
  • 42. Reflection ability for a program to determine various pieces of information about an object at run-time. Most object-oriented languages support some form of reflection. This includes the ability to determine: the type of the object, its inheritance structure, and the methods it contains, including the number and types of parameters and return types. It might also include the ability for determining the names and types of attributes of the object. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 16 / 29
  • 43. Access Control ability for a modules implementation to remain hidden behind its public interface. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 17 / 29
  • 44. Design by Contract Design by Contract (DBC) is the ability to incorporate important aspects of a specification into the software that is implementing it. The most important features of DBC are: Pre-conditions, which are conditions that must be true before a method is invoked Post-conditions, which are conditions guaranteed to be true after the invocation of a method Invariants, which are conditions guaranteed to be true at any stable point during the lifetime of an object Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 18 / 29
  • 45. Multithreading ability for a single process to process two or more tasks concurrently. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 19 / 29
  • 46. Regular Expressions pattern matching constructs capable of recognizing the class of languages known as regular languages. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 20 / 29
  • 47. Pointer Arithmetic ability for a language to directly manipulate memory addresses and their contents. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 21 / 29
  • 48. Language Integration It is important for a high level language (particularly interpreted languages) to be able to integrate seamlessly with other languages. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 22 / 29
  • 49. Built-In Security language implementations ability to determine whether or not a piece of code comes from a trusted source (such as the users hard disk), limiting the permissions of the code if it does not. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 23 / 29
  • 50. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 24 / 29
  • 51. Quick Tour of C# Brief Overview Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 25 / 29
  • 52. Namespaces namespace Data Structur es . Professor { class Haitham { ... } } Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 26 / 29
  • 53. Classes public class Haitham : Professor , IBlogger , IMozillaReMo { public string name ; public Haitham ( string name ) { this . name = name ; // more fields and methods here } Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 27 / 29
  • 54. Attributes class P r o f e s s o r H a i t h a m { //... [ Secre tOverri de ( ” . . . ” ) ] public void Teach ( Subjects ← d a t a s t ru c t u r e s 2 0 1 2 ) { //... } } Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 28 / 29
  • 55. Interfaces interface IMozillaReMo { IBrowser F a v o u r i te B r o w s e r { get ; s e t ; } void Browse ( ) ; } Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 29 / 29
  • 56. Enums enum CoursesITeach { DataStructuresAndAlgorithms , SystemAnalysisAndDesign , ResearchMethodologies , DataBase } Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 30 / 29
  • 57. Struct struct Faculty { public float name ; public Faculty ( String name ) { //... } } Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 31 / 29
  • 58. Methods class Haitham { //... public void GoToLecture ( string LectureName ) { Point location = this . targe tDataba se . Find ( targetName ) ; this . FlyToLocation ( location ) ; } } Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 32 / 29
  • 59. Virtual and Override Methods class GiantRobot { //... public virtual void TravelTo ( Point destination ) { this . TurnTowards ( destination ) ; w h i l e ( this . Location != destination ) { this . Trudge ( ) ; } } } class FlyingRobot : GiantRobot { //... public override void TravelTo ( Point destination ) { i f ( this . WingState == WingState . Operational ) { this . FlyTo ( destination ) ; // whee ! } else { base . TravelTo ( destination ) ; // oh well . . . } } } Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 33 / 29
  • 60. Methods class Haitham { //... public void GoToLecture ( string LectureName ) { Point location = this . targe tDataba se . Find ( targetName ) ; this . FlyToLocation ( location ) ; } } Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 23, 2012 34 / 29