I\'ve just recently discovered the functional programming style and I\'m convinced that it will reduce development efforts, make code easier to read, make software more main
Show them jQuery's way of iterating over DOM elements:
$(".magic-divs").click(function(){
// FYI, in this context, "this" will be the element clicked on.
alert("somebody clicked on " + this.id);
this.hide();
});
$(".magic-divs").show();
vs. how most google results for "javascript element by classname" do it:
var arrayOfElements = // this is filled with the elements somehow
for(var i=0,j=arrayOfElements.length; i
Functional programming is useful in everyday stuff like the above!
(note: I don't know if my example fits the exact definition of functional programming, but if it does, than functional programming is awesome)