Sie sind auf Seite 1von 27

SIMULA

Many programs are computer simulations of the real world or a conceptual world.
Writing such programs is easier if there is a correspondence between objects in the
world and components of the program. Simula originated in the Norwegian
Computing Centre in 1962. Kristen Nygaard proposed a language for simulation to
be developed by himself and Ole-Johan Dahl (1978). Key insights were developed in
1965 following experience with Simula I:

the purpose of the language was to model systems;


a system is a collection of interacting processes;
a process can be represented during program execution by multiple
procedures each with its own Algol-style stacks.

The main lessons of Simula I were:

the distinction between a program text and its execution;


the fact that data and operations belong together and that most useful
programming constructs contain both.

Simula 67 was a general purpose programming language that incorporated the


ideas of Simula I but put them into a more general context. The basic concept of
Simula 67 was to be classes of objects". The major innovation was block prexing"
(Nygaard and Dahl 1978).
Prexing emerged from the study of queues, which are central to discrete-event
simulations. The queue mechanism (a list linked by pointers) can be split off from
the elements of the queue (objects such as trucks, buses, people, and so on,
depending on the system being simulated). Once recognized, the prefix concept
could be used in any context where common features of a collection of classes
could be abstracted in a prefixed block or, as we would say today, a superclass.
Dahl (1978, page 489) has provided his own analysis of the role of blocks in Simula.

Deleting the procedure definitions and final statement from an Algol block
gives a pure data record.
Deleting the final statement from an Algol block, leaving procedure
definitions and data declarations, gives an abstract data object.
Adding coroutine constructs to Algol blocks provides quasi-parallel
programming capabilities.
Adding a prefix mechanism to Algol blocks provides an abstraction
mechanism (the class
hierarchy).

Sample Simula Class:


class Account (real balance);

begin
procedure Deposit (real amount)
balance := balance + amount;
procedure Withdraw (real amount)
balance := balance - amount;
end;

The class above shows a simple Simula-style class, with modernized syntax. Before
we use this class, we must declare a reference to it and then instantiate it on the
heap:
ref (Account) myAccount;
MyAccount := new Account(1000);
Note that the class is syntactically more like a procedure than a data object: it has
an (optional) formal parameter and it must be called with an actual parameter. It
differs from an ordinary Algol procedure in that its AR remains on the heap after the
invocation.
To inherit from Account we write something like:
Account class ChequeAccount (real amount);
::::
This explains the term prefixing" | the declaration of the child class is prefixed by
the name of its parent. Inheritance and subclasses introduced a new programming
methodology, although this did not become evident for several years.
Simula provides:

coroutines that permit the simulation of concurrent processes;


multiple stacks, needed to support coroutines;
classes that combine data and a collection of functions that operate on
the data;
prefixing (now known as inheritance) that allows a specialized class to
be derived from a
general class without unnecessary code duplication;
a garbage collector that frees the programmer from the responsibility
of deallocating storage.

Simula itself had an uneven history. It was used more in Europe than in North
America, but it never achieved the recognition that it deserved. This was partly
because there were few Simula compilers and the good compilers were expensive.
On the other hand, the legacy that Simula left is considerable: a new paradigm of
programming.

SMALLTALK

is an object-oriented, dynamically typed, reflective programming


language. Smalltalk was created as the language to underpin the "new world"
of computing exemplified by "humancomputer symbiosis."

THE HISTORY OF SMALLTALK

Smalltalk roots reach back to the early seventies when many ideas were first
explored in the context of the Dynabook project at the Xerox Palo Alto
Research Center.
Developed by Alan Klay on October 1972.

Smalltalk was initially envisioned as a simple language suitable to be used


by children who did not have any prior computer knowledge.

Smalltalk is generally recognized as the second Object Programming


Language and the first true Integrated Development Environment (IDE).

The first Smalltalk system contained 1000 lines of code which computed 3 +
4.

The next version of Smalltalk was called Smalltalk 72, which was
implemented in assembly code.

Smalltalk 72 was used to teach object-oriented Programming (OOP) to high


school students.

From there came Smalltalk 74 and Smalltalk 76 80.

Newer versions now have the capability to provide better graphics and
information retrieved.

In essence, Smalltalk is a programming language focused on human beings


rather than the computer.

Significant Language Features

Object-Oriented - Smalltalk is a language in which reusable objects exchange


messages.

Graphical Programming Environment - First look at cut/copy/paste in


programming language for most people.

Versatile - Has many applications and uses.

Graphic primitives and drawing programs - Supports quickly and easily


created graphics.

New Language Concepts

Syntax is very similar to natural language

Syntax pattern is always object then verb

Three basic linguistic constructs

Hello World as Uppercase UNARY CASE

1 + 2 : BINARY CASE

Hello World beginsWith: Hello

EXAMPLES OF USAGE
Airline and Travel - Some airlines web-based user interface is written in Smalltalk
Manufacturing and Engineering - ControlWORKS is written in VisualWorks Smalltalk.
Government - Recovering delinquent taxes using Smalltalk in Cincoms Object
Studio
MODERN USAGE
Pocket Smalltalk

Pocket Smalltalk IDE is a free open source programming environment that


lets developers write Smalltalk applications for Palm Powered handhelds,
and other small devices.

Pocket Smalltalk consists of an integrated development environment (IDE)


which runs on a variety of platforms (Windows, MacOS, Linux, OS/2, others). It
includes a cross-compiler that can generate PalmOS "executable" (.PRC) files
from Smalltalk source code.

Pocket Smalltalk makes it easy to do object-oriented development for Palm


Powered handhelds. You have the full power of Smalltalk along with a
complete class library. Best of all, Pocket Smalltalk creates small, standalone
applications no runtime libraries are required.

C++
C++ was developed at Bell Labs by Bjarne Stroustrup (1994). The task assigned to
Stroustrup was to develop a new systems PL that would replace C. C++ is the result
of two major design decisions:

First, Stroustrup decided that the new language would be adopted only if it
was compatible with C;

second, Stroustrup's experience of completing a Ph.D. at Cambridge


University using Simula convinced him that object orientation was the correct
approach but that efficiency was essential for acceptance. C++ is widely
used but has been sharply criticized (Sakkinen 1988; Sakkinen 1992;Joyner
1992).

C++:

is almost a superset of C (that is, there are only a few C constructs that are
not accepted by a C++ compiler);
is a hybrid language (i.e., a language that supports both imperative and OO
programming), not a pure" OO language;
emphasizes the stack rather than the heap, although both stack and heap
allocation is provided;
provides multiple inheritance, genericity (in the form of \templates"), and
exception handling;
does not provide garbage collection.

Eiffel
What is Eiffel?
Eiffel is an ISO-standardized, object-oriented programming language designed
by Bertrand Meyer (an object-orientation proponent and author of Object-Oriented
Software Construction) and Eiffel Software. The design of the language is closely
connected with the Eiffel programming method. Both are based on a set of
principles, including design by contract, command query separation, the uniformaccess principle, the single-choice principle, the open-closed principle, and optionoperand separation. Many concepts initially introduced by Eiffel later found their
way into Java, C#, and other languages. New language design ideas, particularly
through the Ecma/ISO standardization process, continue to be incorporated into the
Eiffel language.
History of Eiffel
The Eiffel programming language was created by Bertrand Meyer and developed by
his company, Interactive Software Engineering (ISE) of Goleta, CA in 1985. Eiffel has
evolved continually since its conception on September 14, 1985 and its first
introduction in 1986. Eiffel is named after Gustave Eiffel, the engineer who designed
the Eiffel Tower. The developers of Eiffel like to compare themselves to the well-built
structure of the Eiffel Tower. The Eiffel Tower was completed on time and within
budget, which should happen if you use Eiffel for your software projects.
Eiffel Milestones

1985: Bertrand Meyer and Jean Marc Nerson begin development of Eiffel

1986: 1st Eiffel compiler presented (April), 1st Customer Deliveries (December)

1987: Eiffel achieves commercial success

1991: Non-profit International Consortium for Eiffel (NICE) is founded; NICE


controls the standardization of the Eiffel language

1991: Publication of "Eiffel the language" by Bertrand Meyer (Prentice Hall)

1995: NICE presents Eiffel Library Kernel Standard (ELKS), which sets
standards for basic Eiffel classes.

1997: NICE and the Eiffel Consortium organize Eiffel Struggle `97. Prizes
awarded for Eiffel applications and Eiffel libraries.

Areas of Application
Eiffel is used in many application areas, such:

Teaching Purposes

Rapid Prototyping

Financial Applications

Telecommunication Systems

Significant Language Features

Portable - this language is available for major industry platforms, such as


Windows, OS/2, Linux, UNIX, VMS, etc...

Open System - includes a C and C++ interface making it easily possible to


reuse code previously written.

"Melting Ice Technology" - combines compilation, for the generation of


efficient code, with bytecode interpretation, for fast turnaround after a
change.

"Design by Contract" - enforced through assertions such as class


invariants, preconditions and postconditions.

Automatic Documentation ("Short Form") - abstract yet precise


documentation produced by the environment at the click of a button.

Multiple Inheritance - a class can inherit from as many parents as


necessary.

Repeated Inheritance - a class inherits from another through two or more


parents.

Statically Typed - ensure that errors are caught at compile time, rather than
run time.

Dynamically Bound - guarantees that the right version of an operation will


always be applied depending on the target object.

Java
Origin

1991 java was developed by James Gosling, Mike Sheridan, and Patrick
Naughton also known as Green Team in Sun Microsystem (Oracle
Corporation).

History

Developed from some concept of C and C++.

Designed to solve household machine connecting problems.

Oak was the initial name of java, was later changed to Green and finally
renamed as java.

1994 James Gosling realized that his language would be ideal for
developing a web browser.

1995 Java is released for free.

Arthur Van Hoff rewrote Java 1.0 compiler in Java.

WORA Write Once Run Anywhere.

Popular Versions of Java

Java EE Java Enterprise Edition.

Java ME Java Mobile Edition

Java SE Java Standard Edition

Applets Mini Application

Features

Simple easy to write; concise and cohesive set of features; east to learn
and use.

Object Oriented has the following concepts:


Object an entity that has state and behaviour.
Class collection of objects.

Inheritance child objects acquires all the properties and behaviours


of parent objects.
Polymorphism method overloading and method overriding.
Abstraction hiding internal details and showing functionality.
Encapsulation binding of code and data together into a single unit.

Portable can execute in any environment with Java run-time system or


JVM (Java Virtual Machine), any platform (Linux, Windows and Mac) and
can be transferred over the internet (e.g. Applets).
Robust Strictly-typed and performing run-time checks.
Architecture Neutral not tied on specific machine or operating system.
Interpreted Java supports cross-platform code with the use of
bytecode.
Secure cannot harm other system; secure means of creating internet
applications.

Advantages

Simplicity Easy interface for users and developers.


Portability and Platform Independent Behavior Write Once Run
Anywhere.
Allocation Stack allocation system; store data easily; Last In First Out;
automatic garbage collection and memory allocation.
Distributiveness Networking capability.

Disadvantages

Performance Slower and takes more memory space compared to C /


C++.
No Support for Genericity Hosch notes Java's lack of support for
writing generic data structures and methods.
Look And Feel The default look and feel of GUI applications written in
Java using the Swing toolkit is very different from native applications.

PERL
Practical Extraction and Reporting Language, in short Perl, is a very wellknown scripting language with an extremely versatile syntax and a rich collection of
features. This language combines the power of UNIX shell scripting and flexibility of
Lisp to provide a relatively more powerful development environment. Originally the
only documentation for Perl was a single (increasingly lengthy) man page. In
1991, Programming Perl, known to many Perl programmers as the "Camel Book"
because of its cover, was published and became the de facto reference for the
language.
- Also it includes feature like object-oriented programming which gives an edge over
other language.
- Perl is a family of high-level, general-purpose, interpreted, dynamic programming
languages.
- The languages in this family include Perl 5 and Perl 6.
- Perl is a stable, cross platform programming language.
- Perl is Open Source software, licensed under its Artistic License, or the GNU
General Public License (GPL).
- Perl is widely known as the duct-tape of the Internet.
- Perl is an interpreted language, which means that your code can be run as is,
without a compilation stage that creates a non-portable executable program.
HISTORY
Perl was originally developed by Larry Wall in 1987 as a general-purpose UNIX
scripting language to make report processing easier. Since then, it has undergone
many changes and revisions.
Version 1.0 released to the comp.sources.misc newsgroup on December 18,
1987. The language expanded rapidly over the next few years.
Perl 2, released in 1988, featured a better regular expression engine.
Perl 3, released in 1989, added support for binary data streams.
At the same time, the Perl version number was bumped to 4 not to mark a major
change in the language but to identify the version that was well documented by the
book. Perl 4 went through a series of maintenance releases, culminating in Perl
4.036 in 1993. At that point, Wall abandoned Perl 4 to begin work on Perl 5.

Initial design of Perl 5 continued into 1994. The perl5-porters mailing list was
established in May 1994 to coordinate work on porting Perl 5 to different platforms.
It remains the primary forum for development, maintenance, and porting of Perl 5
According to Larry Wall, Perl has two slogans. The first is "There's more than one
way to do it", commonly known as TMTOWTDI. The second slogan is "Easy things
should be easy and hard things should be possible".
Perl was originally named "Pearl". Wall wanted to give the language a short name
with positive connotations; he claims that he considered (and rejected) every threeand four-letter word in the dictionary. He also considered naming it after his wife
Gloria. Wall discovered the existing PEARL programming language before Perl's
official release and changed the spelling of the name.
The name is occasionally expanded as Practical Extraction and Report Language,
but this is a backronym. Other expansions have been suggested as equally
canonical, including Wall's own humorous Pathologically Eclectic Rubbish
Lister. Indeed, Wall claims that the name was intended to inspire many different
expansions.
LANGUAGE FEATURES:
- Easy learning
- Powerful text manipulation features
- Cross-platform availability
- Open source platform- so independent from commercial interference and has
active online communities.
- Simple syntax and it makes it quick to learn.
- Cross-platform language- it is very easy to write a Perl program on one platform
and run it across different platforms with little or no modification.
- Versatility- Programmer can learn the language and adapt their own coding style.
- Regular expression engine- which is capable of almost any type of textual
transformation
- Perl has a very comprehensive library of modules- which provides a very support
for XML, Graphical user interfaces and embedded Perl scripting.
- Powerful and flexible object-oriented programming syntax at the same time very
simple.
Advantages of Using PERL
1) Perl runs on all platforms and is far more portable than C.
2) Perl and a huge collection of Perl Modules are free software (either GNU General
Public License or Artistic License).
3) Perl is very much efficient in TEXT and STRING manipulation i.e. REG_EXP.
4) It is a language that combines the best features from many other languages and

is very easy to learn if you approach it properly.


5) Dynamic memory allocation is very easy in PERL, at any point of time we can
increase or decrease the size of the array.
Disadvantages of Using PERL
1) You cannot easily create a binary image ("exe") from a Perl file. It's not a serious
problem on UNIX, but it might be a problem on Windows.
2) Moreover, if you write a script which uses modules from CPAN, and want to run it
on another computer, you need to install all the modules on that other computer,
which can be a drag.
3) Perl is an interpretative language, so its comparatively slower to other
compiling language like C. So, its not feasible to use in Real time environment like
in flight simulation system.

PYTHON
Python is an interpreted, object-oriented, high-level programming language with
dynamic semantics. Its high-level built in data structures, combined with dynamic
typing and dynamic binding, make it very attractive for Rapid Application
Development, as well as for use as a scripting or glue language to connect existing
components together. Python's simple, easy to learn syntax emphasizes readability
and therefore reduces the cost of program maintenance. Python supports modules
and packages, which encourages program modularity and code reuse. The Python
interpreter and the extensive standard library are available in source or binary form
without charge for all major platforms, and can be freely distributed.
Often, programmers fall in love with Python because of the increased productivity it
provides. Since there is no compilation step, the edit-test-debug cycle is incredibly
fast. Debugging Python programs is easy: a bug or bad input will never cause a
segmentation fault. Instead, when the interpreter discovers an error, it raises an
exception. When the program doesn't catch the exception, the interpreter prints a
stack trace. A source level debugger allows inspection of local and global variables,
evaluation of arbitrary expressions, setting breakpoints, stepping through the code
a line at a time, and so on. The debugger is written in Python itself, testifying to
Python's introspective power. On the other hand, often the quickest way to debug a
program is to add a few print statements to the source: the fast edit-test-debug
cycle makes this simple approach very effective.

Language Features:
Simple - Python is a simple and minimalistic language. Reading a good Python
program feels almost like reading English (but very strict English!). This pseudocode nature of Python is one of its greatest strengths. It allows you to concentrate
on the solution to the problem rather than the syntax i.e. the language itself.

Easy to Learn - As you will see, Python is extremely easy to get started with.
Python has an extraordinarily simple syntax as already mentioned.
Free and Open Source - Python is an example of a FLOSS (Free/Libre and Open
Source Software). In simple terms, you can freely distribute copies of this software,
read the software's source code, make changes to it, use pieces of it in new free
programs, and that you know you can do these things. FLOSS is based on the
concept of a community which shares knowledge. This is one of the reasons why
Python is so good - it has been created and improved by a community who just want
to see a better Python.
High-level Language - When you write programs in Python, you never need to
bother about low-level details such as managing the memory used by your
program.
Portable - Due to its open-source nature, Python has been ported (i.e. changed to
make it work on) to many many platforms. All your Python programs will work on
any of these platforms without requiring any changes at all. However, you must be
careful enough to avoid any system-dependent features.
You can use Python on Linux, Windows, Macintosh, Solaris, OS/2, Amiga, AROS,
AS/400, BeOS, OS/390, z/OS, Palm OS, QNX, VMS, Psion, Acorn RISC OS, VxWorks,
PlayStation, Sharp Zaurus, Windows CE and PocketPC !
Interpreted - This requires a little explanation.
A program written in a compiled language like C or C++ is translated from the
source language i.e. C/C++ into a language spoken by your computer (binary code
i.e. 0s and 1s) using a compiler with various flags and options. When you run the
program, the linker/loader software just stores the binary code in the computer's
memory and starts executing from the first instruction in the program.
When you use an interpreted language like Python, there is no separate compilation
and execution steps. You just run the program from the source code. Internally,
Python converts the source code into an intermediate form called bytecodes and
then translates this into the native language of your specific computer and then
runs it. All this makes using Python so much easier. You just run your programs - you
never have to worry about linking and loading with libraries, etc. They are also more
portable this way because you can just copy your Python program into another
system of any kind and it just works!
Object Oriented - Python supports procedure-oriented programming as well as
object-oriented programming. In procedure-oriented languages, the program is built
around procedures or functions which are nothing but reusable pieces of programs.
In object-oriented languages, the program is built around objects which combine

data and functionality. Python has a very powerful but simple way of doing objectoriented programming, especially, when compared to languages like C++ or Java.
Extensible - If you need a critical piece of code to run very fast, you can achieve
this by writing that piece of code in C, and then combine that with your Python
program.
Embeddable - You can embed Python within your C/C++ program to give scripting
capabilities for your program's users.
Extensive Libraries - The Python Standard Library is huge indeed. It can help you
do various things involving regular expressions, documentation generation, unit
testing, threading, databases, web browsers, CGI, ftp, email, XML, XML-RPC, HTML,
WAV files, cryptography, GUI(graphical user interfaces) using Tk, and also other
system-dependent stuff. Remember, all this is always available wherever Python is
installed. This is called the "batteries included" philosophy of Python.
Besides the standard library, there are various other high-quality libraries such as
the Python Imaging Library which is an amazingly simple image manipulation
library.

RUBY
Ruby is a dynamic, reflective, object-oriented, general-purpose programming
language. It was designed and developed in the mid-1990s by Yukihiro "Matz"
Matsumoto in Japan.
According to its authors, Ruby was influenced by Perl, Smalltalk, Eiffel, Ada,
and Lisp. It supports multiple programming paradigms, including functional, objectoriented, and imperative. It also has a dynamic type system and automatic memory
management.
Early concept
Ruby was conceived on February 24, 1993. In a 1999 post to the ruby-talk mailing
list, Ruby author Yukihiro Matsumoto describes some of his early ideas about the
language:[13]
I was talking with my colleague about the possibility of an object-oriented
scripting language. I knew Perl (Perl4, not Perl5), but I didn't like it really, because it
had the smell of a toy language (it still has). The object-oriented language seemed
very promising. I knew Python then. But I didn't like it, because I didn't think it was a
true object-oriented language OO features appeared to be add-on to the
language. As a language maniac and OO fan for 15 years, I really wanted a genuine

object-oriented, easy-to-use scripting language. I looked for but couldn't find one.
So I decided to make it. - Matsumoto
Matsumoto describes the design of Ruby as being like a simple Lisp language at its
core, with an object system like that of Smalltalk, blocks inspired by higher-order
functions, and practical utility like that of Perl
The name "Ruby" originated during an online chat session between Matsumoto and
Keiju Ishitsuka on February 24, 1993, before any code had been written for the
language.[15]Initially two names were proposed: "Coral" and "Ruby". Matsumoto
chose the latter in a later e-mail to Ishitsuka Matsumoto later noted a factor in
choosing the name "Ruby" it was the birthstone of one of his colleagues
FIRST Publication
The first public release of Ruby 0.95 was announced on Japanese
domestic newsgroups on December 21, 1995 Subsequently three more versions of
Ruby were released in two days The release coincided with the launch of
the Japanese-language ruby-list mailing list, which was the first mailing list for the
new language.
Already present at this stage of development were many of the features familiar in
later releases of Ruby, including object-oriented design, classes with
inheritance, mixins,iterators, closures, exception handling and garbage collection
Early Releases
Following the release of Ruby 0.95 in 1995, several stable versions of Ruby were
released in the following years:

Ruby 1.0: December 25, 1996

Ruby 1.2: December 1998

Ruby 1.4: August 1999

Ruby 1.6: September 2000

In 1997, the first article about Ruby was published on the Web. In the same
year, Matsumoto was hired by netlab.jp to work on Ruby as a full-time
developer.

In 1998, the Ruby Application Archive was launched by Matsumoto, along


with a simple English-language homepage for Ruby.

In 1999, the first English language mailing list ruby-talk began, which
signaled a growing interest in the language outside Japan. In this same year,
Matsumoto and Keiju Ishitsuka wrote the first book on Ruby, The Object-

oriented Scripting Language Ruby ( Ruby),


which was published in Japan in October 1999. It would be followed in the
early 2000s by around 20 books on Ruby published in Japanese.

By 2000, Ruby was more popular than Python in Japan. [23] In September 2000,
the first English language book Programming Ruby was printed, which was
later freely released to the public, further widening the adoption of Ruby
amongst English speakers. In early 2002, the English-language rubytalk mailing list was receiving more messages than the Japaneselanguage ruby-list, demonstrating Ruby's increasing popularity in the Englishspeaking world.

Ruby 1.8 - initially released in August 2003, was stable for a long time, and
was retired June 2013.[24] Although deprecated, there is still code based on it.
Ruby 1.8 is only partially compatible with Ruby 1.9. Ruby 1.8 has been the
subject of several industry standards. The language specifications for Ruby
were developed by the Open Standards Promotion Center of the InformationTechnology Promotion Agency (a Japanese government agency) for
submission to the Japanese Industrial Standards Committee (JISC) and then to
the International Organization for Standardization (ISO). It was accepted as a
Japanese Industrial Standard (JIS X 3017) in 2011 and an international
standard (ISO/IEC 30170) in 2012

Around 2005, interest in the Ruby language surged in tandem with Ruby on
Rails, a web application framework written in Ruby. Rails is frequently
credited with increasing awareness of Ruby.

Ruby 1.9 was released in December 2007. Effective with Ruby 1.9.3, released
October 31, 2011, Ruby switched from being dual-licensed under the Ruby
License and the GPL to being dual-licensed under the Ruby License and the
two-clause BSD license. Adoption of 1.9 was slowed by changes from 1.8 that
required many popular third partygems to be rewritten.

Ruby 1.9 introduces many significant changes over the 1.8 series. Examples:

block local variables (variables that are local to the block in which they
are declared)

an additional lambda syntax: f = ->(a,b) { puts a + b }

per-string character encodings are supported

new socket API (IPv6 support)

require_relative import security

Ruby 1.9 has been obsolete since February 23, 2015, and it will no longer
receive bug and security fixes. Users are advised to upgrade to a more recent
version.

Ruby 2.0 - Ruby 2.0 added several new features, including:

method keyword arguments,

a new method, Module#prepend, for extending a class,

a new literal for creating an array of symbols,

new API for the lazy evaluation of Enumerables, and

a new convention of using #to_h to convert objects to Hashes.

Ruby 2.0 is intended to be fully backward compatible with Ruby 1.9.3. As of


the official 2.0.0 release on February 24, 2013, there were only five known
(minor) incompatibilities.

Ruby 2.1 - Ruby 2.1.0 was released on Christmas Day in 2013. The release
includes speed-ups, bugfixes, and library updates. Starting with 2.1.0, Ruby's
versioning policy is more like semantic versioning. Although similar, Ruby's
versioning policy is not compatible with semantic versioning. Semantic
versioning also provides additional labels for pre-release and build metadata
are available as extensions to the MAJOR.MINOR.PATCH format, not available
at Ruby.

Ruby 2.2 - was released on Christmas Day in 2014.[36] The release includes
speed-ups, bugfixes, and library updates and removes some deprecated APIs.
Most notably, Ruby 2.2.0 introduces changes to memory handling - an
incremental garbage collector, support for garbage collection of symbols and
the option to compile directly against jemalloc. It also contains experimental
support for using vfork(2) with system() and spawn(), and added support for
the Unicode 7.0 specification.

Features that were made obsolete or removed include callcc, the DL library,
Digest::HMAC, lib/rational.rb, lib/complex.rb, GServer, Logger as well as
various C API functions.

FEATURES

Thoroughly object-oriented with inheritance, mixins and metaclasses

Dynamic typing and duck typing

Everything is an expression (even statements) and everything is


executed imperatively (even declarations)

Succinct and flexible syntax that minimizes syntactic noise and serves as a
foundation for domain-specific languages

Dynamic reflection and alteration of objects to facilitate metaprogramming

Lexical closures, iterators and generators, with a unique block syntax

Literal notation for arrays, hashes, regular expressions and symbols

Embedding code in strings (interpolation)

Default arguments

Four levels of variable scope (global, class, instance, and local) denoted
by sigils or the lack thereof

Garbage collection

First-class continuations

Strict boolean coercion rules (everything is true except false and nil)

Exception handling

Operator overloading

Built-in support for rational numbers, complex numbers and arbitraryprecision arithmetic

Custom dispatch behavior (through method_missing and const_missing)

Native threads and cooperative fibers (fibers are 1.9/YARV feature)

Initial support for Unicode and multiple character encodings (no ICU support

Native plug-in API in C

Interactive Ruby Shell (a REPL)

Centralized package management through RubyGems

Implemented on all major platforms

Large standard library, including modules


for YAML, JSON, XML, CGI, OpenSSL, HTTP, FTP, RSS, curses, zlib, and Tk

Semantics

Ruby is object-oriented: every value is an object, including classes and


instances of types that many other languages designate as primitives (such
as integers, booleans, and "null"). Variables always hold references to
objects. Every function is a method and methods are always called on an
object. Methods defined at the top level scope become members of the
Object class. Since this class is an ancestor of every other class, such
methods can be called on any object. They are also visible in all scopes,
effectively serving as "global" procedures. Ruby
supports inheritance with dynamic dispatch, mixins and singleton methods
(belonging to, and defined for, a single instance rather than being defined on
the class). Though Ruby does not support multiple inheritance, classes can
import modules as mixins.

Ruby has been described as a multi-paradigm programming language: it


allows procedural programming (defining functions/variables outside classes
makes them part of the root, 'self' Object), with object orientation (everything
is an object) or functional programming (it has anonymous
functions, closures, and continuations; statements all have values, and
functions return the last evaluation). It has support
for introspection, reflection and metaprogramming, as well as support for
interpreter-based[49] threads. Ruby features dynamic typing, and
supports parametric polymorphism.

According to the Ruby FAQ, the syntax is similar to Perl and the semantics are
similar to Smalltalk but it differs greatly from Python.

Syntax

The syntax of Ruby is broadly similar to that of Perl and Python. Class and
method definitions are signaled by keywords. In contrast to Perl, variables are
not obligatorily prefixed with a sigil. When used, the sigil changes the
semantics of scope of the variable. One difference from C and Perl is that
keywords are typically used to define logical code blocks, without braces, in
other words a pair of { and }. For practical purposes there is no distinction
between expressions and statements.[51] Line breaks are significant and taken
as the end of a statement; a semicolon may be equivalently used. Unlike
Python, indentation is not significant.

One of the differences of Ruby compared to Python and Perl is that Ruby
keeps all of its instance variables completely private to the class and only
exposes them through accessor methods (attr_writer, attr_reader, etc.).
Unlike the "getter" and "setter" methods of other languages like C++ or Java,
accessor methods in Ruby can be created with a single line of code

via metaprogramming; however, accessor methods can also be created in the


traditional fashion of C++ and Java. As invocation of these methods does not
require the use of parentheses, it is trivial to change an instance variable into
a full function, without modifying a single line of code or having to do any
refactoring achieving similar functionality to C# and VB.NET property
members.

Python's property descriptors are similar, but come with a tradeoff in the
development process. If one begins in Python by using a publicly exposed
instance variable, and later changes the implementation to use a private
instance variable exposed through a property descriptor, code internal to the
class may need to be adjusted to use the private variable rather than the
public property. Rubys design forces all instance variables to be private, but
also provides a simple way to declare set and get methods. This is in keeping
with the idea that in Ruby, one never directly accesses the internal members
of a class from outside the class; rather, one passes a message to the class
and receives a response.

Differences from other languages

Some features that differ notably from languages such as C or Perl:

The language syntax is sensitive to the capitalization of identifiers, in all


cases treating capitalized variables as constants. Class and module names
are constants and refer to objects derived from Class and Module.

The sigils $ and @ do not indicate variable data type as in Perl, but rather
function as scope resolution operators.

Floating point literals must have digits on both sides of the decimal point:
neither .5 nor 2. are valid floating point literals, but 0.5 and 2.0 are.

(In Ruby, integer literals are objects that can have methods apply to them, so
requiring a digit after a decimal point helps to clarify whether 1.e5 should be
parsed analogously to 1.to_f or as the exponential-format floating
literal 1.0e5. The reason for requiring a digit before the decimal point is less
clear; it might relate either to method invocation again, or perhaps to
the .. and ... operators, for example in the fragment 0.1...3.)

Boolean non-boolean datatypes are permitted in boolean contexts (unlike in


e.g. Smalltalk and Java), but their mapping to boolean values differs markedly
from some other languages: 0 and "empty" (e.g. empty list, string or
associative array) all evaluate to true, thus changing the meaning of some
common idioms in related or similar languages such as Lisp, Perl and Python.

A consequence of this rule is that Ruby methods by convention for


example, regular-expression searches return numbers, strings, lists, or
other non-false values on success, but nil on failure.

Versions prior to 1.9 use plain integers to represent single characters, much
like C. This may cause surprises when slicing strings: "abc"[0] yields 97
(the ASCII code of the first character in the string); to
obtain "a" use "abc"[0,1] (a substring of length 1) or "abc"[0].chr.

The notation statement until expression does not run the statement if the
expression is already true. (The behavior is like Perl, but unlike other
languages' equivalent statements, e.g. do { statement } while (!
(expression)); in C/C++/...). This is because statement until expression is
actually syntactic sugar over until expression; statement; end, the equivalent
of which in C/C++ is while (!(expression)) { statement; }, just as statement if
expression is equivalent to if (expression) { statement; }. However, the
notation begin statement end until expression in Ruby will in fact run the
statement once even if the expression is already true, acting similar to
the do-while of other languages. (Matsumoto has expressed a desire to
remove the special behavior of begin statement end until expression,[52] but it
still exists as of Ruby 2.0.)

Because constants are references to objects, changing what a constant refers


to generates a warning, but modifying the object itself does not. For
example, Greeting << " world!" if Greeting == "Hello" does not generate an
error or warning. This is similar to final variables in Java or a const pointer to
a non-const object in C++, but Ruby provides the functionality to "freeze" an
object, unlike Java.

The usual conjunctive and disjunctive operators for conditional expressions


have the same precedence, so and does not bind tighter than or in Ruby, a
behaviour similar to languages such as APL, Ada, VHDL, Mathematica, zkl and
others. However, Ruby also has C-like operators || and && that work as in Clike languages.

A list of so-called gotchas may be found in Hal Fulton's book The Ruby Way,
2nd ed (ISBN 0-672-32884-4), Section 1.5. A similar list in the 1st edition
pertained to an older version of Ruby (version 1.6), some problems of which
have been fixed in the meantime. For example, retry now works
with while, until, and for, as well as with iterators.

PHP

PHP is an "HTML-embedded scripting language" primarily used for dynamic Web


applications. The first part of this definition means that PHP code can be
interspersed with HTML, making it simple to generate dynamic pieces of Web pages
on the fly.
PHP takes most of its syntax from C, Java, and Perl. It is an open source
technology and runs on most operating systems and with most Web servers.
PHP was written in the C programming language by Rasmus Lerdorf in 1994 for
use in monitoring his online resume and related personal information. For this
reason, PHP originally stood for "Personal Home Page". Lerdorf combined PHP with
his own Form Interpreter, releasing the combination publicly as PHP/FI (generally
referred to as PHP 2.0) on June 8, 1995.
Two programmers, Zeev Suraski and Andi Gutmans, rebuilt PHP's core, releasing
the updated result as PHP/FI 2 in 1997. The acronym was formally changed to PHP:
HyperText Preprocessor, at this time. (This is an example of a recursive acronym:
where the acronym itself is in its own definition.)
In 1998, PHP 3 was released, which was the first widely used version.
PHP 4 was released in May 2000, with a new core, known as the Zend Engine
1.0. PHP 4 featured improved speed and reliability over PHP 3. In terms of features,
PHP 4 added references, the Boolean type, COM support on Windows, output
buffering, many new array functions, expanded object-oriented programming,
inclusion of the PCRE library, and more. Maintenance releases of PHP 4 are still
available, primarily for security updates.
PHP 5 was released in July 2004, with the updated Zend Engine 2.0. Among
the many new features in PHP 5 are:

improved object-oriented programming

embedded SQLite

support for new MySQL features (see the image at right)

Exception handling using a try. Catch structure

integrated SOAP support (see the image at right)

the Filter library (in PHP 5.1)

better XML tools

iterators

PHP 6 has been in development since October of 2006. The most significant
change will be native support for Unicode. Unpopular, deprecated features such as

Magic Quotes, register_globals, safe_mode, and the HTTP_*_VARS variables


will disappear in PHP 6. Although PHP is still primarily used for server-side
generation of Web pages, it can also be used to perform command-line scriptingor
to create graphical applications with the help of GTK+.

Characteristic
The PHP language revolves around the central theme of practicality. PHP is about
providing the programmer with the necessary tools to get the job done in a quick
and efficient fashion. Five important characteristics make PHPs practical nature
possible:

Familiarity

Simplicity

Efficiency

Security

Flexibility

Its Free

Familiarity
Programmers from many backgrounds will find themselves already accustomed to
the PHP language. Many of the languages constructs are borrowed from C and Perl,
and in many cases PHP code is almost indistinguishable from that found in the
typical C or Pascal program.
Simplicity
A PHP script can consist of 10,000 lines or one line: whatever you need to get the
job done. There is no need to include libraries, special compilation directives, or
anything of the sort. The PHP engine simply begins executing the code after the first
escape sequence (). If the code is syntactically correct, it will be executed exactly as
it is displayed.
Efficiency

Efficiency is an extremely important consideration for working in a multiuser


environment such as the WWW. PHP 4.0 introduced resource allocation mechanisms
and more pronounced support for object-oriented programming, in addition to
session management features. Reference counting has also been introduced in the
latest version, eliminating unnecessary memory allocation.
Security
PHP provides developers and administrators with a flexible and efficient set of
security safeguards. These safeguards can be divided into two frames of reference:
system level and application level.
- System-Level Security Safeguards :
- Application-Level Security Safeguards
Flexibility
Because PHP is an embedded language, it is extremely flexible towards meeting the
needs of the developer. Although PHP is generally touted as being used in
conjunction solely with HTML, it can also be integrated alongside languages like
JavaScript, WML, XML, and many others.

Free
PHPs embracing of this open source strategy result in great performance gains for
users, and the code is available free of charge. Additionally, an extremely receptive
user community numbering in the thousands acts as customer support, providing
answers to even the most arcane questions in popular online discussion groups.
Advantages of PHP

Open source: It is developed and maintained by a large group of PHP


developers, this will helps in creating a support community, abundant
extension library.
Speed: It is relative fast since it uses much system resource.
Easy to use: It uses C like syntax, so for those who are familiar with C, its
very easy for them to pick up and it is very easy to create website scripts.
Stable: Since it is maintained by many developers, so when bugs are found, it
can be quickly fixed.
Powerful library support: You can easily find functional modules you need
such as PDF, Graph etc.
Built-in database connection modules: You can connect to database easily
using PHP, since many websites are data/content driven, so we will use

database frequently, this will largely reduce the development time of web
apps.
Can be run on many platforms, including Windows, Linux and Mac, its easy
for users to find hosting service providers.

Disadvantages of PHP

Security : Since it is open sourced, so all people can see the source code, if
there are bugs in the source code, it can be used by people to explore the
weakness of PHP
Not suitable for large applications: Hard to maintain since it is not very
modular.
Weak type: Implicit conversion may surprise unwary programmers and lead
to unexpected bugs. For example, the strings 1000 and 1e3 compare
equal because they are implicitly cast to floating point numbers.

C#
Pronounced see-sharp. A hybrid of C and C++, it is a Microsoft
programming language developed to complete with Suns Java language. C#
is an object-oriented programming language used with XML-based Web
services on the .NET platform and designed for improving productivity in the
development of Web applications.
History of C#
During the development of the .NET Framework, the class libraries
were originally written using a managed code compiler system called Simple
Managed C (SMC). In January 1999, Anders Hejlsberg formed a team to build
a new language at the time called Cool, which stood for C-like Object
Oriented Language. Microsoft had considered keeping the name of the
language, but chose not to do so for trademark reasons. By the time the
.NET project was publicly announced at the July 2000 Professional
Developers Conference, the language had been renamed C#, and the class
libraries and ASP.NET runtime had been ported to C#.
C#s principal designer and lead architect at Microsoft is Anders
Hejlsberg, who was previously involved with the design of Turbo Pascal,
Embarcadero Delphi (formerly CodeGear Delphi, Inspire Delphi and
Borland Delphi), and Visual J++. In interviews and technical papers he has
stated that flaws in most major programming languages. (e.g. C++, Java,

Delphi, and Smalltalk) drove the fundamentals of the Common Language


Runtime (CLR), which, in turn, drove the design of the C# language itself.
James Gosling who created the Java programming languages in 1994,
and bill Joy, a co-founder of Sun Microsystems, the originator of Java, called
C# an imitation of Java; Gosling further said that [C# is] sort of Java with
reliability, productivity and security deleted. Klaus Kreft and Angelika Langer
(authors of a C++ streams book) stated in a blog post that Java and C# are
almost identical programming languages.
C# used to have a mascot called Andy (named after Anders Hejlsberg).
It was retired on 29 Jan 2004.
Syntax of C#
The core of syntax of C# language is similar to that of other C-style
languages such as C++ and Java. In particular:

Semicolons are used to denote the end of a statement.

Curly brackets are used to group statements. Statements are


commonly group into classes, and classes into namespaces.

Variables are assigned using an equals sign, but compared using two
consecutive equals signs.

Square brackets are used with arrays, both to declare them and to get
a value and a given index in one of them.

Distinguishing Features
Some notable features of C# that distinguish it from C, C++, and Java
where noted, are:

Portability By design, C# is the programming language that most


directly reflects the underlying Common Language Infrastructure (CLI).

Typing C# supports strongly typed implicit variable declarations with


the keyword var, and implicitly typed arrays with the keyword new[ ]
followed by a collection initializer.

Meta programming Meta programming via C# attributes is part of the


language.

Methods and Functions Like C++, and unlike Java, C# programmers


must use the keyword virtual to allow methods to be overridden by
subclasses.

Exception Checked exceptions are not present in C# (in contrast to


Java).

Polymorphism Unlike, multiple inheritance is not supported by C#,


although a class can implement any number of interfaces.

Property C# provides properties as syntactic sugar for a common


pattern in which a pair of methods, accessor (getter) and mutator
(setter) encapsulate operations on a single attribute of a class.

Namespace A C# namespace provides the same level of code


isolation as a Java package or a C++ namespace, with very similar
rules and features to a package.

Memory Access In C#, memory address pointers can only be used


within blocks specially marked as unsafe, and programs with unsafe
code need appropriate permissions to run.

Functional programming Through primarily an imperative language,


C# 2.0 offered limited support for functional programming through
first-class functions and closures in the form of anonymous delegates.
C# 3.0 expanded support for functional programming with the
introduction of a light weight syntax for lambda expressions, extension
methods (an affordance for modules), and list comprehension syntax in
the form of a query comprehension language.

ADVANTAGES AND DISADVANTAGES


Advantages:

C# borrows concepts from Java and C++, adopting only the good bits
from those languages and eliminating overly confusing and error prone
features, which are the major sources of bug in a code.

C# is a terse language.

C# is supports effective and reusable components.

C# is portable at the same time it is cross language compatible for all


Microsoft Window based languages and programs specifically targeted

to that particular platform can be coded to interoperate with the coded


of other languages.

C# programs are managed code, to say, they are coded and executed
in a controlled environment leaving little room for anamolies called
bugs to creep in.

Categories of data type


CTS separates data types into two categories:

Reference types

Value types
Both type categories are extensible with user-defined types.

Boxing is the operation of converting a value-type object into a value


of a corresponding reference type.

Unboxing is the operation of converting a value of a reference type


(previously boxed) into a value of a value type.

Disadvantages:

All though portability is what with C# was developed, C programs are


largely for Microsoft Windows Environment which although happens to
be the most widely used operating system over the globe, but with
Open Source technologies, especially platforms like Linux catching up,
C# has to long way to go.

C# has eliminated the unsafe code functionalities from C++ (from


which it was developed); it has its own set of functionalities which are
used with caution by the user.

Das könnte Ihnen auch gefallen