Sie sind auf Seite 1von 7

SCHOOL OF COMPUTER SCIENCES UNIVERSITI SAINS MALAYSIA

CPT211 PROGRAMMING LANGUAGE CONCEPT & PARADIGMS

Assignment 1 part 1 : clasification of programming languages in paradigms

Group member: Jackson Yew Nur Izzati Zafirah

Introduction
Programming language are develop to allow human to communicate with computer and it has vocabulary and grammatical rules to instruct a computer to perform specific task. Paradigm is a pattern , a model or a concept. Programming paradigm is the way how we look the programming problems. Therefore, it is important to know and choose the right concepts to solve a programming Bellow is a brief description of common paradigms that exits: Paradigm Imperative Details - Oldest programming paradigm. - Based on series of command - Mathematical function - Symbolic expression - Language that only operate through a function. - Predicate - Relations - A rule-based languages that contain of facts, rules and a query needed to be proven - Object - Classes - Encapsulation - Inheritance - A communicate object to pass a message that transform their state. Program Sequence of commands Collection of functions Program execution Execution of commands Evaluation of functions Result Final state of computer memory Value of the main function

Functional

Logic

Logic formulas: axioms and a theorem

Logic proving of the Theorem

Failure or Success of proving

Objectoriented

Collection of classes of objects

Exchange of messages between the objects

Final state of the objects states

Classification of programming language in Paradigms


Imperative programming
Imperative paradigm Why its an imperative language ( Characteristic of imperative language ) Advantage using imperative paradigm Criteria Readability C ADA

- Execute the commands line by line or in sequential. - imperative language more concerned with control flow, make sure that command being executed in a specific order. - efficient and close to the machine - imperative programming style is much more natural. - C language not too difficult but the language similar to human not easy to learn because of it is language. ADA design with not very consistent in its readability in mind not like C treatment of different concepts language. and language structure. - c are writability because of Writable because the expressivity flexibility of language. strength and number of operator and predefined functions. - C same with C++, both do little -ADA is reliability because it checking at run-time errors. intercept the run-time error and take correct measure and the continue. - because of the readability is The cost is high for training less, hence the training cost is programmer. But easy to high. maintain because of high -in other hand, train a readability programmer in c will give benefits in future they will be easier to learn other language. Portability: c language are easy to Portability: Ada program is very port/run across difference portable across compiler and can computer platforms. be recompiled without big changes. -Object-oriented Object-oriented -networking , unix - Banking systems -create application for computer - Manufacturing

Writability

Reliability

Cost

Others

Also fall in other paradigm Application Example coding

Object-Oriented programming
Object-Oriented paradigm Why its an objectoriented language Java C++

- this language are object-oriented because of both of them have object class. - Objects in Java offer several benefits such as modularity, hiding information, reusability, and debugging made simple. - C++ supports object orientation with classes, instances, methods, inheritance and Polymorphism. This paradigms allow code being maintainable because it easy to detect the errors. Reusable code into new system Java are easy to read and understood. Moreover, for a new programmer will be easy to learn it. Java is easy to be used and create this is because the interface of java platform is user-friendly. Java do run-time checking and detect error early. Hence it a reliability. Less, java is easy to learn. Portability: can execute/run on any platform and can be transfer over world wide web. -imperative -functional Create java game, android game and other application for desktop or mobile. C++ is a improvement language from C. it make the language more simpler and easy to read and understood compare to c. C++ is quite easier to write the program. Moreover, C++ support data abstraction. C++ also reliability but C++ doing little checking run-time compare to Java and ADA. Same to java, C++ is less costing. Because it easy to learn. Portability: C++ not portable, because it need to recompile program before executing program on other operating system. -imperative -functional Can use to develop system software, data base and operating system.

Advantage using objectoriented paradigm

Criteria

Readability

Writability

Reliability

Cost Others

Also fall in other paradigm Application

Example coding

Functional programming
Functional Paradigm Why its an functional language ( Characteristic of functional language ) Advantage using functional paradigm Haskell LISP

Criteria

Readability

Writability Reliability

Cost Others

Also fall in other paradigm Application

Functional paradigm have 4 main characteristic which is: - Referential transparency - Automatic Storage Management - Higher order function - Lazy evaluation - this paradigm tend to be much more terse than other paradigm such as imperative language. - take the same ideas and move them into the realm of general purpose programming The smaller pieces makes it easy to Simplicity. Everything in trace a program. But the use of LISP is done by using recursion sometimes a little difficult to function calls. But polish trace notation can be confusing Strong typing eliminates many type Using the interpreter makes compatibility errors writing much easier. Very reliable and easy to verify. But Type checking and good error the serious limit of size of any data handling enhance reliability. structures that are manipulated using LISP has very little security; recursion really limits the usefulness of functions can alter themselves Haskell as well as other function Completely free language to use Less. LISP runs an multiple platforms. Offer powerful new ways to Quite portability: LISP encapsulate abstraction. An abstraction interact with other program allows you to define an object whose such as C can be declared and internal working are hidden called in a way that is transparent to LISP. Pure functional - logical List comprehensions to create a list Most LISP implementations based on existing lists provide both a compiler and an interpreter -Artificial intelligence; AI robots, computer games
(DEFUN HELLO () "HELLO WORLD" )

Example coding

Logical programming
Logic Paradigm Why its an Logic language ( Characteristic of logic language ) Advantage using logic paradigm Prolog - automatic proofs within artificial intelligence - logical Based on facts and rules. -The language proving the validity of a given program is simple and solve the problem accurately. - closer to problem domain thus higher programmer productivity - the programmer can use the declarative reading of logic programs to verify their correctness It is quite readability. Indented lists let LEDA are readable, because it it much easier to read. It is also much provides an intuitive class less work to add or remover an item interface. The algorithm is easy. But the menu LEDA is easy to write, even in system is hard the daily development process. It provides an intuitive class interface. Names of classes, functions and algorithms are standardized and well documented, time and space complexity is specified. Quite reliable. Can be used to develop LEDA are reliable, they also get large-scale, practical-use AI software along with degenerated input and because of its high performance and problem instances. Moreover, this good maintainability program run-time checking. Low costing, the program quite Because of LEDA is reliable, the readability. cost are not to high. Modern Prolog environments support Portability: this program can runs creating graphical user interfaces, as on difference operating system well as administrative and networked applications. Pure logical paradigm -LEDA are multi-paradigm - imperative - functional - object-oriented Theorem proving, expert systems, LEDA related to architectural games, automated answering systems, design. ontologies and sophisticated control - Telecommunication system
?- write('Hello world!'), nl. Hello world! true.

LEDA

Criteria

Readability

Writability

Reliability

Cost Others

Also fall in other paradigm

Application

Example coding

Appendix

References
1. Programming Language principles and paradigms second edition, Allen B. Tucker , Robert E. Noonan. 2. Concepts of Programming Language ninth edition, Robert W. Sebesta. 3. Programming Languages paradigm and practice, Doris Appleby. 4. International Journal "Information Theories & Applications" Vol.12
5. LEDA: A Platform for Combinatorial and Geometric Computing, By Kurt Mehlhorn , S. Naher.

Das könnte Ihnen auch gefallen