SlideShare a Scribd company logo
PRINCIPLES OF PROGRAMMING LANGUAGES
GENERAL COMPARISON
Language C C++ Java UNIX Perl
Intended use Application,
system,general
purpose, low-
level operations
Application,
system
Application,
business, client-
side, general,
server-side, Web
File
manipulation,print
-ing text Application,
scripting, text
processing, Web
Imperative Yes Yes Yes No Yes
Object
oriented
No Yes Yes No Yes
Functional No Yes No No Yes
Procedural Yes Yes No No Yes
Standardized
?
1989, ANSI
C89,ISO
C90,ISO
C99,ISO C11
1998, ISO/IEC
1998, ISO/IEC
2003, ISO/IEC
2011
De facto
standard via
Java Language
Specification
Filesystem
Hierarchy
Standard,
POSIX standard
No
EVOLUTION
Language Developer Year Derived from
UNIX
Ken Thompson,
Dennis Ritchie,
Douglas McIlroy,
and Joe Ossanna.
1969 Multics
C Dennis Ritchie 1972 B
C++ Bjarne Stroustrup 1979 C
Perl Larry Wall 1987 C
Java James Gosling 1991 C++
LANGUAGE EVALUATION
CRITERIA
READABILITY
Language
Characteristic
SIMPLICITY
Illustration
C Feature multiplicity x++;
++x;
x = x+1;
x += 1;
C++ Feature multiplicity
Operator overloading
operator+
(addition & string
concatenation)
Java Feature multiplicity
x++;
++x;
x = x+1;
x += 1;Perl Feature multiplicity
UNIX feature multiplicity
No operator overloading
$x++;
$(++x)
x = $x+1
$x += 1
Language
Characteristic
ORTHOGONALITY
C Non orthogonal
C++ Non orthogonal
Java Non orthogonal
Perl Non orthogonal
UNIX Orthogonal
Language
Characteristic
CONCISE DATATYPES
Illustration
C Truth value by some other
data type
No boolean data type
int flag =1;
C++ Boolean data type bool flag =true;
Java Boolean data type boolean flag=false;
Perl No boolean data type $flag=1;
UNIX No boolean data type flag=1
Language Characteristic
SYNTAX DESIGN
Illustration
C
Compound statements
Curly braces used.
Form & meaning
Meaning of static depends
on context
C++ Understandable if C is
known
Java Understandable if C/C++is
known
Perl Compound statements
Curly braces used.
Form & meaning
Prior knowledge is required
Eg:split,shift,unshift etc
UNIX No curly braces
Prior knowledge is required
for var in 0 1 2 3 4 5 6 7 8
do
echo $var
done
Eg:grep
WRITABILITY
Language
Characteristic
SUPPORT FOR
ABSTRACTION
Illustration
C
Supports abstraction
Returntype
func_name(parameters)
{
}
C++ modifier returnType
nameOfMethod (Parameter
List)
{ // method body }
Java
Perl Supports abstraction sub fun_name
{
}
UNIX Supports abstraction function name( )
{
}
Language
Characteristic
EXPRESSIVITY
Illustration
C
Shorthand operators
Shortcircuit operators
Loops
+=
&&
for loop
C++
Java
Perl
UNIX Shorthand operators
Shortcircuit operators
Loops
++
&&
for loop
RELIABILITY
Language
Characteristic
TYPE CHECKING
Illustration
C Strongly typed int a=5;
C++ Strongly typed int a=5;
Java Strongly typed int a=5;
Perl Loosely typed
Runtime
$a=5;
$a=“hii”;
UNIX Loosely typed
Runtime
a=5;
Language Characteristic
EXCEPTION HANDLING
Illustration
C No exception handling
C++ Exception handling exists try
{
// protected code
}catch( ExceptionName e )
{
// code to handle
ExceptionName exception
}
Java Exception handling exists try { //Protected code }
catch(ExceptionType1 e1) {
//}
finally { //The finally block
always executes. }
Perl
Exception handling exists chdir('/etc') or warn "Can't
change directory";
chdir('/etc') or die "Can't
change directory";
UNIX No exception handling
Language
Characteristic
ALIASING
Illustration
C Aliasing using pointers int A[10];
int *p= A;
C++ Aliasing using reference
variables
float total=100;
float &sum=total;
Java
Aliasing using object
references
Square box1 = new Square
(0, 0, 100, 200);
Square box2 = box1;
Perl Aliasing using reference
variables
$r=@arr;
UNIX Giving a name for a
command
alias dir=ls
BINDING
Language Type binding Storage binding
C Static binding
int a;
Local variables are stack
dynamic by default.
Static variables are
declared using keyword
static
Explicit heap dynamic
variables using malloc()
C++ Static binding
int a;
Local variables are stack
dynamic by default.
Static variables are
declared using keyword
static
Explicit heap dynamic
variables using new
Java
language Type binding Storage Binding
Perl Dynamic binding
$a=5;
implicit declarations and
explicit declarations with
static scoping, lots of heap
bindings (for strings, arrays,
etc.), run-time memory
manager does garbage
collection, implicit allocation
and de-allocation
UNIX Dynamic binding
a=5
Local variables are stack
dynamic by default.
DATA TYPES
Language Primitive Derived User defined
C int, float, char,
double, void
pointer,function,
array,structure,
union
structure, union,
enum, typedef
C++ void,char,int,float,
double,bool
Array,
function,pointer,
reference
structure, union,
enum, typedef,
class
Java int, float, long,
double, char
,boolean,short,byte
Array,
function,pointer,
reference
structure, union,
enum, typedef,
class,sequence
Perl Scalar, hash, array function No user defined
datatypes
UNIX No primitive
datatypes
Array,function No user defined
datatypes
VARIABLES & CONSTANTS
VARIABLE & CONSTANT DECLARATION
LANGUAGE VARIABLE CONSTANT TYPE SYNONYM
C
type name «= initial
value»;
enum{ name = value }; typedef type synonym;
C++
type name «= initial
value»;
const type name = value;
typedef type synonym;
Java
type name
«= initial_value»;
final type name = value; NA
UNIX
name=initial_value NAME ="Zara Ali"
readonly NAME
NA
Perl
«my» $name
«= initial_value»;
use
constant name => value;
NA
SCOPE
LANGUAGE SCOPE
C Static scoping
C++ Static scoping
Java Static scoping
UNIX Static scoping
Perl Static scoping
ASSIGNMENT STATEMENTS
LANGUAGE ASSIGNMENT
C
c = a;
a = a + b;
a+ = b;
C++
Java
UNIX a=$b
Perl $a=$b;
ARITHMETIC EXPRESSIONS
LANGUAGE ARITHMETIC EXPRESSIONS
C
c = a + b;
c = a - b;
c = a * b;
c = a / b;
c = a % b;
c = a++;
c = a--;
C++
Java
UNIX
val=`expr $a + $b`
val=`expr $a - $b`
val=`expr $a * $b`
Perl
$c = $a + $b;
$c = $a - $b;
$c = $a * $b;
$c = $a / $b;
$c = $a % $b;
$c = $a ** $b;
CONTROL FLOW
CONDITIONAL STATEMENTS
Language if else if case conditional
operator
C if (condition)
{instructions}
«else
{instructions}»
if (condition)
{instructions}
else if
(condition)
{instructions}
...
«else
{instructions}»
switch
(variable)
{case case1: in
structions
«break;»
...
«default: instru
ctions»}
condition?
valueIfTrue :
valueIfFalse
C++
Java
UNIX if condition-
then
expression
«else
expression»
fi
if condition-
then
expression
elif condition-
then
expression
«else
expression»
fi
case "$variable
" in
"$condition1" )
command;;
"$condition2" )
command;;
esac
Language If Else if Case
Conditional
operator
Perl if (condition)
{instructions}
«else
{instructions}»
or
unless (not
condition)
{instructions}
«else
{instructions}»
if (condition)
{instructions}
elsif (condition)
{instructions}
...
«else
{instructions}»
or
unless
(notcondition)
{instructions}
elsif (condition)
{instructions}
...
«else
{instructions}»
use feature
"switch";
...
given (variable)
{when (case1)
{ instructions }
...
«default
{ instructions }»}
condition?
valueIfTrue :
valueIf-
False
LOOP STATEMENTS
Language while Do while For foreach
C
while
(condition) {instructi
ons }
do { instructions }
while (condition)
for («type»
i = first; i <= last;
++i) { instructions }
NA
C++ «std::»
for_each(start,end,f
unction)
Java for (type item : set)
{instructions }
UNIX while [condition
] do
Instructions
done
or
until [notconditi
on] do
Instructions
done
NA for
((i = first; i <= last;
++i))
do
Instructions
done
for item in set
do
Instructions
done
Language While Do while For foreach
Perl
while (condition)
{instructions }
or
until
(notcondition) {instru
ctions }
do { instructions }
while (condition)
or
do { instructions }
until (notcondition)
for«each»
«$i»(first ..last)
{instructions }
or
for ($i = first; $i
<= last; $i++)
{instructions }
for«each»
«$item» (set)
{instructions }
OTHER CONTROL FLOW STATEMENTS
Language Exit
block(break)
Continue Label Branch(goto)
C break; continue; label: goto label;
C++ break; continue; label:
goto label;
Java break «label»; continue «label»; label: NA
UNIX
break «levels»; continue «levels»; NA NA
Perl last «label»; next «label»; label: goto label;

More Related Content

What's hot

Programming basics
Programming basicsProgramming basics
Programming basics
246paa
 
Storage classes
Storage classesStorage classes
Storage classes
priyanka jain
 
1 introduction to c program
1 introduction to c program1 introduction to c program
1 introduction to c program
NishmaNJ
 
Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4
Ismar Silveira
 
Storage classes in c language
Storage classes in c languageStorage classes in c language
Storage classes in c language
tanmaymodi4
 
Extending Python - EuroPython 2014
Extending Python - EuroPython 2014Extending Python - EuroPython 2014
Extending Python - EuroPython 2014
fcofdezc
 
Storage classes
Storage classesStorage classes
Storage classes
Puneet Rajput
 
lFuzzer - Learning Input Tokens for Effective Fuzzing
lFuzzer - Learning Input Tokens for Effective FuzzinglFuzzer - Learning Input Tokens for Effective Fuzzing
lFuzzer - Learning Input Tokens for Effective Fuzzing
Björn Mathis
 
TDD in C - Recently Used List Kata
TDD in C - Recently Used List KataTDD in C - Recently Used List Kata
TDD in C - Recently Used List Kata
Olve Maudal
 
Ooabapnoteswithprogram good 78
Ooabapnoteswithprogram good 78Ooabapnoteswithprogram good 78
Ooabapnoteswithprogram good 78
Yogesh Mehra
 
[C++ korea] effective modern c++ study item 3 understand decltype +이동우
[C++ korea] effective modern c++ study   item 3 understand decltype +이동우[C++ korea] effective modern c++ study   item 3 understand decltype +이동우
[C++ korea] effective modern c++ study item 3 understand decltype +이동우
Seok-joon Yun
 
Storage classes
Storage classesStorage classes
Storage classes
Leela Koneru
 
1 introducing c language
1  introducing c language1  introducing c language
1 introducing c language
MomenMostafa
 
Loops in c language
Loops in c languageLoops in c language
Loops in c language
tanmaymodi4
 
Storage classes
Storage classesStorage classes
Storage classes
Praveen M Jigajinni
 

What's hot (20)

Programming basics
Programming basicsProgramming basics
Programming basics
 
Storage classes
Storage classesStorage classes
Storage classes
 
1 introduction to c program
1 introduction to c program1 introduction to c program
1 introduction to c program
 
RAII and ScopeGuard
RAII and ScopeGuardRAII and ScopeGuard
RAII and ScopeGuard
 
Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4
 
Storage classes in c language
Storage classes in c languageStorage classes in c language
Storage classes in c language
 
Extending Python - EuroPython 2014
Extending Python - EuroPython 2014Extending Python - EuroPython 2014
Extending Python - EuroPython 2014
 
Storage class in C Language
Storage class in C LanguageStorage class in C Language
Storage class in C Language
 
Storage classes
Storage classesStorage classes
Storage classes
 
lFuzzer - Learning Input Tokens for Effective Fuzzing
lFuzzer - Learning Input Tokens for Effective FuzzinglFuzzer - Learning Input Tokens for Effective Fuzzing
lFuzzer - Learning Input Tokens for Effective Fuzzing
 
TDD in C - Recently Used List Kata
TDD in C - Recently Used List KataTDD in C - Recently Used List Kata
TDD in C - Recently Used List Kata
 
Ooabapnoteswithprogram good 78
Ooabapnoteswithprogram good 78Ooabapnoteswithprogram good 78
Ooabapnoteswithprogram good 78
 
First c program
First c programFirst c program
First c program
 
[C++ korea] effective modern c++ study item 3 understand decltype +이동우
[C++ korea] effective modern c++ study   item 3 understand decltype +이동우[C++ korea] effective modern c++ study   item 3 understand decltype +이동우
[C++ korea] effective modern c++ study item 3 understand decltype +이동우
 
Storage classes
Storage classesStorage classes
Storage classes
 
1 introducing c language
1  introducing c language1  introducing c language
1 introducing c language
 
Lecture03
Lecture03Lecture03
Lecture03
 
Loops in c language
Loops in c languageLoops in c language
Loops in c language
 
Storage classes
Storage classesStorage classes
Storage classes
 
Cprogramcontrolifelseselection3
Cprogramcontrolifelseselection3Cprogramcontrolifelseselection3
Cprogramcontrolifelseselection3
 

Viewers also liked

Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming languageVasavi College of Engg
 
Principles of programming languages. Detail notes
Principles of programming languages. Detail notesPrinciples of programming languages. Detail notes
Principles of programming languages. Detail notes
VIKAS SINGH BHADOURIA
 
Object Oriented Programming Languages
Object Oriented Programming LanguagesObject Oriented Programming Languages
Object Oriented Programming Languages
Mannu Khani
 
Soho routers: swords and shields CyberCamp 2015
Soho routers: swords and shields   CyberCamp 2015Soho routers: swords and shields   CyberCamp 2015
Soho routers: swords and shields CyberCamp 2015
Iván Sanz de Castro
 
Zero interest consumer goods purchase schemes
Zero interest consumer goods purchase schemesZero interest consumer goods purchase schemes
Zero interest consumer goods purchase schemesChinni Harshith
 
Adam Bolton - IDinLondon Conference slides
Adam Bolton - IDinLondon Conference slidesAdam Bolton - IDinLondon Conference slides
Adam Bolton - IDinLondon Conference slides
Adam Bolton
 
CV Workshop - IDinLondon - 11th November 2014, Adam Bolton.
CV Workshop - IDinLondon - 11th November 2014, Adam Bolton.CV Workshop - IDinLondon - 11th November 2014, Adam Bolton.
CV Workshop - IDinLondon - 11th November 2014, Adam Bolton.
Adam Bolton
 
Barack obama
Barack obamaBarack obama
Barack obama
hiiamgerald
 
role model entrepreneur
role model entrepreneurrole model entrepreneur
role model entrepreneur
adrifadhlihsuma
 
Avon product analysis 2009
Avon product analysis 2009Avon product analysis 2009
Avon product analysis 2009
adrifadhlihsuma
 
что это с точки зрения бухгалтеского учёта
что это с точки зрения бухгалтеского учётачто это с точки зрения бухгалтеского учёта
что это с точки зрения бухгалтеского учёта
feniks2007
 
maths
mathsmaths
Ica job guarantee institute of Accounting and Tally
Ica job guarantee institute of Accounting and TallyIca job guarantee institute of Accounting and Tally
Ica job guarantee institute of Accounting and Tallyjyotizaware1
 
Hacking Web: Attacks & Tips
Hacking Web: Attacks & TipsHacking Web: Attacks & Tips
Hacking Web: Attacks & Tips
Iván Sanz de Castro
 
Goyal_cv
Goyal_cvGoyal_cv
Goyal_cv
Pulkit Goyal
 
Satyanarayana g y
Satyanarayana g ySatyanarayana g y
Satyanarayana g y
Satyanarayana Yogachar
 
Rakesh_Resume_July_2016
Rakesh_Resume_July_2016Rakesh_Resume_July_2016
Rakesh_Resume_July_2016pdrakesh
 

Viewers also liked (20)

Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
 
Principles of programming languages. Detail notes
Principles of programming languages. Detail notesPrinciples of programming languages. Detail notes
Principles of programming languages. Detail notes
 
Object Oriented Programming Languages
Object Oriented Programming LanguagesObject Oriented Programming Languages
Object Oriented Programming Languages
 
Soho routers: swords and shields CyberCamp 2015
Soho routers: swords and shields   CyberCamp 2015Soho routers: swords and shields   CyberCamp 2015
Soho routers: swords and shields CyberCamp 2015
 
Zero interest consumer goods purchase schemes
Zero interest consumer goods purchase schemesZero interest consumer goods purchase schemes
Zero interest consumer goods purchase schemes
 
Adam Bolton - IDinLondon Conference slides
Adam Bolton - IDinLondon Conference slidesAdam Bolton - IDinLondon Conference slides
Adam Bolton - IDinLondon Conference slides
 
CV Workshop - IDinLondon - 11th November 2014, Adam Bolton.
CV Workshop - IDinLondon - 11th November 2014, Adam Bolton.CV Workshop - IDinLondon - 11th November 2014, Adam Bolton.
CV Workshop - IDinLondon - 11th November 2014, Adam Bolton.
 
Barack obama
Barack obamaBarack obama
Barack obama
 
cv
cvcv
cv
 
role model entrepreneur
role model entrepreneurrole model entrepreneur
role model entrepreneur
 
Avon product analysis 2009
Avon product analysis 2009Avon product analysis 2009
Avon product analysis 2009
 
что это с точки зрения бухгалтеского учёта
что это с точки зрения бухгалтеского учётачто это с точки зрения бухгалтеского учёта
что это с точки зрения бухгалтеского учёта
 
P (2)
P (2)P (2)
P (2)
 
P (2)
P (2)P (2)
P (2)
 
maths
mathsmaths
maths
 
Ica job guarantee institute of Accounting and Tally
Ica job guarantee institute of Accounting and TallyIca job guarantee institute of Accounting and Tally
Ica job guarantee institute of Accounting and Tally
 
Hacking Web: Attacks & Tips
Hacking Web: Attacks & TipsHacking Web: Attacks & Tips
Hacking Web: Attacks & Tips
 
Goyal_cv
Goyal_cvGoyal_cv
Goyal_cv
 
Satyanarayana g y
Satyanarayana g ySatyanarayana g y
Satyanarayana g y
 
Rakesh_Resume_July_2016
Rakesh_Resume_July_2016Rakesh_Resume_July_2016
Rakesh_Resume_July_2016
 

Similar to principles of programming languages

Reduce course notes class xii
Reduce course notes class xiiReduce course notes class xii
Reduce course notes class xii
Syed Zaid Irshad
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programmingAlpana Gupta
 
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Chris Adamson
 
Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++
Rasan Samarasinghe
 
Storage classes in c++
Storage classes in c++Storage classes in c++
Storage classes in c++
Jaspal Singh
 
Java Intro
Java IntroJava Intro
Java Introbackdoor
 
Best Practices for Quality Code
Best Practices for Quality CodeBest Practices for Quality Code
Best Practices for Quality Code
Sercan Degirmenci
 
Perl training-in-navi mumbai
Perl training-in-navi mumbaiPerl training-in-navi mumbai
Perl training-in-navi mumbai
vibrantuser
 
cppt-170218053903 (1).pptx
cppt-170218053903 (1).pptxcppt-170218053903 (1).pptx
cppt-170218053903 (1).pptx
WatchDog13
 
Polyglot Programming in the JVM
Polyglot Programming in the JVMPolyglot Programming in the JVM
Polyglot Programming in the JVMAndres Almiray
 
C++ theory
C++ theoryC++ theory
C++ theory
Shyam Khant
 
CPP-overviews notes variable data types notes
CPP-overviews notes variable data types notesCPP-overviews notes variable data types notes
CPP-overviews notes variable data types notes
SukhpreetSingh519414
 
C Basics
C BasicsC Basics
C Basics
Sunil OS
 
C++ Programming Club-Lecture 1
C++ Programming Club-Lecture 1C++ Programming Club-Lecture 1
C++ Programming Club-Lecture 1
Ammara Javed
 
Kotlin fundamentals - By: Ipan Ardian
Kotlin fundamentals - By: Ipan ArdianKotlin fundamentals - By: Ipan Ardian
Kotlin fundamentals - By: Ipan Ardian
Rizal Khilman
 
Kotlin Fundamentals
Kotlin Fundamentals Kotlin Fundamentals
Kotlin Fundamentals
Ipan Ardian
 
Polyglot Programming @ Jax.de 2010
Polyglot Programming @ Jax.de 2010Polyglot Programming @ Jax.de 2010
Polyglot Programming @ Jax.de 2010Andres Almiray
 
Mastering Namespaces in PHP
Mastering Namespaces in PHPMastering Namespaces in PHP
Mastering Namespaces in PHP
Nick Belhomme
 

Similar to principles of programming languages (20)

Reduce course notes class xii
Reduce course notes class xiiReduce course notes class xii
Reduce course notes class xii
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
 
Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++
 
Storage classes in c++
Storage classes in c++Storage classes in c++
Storage classes in c++
 
Java Intro
Java IntroJava Intro
Java Intro
 
Best Practices for Quality Code
Best Practices for Quality CodeBest Practices for Quality Code
Best Practices for Quality Code
 
Perl training-in-navi mumbai
Perl training-in-navi mumbaiPerl training-in-navi mumbai
Perl training-in-navi mumbai
 
cppt-170218053903 (1).pptx
cppt-170218053903 (1).pptxcppt-170218053903 (1).pptx
cppt-170218053903 (1).pptx
 
Polyglot Programming in the JVM
Polyglot Programming in the JVMPolyglot Programming in the JVM
Polyglot Programming in the JVM
 
C++ theory
C++ theoryC++ theory
C++ theory
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
CPP-overviews notes variable data types notes
CPP-overviews notes variable data types notesCPP-overviews notes variable data types notes
CPP-overviews notes variable data types notes
 
C Basics
C BasicsC Basics
C Basics
 
C++ Programming Club-Lecture 1
C++ Programming Club-Lecture 1C++ Programming Club-Lecture 1
C++ Programming Club-Lecture 1
 
C Tutorials
C TutorialsC Tutorials
C Tutorials
 
Kotlin fundamentals - By: Ipan Ardian
Kotlin fundamentals - By: Ipan ArdianKotlin fundamentals - By: Ipan Ardian
Kotlin fundamentals - By: Ipan Ardian
 
Kotlin Fundamentals
Kotlin Fundamentals Kotlin Fundamentals
Kotlin Fundamentals
 
Polyglot Programming @ Jax.de 2010
Polyglot Programming @ Jax.de 2010Polyglot Programming @ Jax.de 2010
Polyglot Programming @ Jax.de 2010
 
Mastering Namespaces in PHP
Mastering Namespaces in PHPMastering Namespaces in PHP
Mastering Namespaces in PHP
 

Recently uploaded

Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 

Recently uploaded (20)

Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 

principles of programming languages

  • 3. Language C C++ Java UNIX Perl Intended use Application, system,general purpose, low- level operations Application, system Application, business, client- side, general, server-side, Web File manipulation,print -ing text Application, scripting, text processing, Web Imperative Yes Yes Yes No Yes Object oriented No Yes Yes No Yes Functional No Yes No No Yes Procedural Yes Yes No No Yes Standardized ? 1989, ANSI C89,ISO C90,ISO C99,ISO C11 1998, ISO/IEC 1998, ISO/IEC 2003, ISO/IEC 2011 De facto standard via Java Language Specification Filesystem Hierarchy Standard, POSIX standard No
  • 5. Language Developer Year Derived from UNIX Ken Thompson, Dennis Ritchie, Douglas McIlroy, and Joe Ossanna. 1969 Multics C Dennis Ritchie 1972 B C++ Bjarne Stroustrup 1979 C Perl Larry Wall 1987 C Java James Gosling 1991 C++
  • 7. READABILITY Language Characteristic SIMPLICITY Illustration C Feature multiplicity x++; ++x; x = x+1; x += 1; C++ Feature multiplicity Operator overloading operator+ (addition & string concatenation) Java Feature multiplicity x++; ++x; x = x+1; x += 1;Perl Feature multiplicity UNIX feature multiplicity No operator overloading $x++; $(++x) x = $x+1 $x += 1
  • 8. Language Characteristic ORTHOGONALITY C Non orthogonal C++ Non orthogonal Java Non orthogonal Perl Non orthogonal UNIX Orthogonal
  • 9. Language Characteristic CONCISE DATATYPES Illustration C Truth value by some other data type No boolean data type int flag =1; C++ Boolean data type bool flag =true; Java Boolean data type boolean flag=false; Perl No boolean data type $flag=1; UNIX No boolean data type flag=1
  • 10. Language Characteristic SYNTAX DESIGN Illustration C Compound statements Curly braces used. Form & meaning Meaning of static depends on context C++ Understandable if C is known Java Understandable if C/C++is known Perl Compound statements Curly braces used. Form & meaning Prior knowledge is required Eg:split,shift,unshift etc UNIX No curly braces Prior knowledge is required for var in 0 1 2 3 4 5 6 7 8 do echo $var done Eg:grep
  • 11. WRITABILITY Language Characteristic SUPPORT FOR ABSTRACTION Illustration C Supports abstraction Returntype func_name(parameters) { } C++ modifier returnType nameOfMethod (Parameter List) { // method body } Java Perl Supports abstraction sub fun_name { } UNIX Supports abstraction function name( ) { }
  • 12. Language Characteristic EXPRESSIVITY Illustration C Shorthand operators Shortcircuit operators Loops += && for loop C++ Java Perl UNIX Shorthand operators Shortcircuit operators Loops ++ && for loop
  • 13. RELIABILITY Language Characteristic TYPE CHECKING Illustration C Strongly typed int a=5; C++ Strongly typed int a=5; Java Strongly typed int a=5; Perl Loosely typed Runtime $a=5; $a=“hii”; UNIX Loosely typed Runtime a=5;
  • 14. Language Characteristic EXCEPTION HANDLING Illustration C No exception handling C++ Exception handling exists try { // protected code }catch( ExceptionName e ) { // code to handle ExceptionName exception } Java Exception handling exists try { //Protected code } catch(ExceptionType1 e1) { //} finally { //The finally block always executes. } Perl Exception handling exists chdir('/etc') or warn "Can't change directory"; chdir('/etc') or die "Can't change directory"; UNIX No exception handling
  • 15. Language Characteristic ALIASING Illustration C Aliasing using pointers int A[10]; int *p= A; C++ Aliasing using reference variables float total=100; float &sum=total; Java Aliasing using object references Square box1 = new Square (0, 0, 100, 200); Square box2 = box1; Perl Aliasing using reference variables $r=@arr; UNIX Giving a name for a command alias dir=ls
  • 17. Language Type binding Storage binding C Static binding int a; Local variables are stack dynamic by default. Static variables are declared using keyword static Explicit heap dynamic variables using malloc() C++ Static binding int a; Local variables are stack dynamic by default. Static variables are declared using keyword static Explicit heap dynamic variables using new Java
  • 18. language Type binding Storage Binding Perl Dynamic binding $a=5; implicit declarations and explicit declarations with static scoping, lots of heap bindings (for strings, arrays, etc.), run-time memory manager does garbage collection, implicit allocation and de-allocation UNIX Dynamic binding a=5 Local variables are stack dynamic by default.
  • 20. Language Primitive Derived User defined C int, float, char, double, void pointer,function, array,structure, union structure, union, enum, typedef C++ void,char,int,float, double,bool Array, function,pointer, reference structure, union, enum, typedef, class Java int, float, long, double, char ,boolean,short,byte Array, function,pointer, reference structure, union, enum, typedef, class,sequence Perl Scalar, hash, array function No user defined datatypes UNIX No primitive datatypes Array,function No user defined datatypes
  • 22. VARIABLE & CONSTANT DECLARATION LANGUAGE VARIABLE CONSTANT TYPE SYNONYM C type name «= initial value»; enum{ name = value }; typedef type synonym; C++ type name «= initial value»; const type name = value; typedef type synonym; Java type name «= initial_value»; final type name = value; NA UNIX name=initial_value NAME ="Zara Ali" readonly NAME NA Perl «my» $name «= initial_value»; use constant name => value; NA
  • 23. SCOPE
  • 24. LANGUAGE SCOPE C Static scoping C++ Static scoping Java Static scoping UNIX Static scoping Perl Static scoping
  • 26. LANGUAGE ASSIGNMENT C c = a; a = a + b; a+ = b; C++ Java UNIX a=$b Perl $a=$b;
  • 28. LANGUAGE ARITHMETIC EXPRESSIONS C c = a + b; c = a - b; c = a * b; c = a / b; c = a % b; c = a++; c = a--; C++ Java UNIX val=`expr $a + $b` val=`expr $a - $b` val=`expr $a * $b` Perl $c = $a + $b; $c = $a - $b; $c = $a * $b; $c = $a / $b; $c = $a % $b; $c = $a ** $b;
  • 30. CONDITIONAL STATEMENTS Language if else if case conditional operator C if (condition) {instructions} «else {instructions}» if (condition) {instructions} else if (condition) {instructions} ... «else {instructions}» switch (variable) {case case1: in structions «break;» ... «default: instru ctions»} condition? valueIfTrue : valueIfFalse C++ Java UNIX if condition- then expression «else expression» fi if condition- then expression elif condition- then expression «else expression» fi case "$variable " in "$condition1" ) command;; "$condition2" ) command;; esac
  • 31. Language If Else if Case Conditional operator Perl if (condition) {instructions} «else {instructions}» or unless (not condition) {instructions} «else {instructions}» if (condition) {instructions} elsif (condition) {instructions} ... «else {instructions}» or unless (notcondition) {instructions} elsif (condition) {instructions} ... «else {instructions}» use feature "switch"; ... given (variable) {when (case1) { instructions } ... «default { instructions }»} condition? valueIfTrue : valueIf- False
  • 32. LOOP STATEMENTS Language while Do while For foreach C while (condition) {instructi ons } do { instructions } while (condition) for («type» i = first; i <= last; ++i) { instructions } NA C++ «std::» for_each(start,end,f unction) Java for (type item : set) {instructions } UNIX while [condition ] do Instructions done or until [notconditi on] do Instructions done NA for ((i = first; i <= last; ++i)) do Instructions done for item in set do Instructions done
  • 33. Language While Do while For foreach Perl while (condition) {instructions } or until (notcondition) {instru ctions } do { instructions } while (condition) or do { instructions } until (notcondition) for«each» «$i»(first ..last) {instructions } or for ($i = first; $i <= last; $i++) {instructions } for«each» «$item» (set) {instructions }
  • 34. OTHER CONTROL FLOW STATEMENTS Language Exit block(break) Continue Label Branch(goto) C break; continue; label: goto label; C++ break; continue; label: goto label; Java break «label»; continue «label»; label: NA UNIX break «levels»; continue «levels»; NA NA Perl last «label»; next «label»; label: goto label;