nus-cs3281 / 2019

0 stars 1 forks source link

Is functional programming really hard? #33

Closed junming403 closed 5 years ago

junming403 commented 5 years ago

Why functional programming and why it matters?

damithc commented 5 years ago

Need to update with more info (key points etc.) Upload slides too.

junming403 commented 5 years ago

PUNCH

Functional programming is always considered abstract and hard to understand while today I hope to give you a new sense of what is functional programming.

WIIFY

Even though you do not want to be a functional programmer, there are a lot of good practices and concepts you can learn from functional programming.

Roadmap

  1. Functional programming think in terms of the mapping relation between data instead of how to mutating the data.

  2. Functional programming require most of the functions to have no side effects.

  3. Functions with no side effects implies referential transparency.

Key points

  1. Function with no side effects are easier to test.

  2. Implementing programs with a pure core and a thin layer on the outside that handles side effects makes our program more testable and more intuitive.

  3. Referential transparency helps us reasoning and debug our program.

Impact

  1. Know: functional programming is not hard as you heard, there are a lot of good practices worth learning even though you do not want to be a functional programmer.

  2. Believe: functional programming is worth learning.

  3. Do/Call to Action: start learning/ exploring functional programming.

Slides in pdf

FP_junming.pdf