CSC/ECE 517 Fall 2014/ch1a 9 kn

From Expertiza_Wiki
Revision as of 17:41, 17 September 2014 by Vgarg2 (talk | contribs)
Jump to navigation Jump to search

Functional Programming Languages i.e Scala over Object Oriented Languages i.e Java

What is Functional Programming

Functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids changing state and mutable data. It is a declarative programming paradigm, which means programming is done with expressions. In functional programming, programs are executed by evaluating expressions, in contrast with imperative programming where programs are composed of statements which change global state when executed. Functional programming typically avoids using mutable state. Examples of functional Programming languages are:

  • Haskell
  • Scala
  • Erlang

What is Object-oriented Programming

Object-oriented programming (OOP) is a programming language model which is organized around objects rather than "actions" and data rather than logic. A program has always been thought as a logical function that takes input data, processes it and produces the output. Object oriented programming cares about the objects we want to manipulate rather than the logic required to manipulate them. Objects here are usually instances of classes which are used to design applications and computer programs. Object-oriented programming languages have a come a long way starting from Simula all the way to languages like JAVA, Ruby etc. Some of the key features of object oriented programming languages are:

  • Encapsulation
  • Inheritance
  • Polymorphism
  • Reflection
  • Abstraction