/Functional-101

A quick primer on functional programming concepts

Primary LanguageRuby

#Functional Programming: A Primer

Skill Level: Intermediate
Time Limit: 30-45 minutes

Functional programming (FP) is the new hot topic in the world of programming. It's defined as a style of building the structure and elements of computer programs that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data.

Though, there are a lot of terms & properties associated with FP including immutable data, first class functions, and tail call optimisation. It can best be characterised as...

The absence of side effects. It doesn't rely on data outside the current function, and it doesnt change data that exists outside the current function. -- Mary Rose Cook

##Instructions

  • Implement each exercise and follow the instructions
  • Review these glossary terms

##Things to consider

  • Do not use shared or global variables
  • Don't iterate over lists. Use map and reduce
  • Use functions that take parameters
  • Don't instantiate variables inside of functions
  • Handle all data changes with return values
  • Utilize recursion when possible

##Sources