A Gentle Introduction to Functional JavaScript

Functional Programming is available in many programming languages today. You probably know that FP is possible in JavaScript – but did you know that writing FP style JavaScript will lead to cleaner, more maintainable code? In this session, we’ll explore writing FP style JavaScript and cover the basics, and intermediate techniques. We’ll do a functional refactor and explain the reasoning along the way.

We’ll use mostly basic JavaScript and the underscore library for code examples to demonstrate Functional Programming in a simple to understand, and more practical, way.

Key takeaways
How to write idiomatic Functional JavaScript
How to write clean JS for better testing
Techniques for understanding how to write maintainable Functional JavaScript


Øredev 2017


Pratik Patel


Øredev Conference Organizer provided Coding Tech with the permission to republish this video.

Additional material for JavaScript learners:
https://amzn.to/2JrUINQ Eloquent JavaScript, 3rd Edition: A Modern Introduction to Programming
https://amzn.to/2HwAMYd Simplifying JavaScript: Writing Modern JavaScript with ES5, ES6, and Beyond
https://amzn.to/2Cq5bmL JavaScript: JavaScript Programming.A Step-by-Step Guide for Absolute Beginners
https://amzn.to/2uhIvAP How JavaScript Works
https://amzn.to/2CwS2bU The Modern JavaScript Collection


Ежевичное Варенье says:

in Russia, at any conference, we can not even imagine words like “crap”, but English speakers very confortable about speaking crap or fuck at conferences or on tv.

David Lloyd-Jones says:

I suggest a rule for YouTube: Pointing a camera at somebody giving a speech to an audience, e.g. a classroom, commercial get-together, or corporate hoo-ha, is not YouTube material.

If you want to report an event, e.g. Oracle had an annual Festival of Java, that’s news. It’s worth a 45-second squib. If you want to summarize what everybody said about Java at the confab, fine, that’s a five-minute piece.

If there were ten sessions, with each one containing twenty minutes of teaching and 30 minutes of Hello everybody, hold up your hands, say hello, lookit the wonderful goodies we’ve got to sell, then edit each to 15 minutes with good pedagogical slides (full size, centered on screen) and maybe a hand-out.

If you put the whole thing up on YouTube, you’ve just subtracted thousands of hours of attention from the wealth of the world. Don’t do that.

Marek Bystrzewski says:

a waste of time

Omar Gonzalez says:

Doesn’t really make it any clearer why is JS “Functional” Programming actually better, if anything it does seems to go a long way to make simple things overly comboluted

Also, for loops ARE OK …

Ash Bloomingdale says:

Would have rather learned this in vanilla JS

cparker4486 says:

Great talk but there’s a reason typographers use spaces: it makes reading individual words easier.

Bruno De Luca says:

I used to write a For loop in three lines of code…. but know that I watched this video i can do it in 1!

Łukasz S says:

Too bad you are using underscore, instead of plain JS. It could be easier to explain currying IMO.

meanmeanpt says:

This talk is a mess and difficult to understand. I also had to stop viewing it a lot o times due to induced sort of a boat sickness

Albert F says:

Thank you Pratik. Engaging talk.

TheJubeiam says:

This is bit outdated, so remember this when watching.

nii-san! says:

is currying functions somehow different than factories? It seems the overhead of anonymous functions or closures for no additional benefit over a factory is counterproductive. Maybe I am wrong?

Sean Spicer says:

ima python bc of (my def of) “aesthetics”. but i would proudly call a js my brother. modern js rivals py in aesthetics. further, bdfl (rip) doesn’t like functional so we aren’t in clashing domains. yall have great leadership. js used to be a meme but the modern js is aesthetics. py wasn’t a meme but people tried the “real (wo)men write assembler” on it. “its just a scripting language”. mhmmm.

Lee Roy says:

*Why this is koalaty*
and we should demand all instructors present this way:
• 9:20 Uses visual/graphical representations
• 12:20 , 25:09 , 35:42 Says how to recognize suitable cases _[this one-to-one] screams to us this is a map operation_ . Leverage the mind’s pattern-matching abilities with associations _noun – object oriented, verb – functional_
• Exemplifying within a relatable domain – cooking
• Uses simple codebase. Simple stuff can be dissected more comprehensively
• 23:29 , 34:37 Offer high-level guiding principles and heuristics. Make the model explicit and discuss pros and cons of modeling choices.
• 27:42 , 40:45 Address applicability often, learners can make sure the goal and benefits interest them
• 34:10 Details strategy, tactics, workflow. A recipe for what applying the knowledge looks like.
• Immerses you in the vocabulary. Repeat terminology often and from different angles.

_This wisdom extends to all things._

Of course, the proper kerning + not using all caps + smooth transitions criticism applies, as others were quick to point out.

Eichro says:

I haven’t started the video yet. Let’s see if he goes deeper than filter/map/reduce…

tree.g.b Chen says:

13:13 Sometimes we doing the same procedure again but getting the different result … this characteristic make me a bit hate the software stuff, sometimes we just don’t know the reason, it is nonsense, and break the pace of debugging.

Helvetica says:

He should name it “How I use underscore”

Andyson says:

I don’t understand why JavaScript is so hot these days

 Write a comment


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!