3 ms·
I attacked the modern Javascript approach through first focusing on functional programming. 1. Python + functional programming in Python Python is hardly a pu
by icc97 10y ago
I attacked the modern Javascript approach through first focusing on functional programming.
1. Python + functional programming in Python
Python is hardly a pure functional language, but it's lovely and simple and has all the core concepts including list comprehensions. This leads you on to...
2. Haskell
If you want to find a pure functional solution to a Python problem, first search for the Haskell one and translate it. Then read Learn You a Haskell [0] which was the funniest programming book I ever read and almost, almost taught me about monads (I had it for a second, then tried to explain it in Python and all was lost)
Now you can relax cause the hard bit is done.
3. Read Javascript the Good Parts and only pay attention to the functional programming bits. Suddenly mentions of currying aren't so scary.
4. Work your way through the funfunfunction [1] videos, especially the functional playlist [2] and for added bonus he has videos where he works through the first few chapters of Learn You a Haskell.
Then you've got map, reduce, filter all completely under control. Now immutability makes more sense, arrow functions don't look so strange, promises are just friendly monads really and we all love those.
Now you've got Immutable.js [3], lodash, underscore all reasonable to understand.
React's moaning about state and pure functions makes reasonable sense.
5. Babel really isn't that hard. Just following the Meteor + React tutorial [5] got that all working without me really noticing. Then, holy moly you're all reacted up, with JSX and pure sweet smelling functions.
6. Follow some of Dan Abramov's excellent blog posts such as about getting eslint up and working in Sublime Text [4].
Yeah that's as far as I've got, but adding in Redux to this mix doesn't seem so scary, at least I understand the language now. Angular will just have to wait.
[0]: http://learnyouahaskell.com/
[1]: https://www.youtube.com/channel/UCO1cgjhGzsSYb1rsB4bFe4Q/
[2]: https://www.youtube.com/playlist?list=PL0zVEGEvSaeEd9hlmCXrk5yUyqUag-n84
[3]: https://www.youtube.com/watch?v=I7IdS-PbEgI
[4]: https://medium.com/@dan_abramov/lint-like-it-s-2015-6987d44c5b48
[5]: https://www.meteor.com/tutorials/react/creating-an-app