Save 37% off PRO during our Black Friday Sale! »

They're functional! They're efficient!! They're persistent data structures!!!

They're functional! They're efficient!! They're persistent data structures!!!

Functional programming is a cool paradigm to work in, because avoiding mutable objects can save you a lot of headaches! But when you’re using only immutable objects, you have to create a new object each time something changes, which means copying even the parts that didn’t change! This can slow things down, and you might even run out of memory!

Fear not: persistent data structures to the rescue! They save you time and space when modifying objects, by reusing parts of the old object that you don’t need to change! Let’s find out what that means and why it is SO AWESOME! And let’s learn how to easily use these structures in JavaScript!

(Given at !!Con 2016 - http://bangbangcon.com/)

654527a5cff1756177ef0b1bb0af7aa3?s=128

Anjana Sofia Vakil

May 08, 2016
Tweet

Transcript

  1. 7KH\¶UH« )XQFWLRQDO (IILFLHQW 3HUVLVWHQWGDWDVWUXFWXUHV #$QMDQD9DNLO &RQ

  2. )DOO

  3. )XQFWLRQDO3URJUDPPLQJ URFNV

  4. ,PPXWDELOLW\ URFNV

  5. 1RERG\VLWVOLNHWKLVURFNVLWV <RXURFNURFN 7KHURFNMXVWVLWVDQGLV <RXVKRZXVKRZWRMXVWVLWKHUHDQGWKDW VZKDWZHQHHG ,䙧+XFNDEHHV  ,OOXVWUDWLRQE\0DUFR3LD]]D

  6. » ¼ ½ ¾ ¿ À Á Â ,QWKHODQGRIPXWDELOLW\ AJJ

  7. » ‹ ½ ¾ ¿ À Á  ,QWKHODQGRIPXWDELOLW\ AJJ

  8. 2YHUKHDG EXJV

  9. ,QWKHODQGRILPPXWDELOLW\ » ¼ ½ ¾ ¿ À Á Â AJJ

  10. ,QWKHODQGRILPPXWDELOLW\ » ¼ ½ ¾ ¿ À Á Â AJJ

    » ‹ ½ ¾ ¿ À Á  RJJ
  11. &RS\LQJZDVWHVWLPHVSDFH

  12. 7KHUHPXVWEHDEHWWHUZD\

  13. 3HUVLVWHQW'DWD6WUXFWXUHV

  14. 2OGYHUVLRQVQHYHUFKDQJH WKH\MXVWVLWDQGDUH

  15. 1HZYHUVLRQVFUHDWHGHIILFLHQWO\ '

  16. 0DJLF"

  17. 5HXVHXQFKDQJHGSDUWV

  18. /LQNHGOLVWV » ¼ ½ ¾ AJJ 

  19. /LQNHGOLVWV » ¼ ½ ¾ AJJ » ‹ RJJ 

  20. /LQNHGOLVWV » ¼ ½ ¾ AJJ » ‹ RJJ 

  21. 7UHHV ,OOXVWUDWLRQE\0DUFR3LD]]D

  22. 7UHHV :HOODFWXDOO\ WULHV ,OOXVWUDWLRQE\0DUFR3LD]]D

  23. 7UHHV :HOODFWXDOO\ WULHV 1RZHOODFWXDOO\¶V ,OOXVWUDWLRQE\0DUFR3LD]]D

  24. 7UHHV 2RSVVRUU\ :HOODFWXDOO\ WULHV 1RZHOODFWXDOO\¶V ,OOXVWUDWLRQE\0DUFR3LD]]D

  25. 7UHHV » ¼ ½ ¾ ¿ À Á Â

  26. 7UHHV » ¼ ½ ¾ ¿ À Á Â

  27. 7UHHV » ¼ ½ ¾ ¿ À Á Â

  28. 7UHHV » ¼ ½ ¾ ¿ À Á Â

  29. 7UHHV » ¼ ½ ¾ ¿ À Á Â AJJ

  30. 7UHHV3DWKFRS\LQJ » ¼ ½ ¾ AJJ ¿ À Á Â

  31. 7UHHV3DWKFRS\LQJ » ¼ ½ ¾ AJJ ¿ À Á Â

    ‹ »
  32. 7UHHV3DWKFRS\LQJ » ¼ ½ ¾ AJJ ¿ À Á Â

    ‹ »
  33. 7UHHV3DWKFRS\LQJ » ¼ ½ ¾ AJJ ¿ À Á Â

    ‹ »
  34. 7UHHV3DWKFRS\LQJ » ¼ ½ ¾ AJJ ¿ À Á Â

    ‹ » RJJ
  35. 7UHHV3DWKFRS\LQJ6WUXFWXUDOVKDULQJ » ¼ ½ ¾ AJJ ¿ À Á Â

    ‹ » RJJ
  36. 7UHHV3DWKFRS\LQJ6WUXFWXUDOVKDULQJ » ¼ ½ ¾ AJJ ¿ À Á Â

    ‹ » RJJ
  37. ,PPXWDELOLW\  &RS\LQJ  6KDULQJ '

  38. 0RUL KWWSVVZDQQRGHWWHJLWKXELRP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