Functional Programming, JavaScript and UI - some neophyte questions

Posted by jamesson on Programmers See other posts from Programmers or by jamesson
Published on 2012-07-07T20:58:29Z Indexed on 2012/07/07 21:22 UTC
Read the original article Hit count: 206

This has been discussed in other threads, however I am hoping for some comments relevant to UI and an explanation of some vitriol I had flung my way in a Certain IRC Channel Which shall remain nameless.

In the discussion here, the comments in the accepted answer suggest that I approach the given code from a functional perspective, which was new to me at the time. Wikipedia said, among other things, that FP "avoids state and mutable data", which includes according to the discussion global vars. Now, being that I am already pretty far along in my project I am not going to learn FP before I finish, but...

  1. How is it possible to avoid global vars if, for instance, I have a UI whose entire functionality changes if a mousebutton is down? I have a number of things like this.
  2. Why was there a strong negative reaction in the Certain IRC channel to implementing FP in JS? When I Brought up what seemed to me to be supportive comments by Crockford, people got even madder. Now, this being IRC there is no rep system, but they at least gave indication of having read TGP (which I haven't gotten to yet) so I'm assuming they're not idiots.

Many thanks in advance

Joe

© Programmers or respective owner

Related posts about JavaScript

Related posts about functional-programming