Successfully reported this slideshow.

Make javascript great again | Odessa Frontend Meetup #8

0

Share

Loading in …3
×
1 of 12
1 of 12

Make javascript great again | Odessa Frontend Meetup #8

0

Share

Download to read offline

Description

Функциональная парадигма или функциональное програмирование — способ написания кода, покрытый множеством мифов и недопониманий. Сторонники говорят, что это самый элегантный способ писать код, а скептики утверждают о непрагматичности и излишней сложности подхода. Алексей Шулев рассказывает об основах функционального програмирования и о том, как писать код в этом стиле в ваших текущих javascript проектах.

Transcript

  1. 1. MAKE JAVASCRIPT GREAT AGAIN FUNCTIONAL PROGRAMMING OR HOW TO Alex Shulev: https://www.facebook.com/Allexy.sleeps

  2. 2. MY HISTORY TO SLAP A FORM ▸ Layout ▸ Basic JS ▸ React/Angular/Vue ▸ Some Node.js ▸ ∞ number of libraries and frameworks ▸ Death
  3. 3. FUNCTIONAL PROGRAMMING ADD UNNEEDED COMPLICATION INTO YOUR CODE Core Functional Programming Concepts ▸ Immutability ▸ Purity ▸ First class functions & Lambda functions (Lambda calculus)
  4. 4. IMMUTABILITY RETURN NEW DATA INSTEAD OF MODIFYING AN OLD ONE var let push pop shift unshift splice for while const concat {...} slice reduce reduceRight map filter
  5. 5. PURITY SAY NO TO SIDE EFFECTS
  6. 6. LAMBDA CALCULUS PASS AND RETURN FUNCTIONS AS VARIABLES
  7. 7. COMPOSING FUNCTION f(a, b, c)(x) = f(a(b(c(x))))
  8. 8. CURRYING f(a, b, c)(x) = f(a)(b)(c)(x)
  9. 9. FUNCTIONAL STYLE IN ACTION ▸ Pointfree ▸ Data last ▸ Abstractions over native methods ▸ Separate Pure functions from Impure 0/ ▸ Sexy “one liners” <3
  10. 10. SUMMARY ▸ Controlling side effects ▸ Testing ▸ Compressed and predictable code Pros Cons ▸ Slow in some specific tasks ▸ Can be confused in the beginning
  11. 11. WANT MORE? ▸ Data structures and algorithms ▸ Mostly adequate guide to functional programming ▸ Libraries: 
 Data transformation: Rambda, Lodash/FP, 
 Monoids: crocks.js, folktale ▸ Fantasy-land, Lambda Calculus ▸ Pure functional languages: Clojure, Haskell, Scala … ▸ Books ▸ Bravery
  12. 12. Ωuestions?

Description

Функциональная парадигма или функциональное програмирование — способ написания кода, покрытый множеством мифов и недопониманий. Сторонники говорят, что это самый элегантный способ писать код, а скептики утверждают о непрагматичности и излишней сложности подхода. Алексей Шулев рассказывает об основах функционального програмирования и о том, как писать код в этом стиле в ваших текущих javascript проектах.

Transcript

  1. 1. MAKE JAVASCRIPT GREAT AGAIN FUNCTIONAL PROGRAMMING OR HOW TO Alex Shulev: https://www.facebook.com/Allexy.sleeps

  2. 2. MY HISTORY TO SLAP A FORM ▸ Layout ▸ Basic JS ▸ React/Angular/Vue ▸ Some Node.js ▸ ∞ number of libraries and frameworks ▸ Death
  3. 3. FUNCTIONAL PROGRAMMING ADD UNNEEDED COMPLICATION INTO YOUR CODE Core Functional Programming Concepts ▸ Immutability ▸ Purity ▸ First class functions & Lambda functions (Lambda calculus)
  4. 4. IMMUTABILITY RETURN NEW DATA INSTEAD OF MODIFYING AN OLD ONE var let push pop shift unshift splice for while const concat {...} slice reduce reduceRight map filter
  5. 5. PURITY SAY NO TO SIDE EFFECTS
  6. 6. LAMBDA CALCULUS PASS AND RETURN FUNCTIONS AS VARIABLES
  7. 7. COMPOSING FUNCTION f(a, b, c)(x) = f(a(b(c(x))))
  8. 8. CURRYING f(a, b, c)(x) = f(a)(b)(c)(x)
  9. 9. FUNCTIONAL STYLE IN ACTION ▸ Pointfree ▸ Data last ▸ Abstractions over native methods ▸ Separate Pure functions from Impure 0/ ▸ Sexy “one liners” <3
  10. 10. SUMMARY ▸ Controlling side effects ▸ Testing ▸ Compressed and predictable code Pros Cons ▸ Slow in some specific tasks ▸ Can be confused in the beginning
  11. 11. WANT MORE? ▸ Data structures and algorithms ▸ Mostly adequate guide to functional programming ▸ Libraries: 
 Data transformation: Rambda, Lodash/FP, 
 Monoids: crocks.js, folktale ▸ Fantasy-land, Lambda Calculus ▸ Pure functional languages: Clojure, Haskell, Scala … ▸ Books ▸ Bravery
  12. 12. Ωuestions?

More Related Content

More from OdessaFrontend

Related Books

Free with a 30 day trial from Scribd

See all

×