Sharing some notes and insights gained as part of attending Martin Odersky’s Functional Programming course on coursera.org
1) Programming usually taught in colleges (atleast indian ones) is the imperative style which is strongly based on von neumann’s design of what a computer should be like. It means programs in this style are instruction sequences. And a good number of the popular languages are written around this philosophy “compute/execute instruction in processor,store data and results in memory and have a bus that serves as transportation between the two”
Functional programming is different from this. The approach of object oriented programming is orthogonal to both Functional or Imperative i.e. it is independent of the two and can be successfully combined with both the above discussed types of programming.
Martin Odersky says that imperative programming is limited by the “Von Neumann Bottleneck” which is that “One tends to visualize datastructures word-by-word” – I dint quite understand that in entirety – will update the post when i do so
Lets consider Mathematics. Every other topic in mathematics consists of laws that describe relationships between data and a set of operations that can be done on them. So Quote Martin ” If we want to implement high-level concepts following their mathematical theories,then there’s no place for mutation”. So we want to be able to
- concentrate on defining theories for operators
- avoid mutations
- have powerful ways to abstarct and compose theories.
This is what functional programming is all about. and this is the space that functional programming operates in.