90 likes | 369 Views
Programming paradigms. Families of programming languages. Objected programming. Important language concepts Classes and objects Methods Encapsulation Private and protected Inheritance Polymorphism Some languages Java C++ C# Smalltalk. Declarative programming.
E N D
Programming paradigms Families of programming languages Programming languages
Objected programming • Important language concepts • Classes and objects • Methods • Encapsulation • Private and protected • Inheritance • Polymorphism • Some languages • Java • C++ • C# • Smalltalk Programming languages
Declarative programming • Important language concepts • You say what you want, not how to do it. • An interpreter executes your “wish” • Some languages • SQL (Structured Query Language) • A DBMS (Database Management System) executes your SQL query. Programming languages
Structured programming • Important language concepts • Procedures and functions • Selections statements • If…else, switch, etc. • Looping statements • While, for, etc. • Remarks • Opposed to unstructured programming • Lots of goto statements • Object-oriented programming languages has many elements borrowed from structured programming • Some languages • Pascal • C Programming languages
Functional programming • Important language concepts • Lists • Programs are represented as lists • Functions • Recursion • Some languages • LISP • SML • Haskell Programming languages
Logic programming • Important language concepts • Saying “what” instead of “how” • The inference machine knows “how” • Non-procedural • Programmer state “facts” • Programmer asks “questions” • Answered by the inference machine, using the facts • Some languages • Prolog Programming languages
Programming language development • Programming languages are developed with inspiration from other programming languages. • Java was inspired by C++ and Smalltalk • C# was inspired by C++ and Java • Some languages are single paradigm • Meant to be used within a single paradigm • Some languages are multi paradigm • Meant to be used with 2 (or more) paradigms Programming languages
Using programming languages outside the paradigm • Many programming languages can be used with more than a single paradigm • Example • Java can be used for • Object-oriented programming • Structured programming • Using only static constructs • Using a programming language outside its natural paradigm is awkward and error-prone • Find a programming language which suits the paradigm you like. Programming languages
References • Wikipedia • Programming Paradigm http://en.wikipedia.org/wiki/Programming_paradigm • Bruce J. MacLennanPrinciples of Programming Languages, Holt Rinehart and Winston Programming languages