Intrestingly it seems that the functional version he proposed is much faster than the OO version. http://jsperf.com/oop-vs-ramda
Functional Programming using JavaScript
31–40 of 88 posts
Re: Functional Programming using JavaScript
#32finally, a slide deck that uses `history.replaceState` instead of `history.pushState`. no more having to hit "back" 90 times to exit the deck. how the latter ever became a pattern is beyond me. [EDIT] it probably became a pattern because of browsers that didnt implement the history API, so all hashchange events were pushed onto the history stack.
To be honest, using replaceState for this doesn't seem to make sense to me. A user would probably want to go backward and forward through this using browser history navigation (for instance using the navigation buttons on their mouse). If you're launching a link from a page you expected to come back to, surely opening the link in a new tab would be the way to accomplish this?
When the user is in a linear sequence such as a slide deck, photo gallery or similar, the "previous"/"next" buttons don't map to the browser's back/forward buttons, they navigate the sequence. Littering the history with the navigation history of this sequence does not make sense.
However, it'd be nice if browsers could perhaps record the history (perhaps as some kind of sub-tree history), allowing me to see that I not only visited this slide deck, but that I also visited these specific slides.
Re: Functional Programming using JavaScript
#33There is also @fogus' book: http://shop.oreilly.com/product/0636920028857.do I haven't read it yet.
It's a fantastic book for getting your mind used to the functional way of thinking. I'd also recommend JavaScript Allonge on the same topic. https://leanpub.com/javascript-allonge
Re: Functional Programming using JavaScript
#34I believe this is the author of Ramda, yes? I can't find the talk, anybody got a link? (Ramda is pretty bad ass.) http://ramda.github.io/ramdocs/docs/
Re: Functional Programming using JavaScript
#35I believe this is the author of Ramda, yes? I can't find the talk, anybody got a link? (Ramda is pretty bad ass.) http://ramda.github.io/ramdocs/docs/
Re: Functional Programming using JavaScript
#36For those you want to learn the functional programming I'd suggest to immedeately commence looking at Ocaml/Haskell instead to see the real big picture. Because it's of course adorable that you can write map and compose in JS (it's 2014, it can do it everywhere), but FP = many more serious things.
Learn Haskell/OCaml and you'll see how to really take this kind of reasoning many, many orders of magnitude upward. Learn Coq/Agda to see yet another meteoric jump.
Re: Functional Programming using JavaScript
#37For those you want to learn the functional programming I'd suggest to immedeately commence looking at Ocaml/Haskell instead to see the real big picture. Because it's of course adorable that you can write map and compose in JS (it's 2014, it can do it everywhere), but FP = many more serious things.
Re: Functional Programming using JavaScript
#38I put together a similar talk last summer: http://thedrearlight.com/functional-js-wut unfortunately, don't have the vid either, but the slides might be complementary to the ones linked by the OP. --edit It's formatted kinda weird, where both up/down and left/right arrows navigate through the different sections.
Re: Functional Programming using JavaScript
#39I assume these slides are from a talk?
Re: Functional Programming using JavaScript
#40Bravo for promoting functional programming and showing how it can be done in JavaScript. One issue concerns me, though: using strings to reference attributes. This makes static checking tools much less useful and can lead to difficult to find errors due to refactoring and typos.
Promoting FP using SQL as an example for encoding business logic doesn't look to me like a nice example...