Beruflich Dokumente
Kultur Dokumente
Language
C++
Java
UNIX
Intended use
Application,
system,general
purpose, lowlevel
operations
Application,
system
Application,
business, clientside, general,
server-side,
Web
File
manipulation,print
-ing text
Perl
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
De facto
standard via
Java Language
Specification
Filesystem
Hierarchy
Standard,
POSIX
standard
No
Standardized
?
1989,ANSI
C89,ISO
C90,ISO
C99,ISO C11
1998, ISO/IEC
1998, ISO/IEC
2003, ISO/IEC
2011
EVOLUTION
Language
UNIX
Developer
Ken Thompson,
Dennis Ritchie,
Douglas McIlroy,
and Joe Ossanna.
Year
Derived from
1969
Multics
Dennis Ritchie
1972
C++
Bjarne Stroustrup
1979
Perl
Larry Wall
1987
Java
James Gosling
1991
C++
LANGUAGE EVALUATION
CRITERIA
READABILITY
Language
Characteristic
Illustration
SIMPLICITY
C
Feature multiplicity
x++;
++x;
x = x+1;
x += 1;
C++
Feature multiplicity
Operator overloading
operator+
(addition & string
concatenation)
Java
Feature multiplicity
Perl
Feature multiplicity
x++;
++x;
x = x+1;
x += 1;
UNIX
feature multiplicity
$x++;
Characteristic
Language
ORTHOGONALITY
Non orthogonal
C++
Non orthogonal
Java
Non orthogonal
Perl
Non orthogonal
UNIX
Orthogonal
Characteristic
Language
CONCISE DATATYPES
Illustration
C++
Java
boolean flag=false;
Perl
$flag=1;
UNIX
flag=1
Language
Characteristic
SYNTAX DESIGN
Illustration
C++
Understandable if C is
known
Java
Compound statements
Curly braces used.
Form & meaning
Perl
Compound statements
Curly braces used.
Form & meaning
UNIX
No curly braces
Prior knowledge is
required
Understandable if C/C++is
known
Prior knowledge is
required
Eg:split,shift,unshift etc
for var in 0 1 2 3 4 5 6 7 8
do
echo $var
WRITABILITY
Language
Characteristic
SUPPORT FOR
Illustration
ABSTRACTION
C
Returntype
func_name(parameters)
{
}
C++
modifier returnType
nameOfMethod
(Parameter List)
{ // method body }
Supports abstraction
Java
Perl
Supports abstraction
sub fun_name
{
}
UNIX
Supports abstraction
function name( )
{
}
Characteristic
Language
EXPRESSIVITY
Illustration
C++
Java
Perl
UNIX
Shorthand operators
Shortcircuit operators
Loops
+=
&&
for loop
Shorthand operators
Shortcircuit operators
Loops
++
&&
for loop
RELIABILITY
Language
Characteristic
Illustration
TYPE CHECKING
C
Strongly typed
int a=5;
C++
Strongly typed
int a=5;
Java
Strongly typed
int a=5;
Perl
Loosely typed
Runtime
UNIX
Loosely typed
Runtime
$a=5;
$a=hii;
a=5;
Language
Characteristic
Illustration
EXCEPTION HANDLING
C
No exception handling
C++
try
{
// protected code
}catch( ExceptionName e )
{
// code to handle
ExceptionName exception
}
Java
Characteristic
Language
ALIASING
Illustration
int A[10];
int *p= A;
C++
float total=100;
float &sum=total;
Java
Aliasing using object
references
Perl
UNIX
$r=\@arr;
alias dir=ls
BINDING
Language
Type binding
Static binding
int a;
C++
Static binding
int a;
Java
Storage binding
language
Type binding
Storage Binding
Perl
Dynamic binding
$a=5;
UNIX
Dynamic binding
a=5
DATA TYPES
Language
Primitive
Derived
User defined
pointer,function,
array,structure,
union
structure, union,
enum, typedef
Array,
function,pointer,
reference
structure, union,
enum, typedef,
class
C++
void,char,int,float,
double,bool
Java
Perl
function
UNIX
No primitive
datatypes
Array,function
Array,
function,pointer,
reference
structure, union,
enum, typedef,
class,sequence
No user defined
datatypes
No user defined
datatypes
VARIABLE
CONSTANT
TYPE SYNONYM
C
type name =initial
value;
C++
Java
type name
Perl
consttype
name=value;
finaltype name=value;
NA
name=initial_value
NA
my$name
use
NA
=initial_value;
constantname=>value
=initial_value;
UNIX
enum{name=value};
SCOPE
LANGUAGE
SCOPE
Static scoping
C++
Static scoping
Java
Static scoping
UNIX
Static scoping
Perl
Static scoping
ASSIGNMENT STATEMENTS
LANGUAGE
ASSIGNMENT
C++
Java
c = a;
a = a + b;
a+ = b;
UNIX
a=$b
Perl
$a=$b;
ARITHMETIC EXPRESSIONS
LANGUAGE
ARITHMETIC EXPRESSIONS
Java
c = a + b;
c = a - b;
c = a * b;
c = a / b;
c = a % b;
c = a++;
c = a--;
UNIX
val=`expr $a + $b`
val=`expr $a - $b`
val=`expr $a \* $b`
C++
Perl
$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
C++
if (condition)
if (condition)
switch
condition?
{instructions}
{instructions}
(variable)
valueIfTrue:
(condition)
structions
else
{instructions}
{instructions}
Java
UNIX
else if
...
ifconditionthen
...
default:instr
{instructions}
uctions}
ifcondition-
case"$variabl
then
expression
else
elifcondition-
fi
break;
else
expression
expression
{casecase1:in valueIfFalse
then
expression
else
e"in
"$condition1" )
command;;
"$condition2" )
command;;
esac
Condition
Language
If
Else if
Case
al
Perl
if (condition)
if (condition)
use feature
condition?
{instructions}
{instructions}
"switch";
{instructions}
or
...
unless (not
else
{when (case1)
condition)
{instructions}
{instructions}
or
...
unless
default
(notcondition)
{instructions}
else
{instructions}
else
{instructions}
{instructions}
elsif (condition)
{instructions}
...
else
{instructions}
(variable)
operator
valueIfTrue
:valueIfFalse
LOOP STATEMENTS
Language
while
Do while
For
foreach
C
NA
C++
std::
for (type
i=first;i<=last; +
Java
+i) {instructions}
while
do {instructions}
(condition){instruc
while (condition)
while[conditio
n]do
Instructions
done
or
until[notcondi
tion]do
NA
,function)
for (type
item:set)
{instructions}
tions}
UNIX
for_each(start,end
for
foriteminset
((i=first;i<=last;
do
++i))
Instructions
do
Instructions
done
done
Language
Perl
While
Do while
For
foreach
while (condition)
do {instructions}
foreach
foreach
{instructions}
while (condition)
$i(first..last)
$item(set)
{instructions}
{instructions}
or
or
until
do {instructions}
(notcondition){inst
until
ructions}
(notcondition)
<=last; $i++)
or
{instructions}
Exit
Continue
Label
Branch(goto)
break;
continue;
label:
gotolabel;
C++
break;
continue;
label:
Java
UNIX
Perl
block(break)
gotolabel;
breaklabel;
continuelabel;
label:
NA
breaklevels;
continuelevels;
NA
NA
lastlabel;
nextlabel;
label:
gotolabel;