A Skeptics Guide To Functional STYLE JavaScript



With modern JavaScript, we have seen a rise in ‘functional style’ javascript popularity. This style introduces a whole slew of terms and patterns that have different connotations depending on who you are talking to. Phrases like purity, higher order functions, and currying are thrown around all over the place. What does ‘no side effects’ mean, and what about when you need to get something done? And what in the world is a ‘monad’? In this talk, Jon will walk through the world of the functional programmer and show how these phrases and patterns fit into modern JavaScript development. Jon will work through functions as first class objects in JS, and show how we can use that feature to write clean, maintainable, and reusable code. You will also walk away armed with the information you need to see through all they hype. You’ll have a firm grasp of where these patterns are useful, and as importantly, where they are not.

EVENT: NEJS CONF 2017

SPEAKER: Jonathan Mills

PERMISSIONS: The original video was published on the NebraskaJS YouTube channel with the Creative Commons Attribution license (reuse allowed).

source

Fahad Hameed

Fahad Hashmi is one of the known Software Engineer and blogger likes to blog about design resources. He is passionate about collecting the awe-inspiring design tools, to help designers.He blogs only for Designers & Photographers.

22 thoughts on “A Skeptics Guide To Functional STYLE JavaScript

  • November 4, 2017 at 9:17 pm
    Permalink

    I always thought that the idea of going out of your way to make everything immutable was silly. There is some data that is supposed to be changed.

    I'd like the concept to be expanded further (I still have trouble understanding the usefulness of currying), but I guess that with a limited timeframe that's all we'll get. :X

    Reply
  • November 4, 2017 at 9:17 pm
    Permalink

    Very good talk, to me the functional style gives the most value when you get in to the habit of making small, named functions.
    Any practice should bring simplicity to your program, if it makes thing more complex it is not a good practice.

    Reply
  • November 4, 2017 at 9:17 pm
    Permalink

    Functional programming in JavaScript it dosn't exist!
    But we can apply a functional Style!
    a functional Style :
    it about using less brain power and making things simpler.
    it is about "small" COMPOSABLE things.

    – EVENT: NEJS CONF 2017
    – SPEAKER: Jonathan Mills

    Reply
  • November 4, 2017 at 9:17 pm
    Permalink

    14:00 We like immutable data mainly because referential transparency. In layman's terms, once you've defined a name, you know that everywhere where that name is used it has the same value. Cool, don't need to follow all the code to make sure something's not changed between two points of interest. Not sure what speaker means by "enforcing options", but object comparability is more or less a side effect of referential transparency. A shame that if you're not principled about this, you loose at least half the benefits.

    Reply
  • November 4, 2017 at 9:17 pm
    Permalink

    "Hates functional programming because he's an OOP guy". Riiiight. Case and point, Scala and OCaml are object-oriented — and functional — languages. So… doesn't make much sense? OOP and FP are not strictly mutually exclusive… Also, side effects aren't evil, they're a hassle. We all need to do I/O etc, but it's easier if side effects are controlled and isolated — less mental overhead if not every line in your code can launch the proverbial missiles.

    Reply
  • November 4, 2017 at 9:17 pm
    Permalink

    Does anybody seen errors in slides? if you do `item => {item + 1}` you will get [undefined, undefined, undefined, undefined, undefined] cos you need to get rid of `{}` too!
    the correct arrow function should be even shorter: `item=>item + 1`
    Second: Don't do carrying with event handling functions, cos you can't just simply remove eventListener by applying the same carrying function! You will get memory leak!!!
    The currying function will return new function object each time, so `func()() !== func()()` always!

    Reply
  • November 4, 2017 at 9:17 pm
    Permalink

    What the heck is so bad about anonymous functions? There's no point to creating a gratuitous name for something you use once, it's the code equivalent of the infamous "add 1 to I" comment!

    Reply
  • November 4, 2017 at 9:17 pm
    Permalink

    Shouldn't those functions he assigns to variables so he can more easily call them (addOne and sumList) be put in a const instead of a let considering were talking about functional programming and immutability? 😊

    Other than that he gave a great talk!

    Reply
  • November 4, 2017 at 9:17 pm
    Permalink

    It is good to know that not everyone is super obsessed with functional JS programming. There are opinions that are less religious about functional JS.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *