Saturday, June 1, 2019

I saw Jonathan Mills speak at the Norwegian Developers Conference on functional style JavaScript.

Scala and Elm are real functional programming languages. MUMPS (Massachusetts General Hospital Utility Multi-Programming System) however is how Jonathan Mills got started. Terraform may be used with Kubernetes orchestrations to expose resources via a ReSTful API. It might be a mistake to go learn Blazor just like you learned Silverlight. JavaScript is the new normal. Let's embrace it, not rebel. Functions are first class citizens in functional programming. In a computer science sense, functional programming is a style of building a structure that treats computation as the evaluation of mathematical functions. For functional programming in JavaScript, avoid changing state and mutable data. Nothing is immutable in JavaScript. Even when you use Object.freeze() you are not really locking things down, however, we still gotta try. Why do we want immutablity as opposed to just changing things under the hood? Immutability curtails poisonous references to other things that can come back to bite you in all sorts of unforeseen, hard-to-troubleshoot ways and it forces you to decide what to do with the output. In currying in JavaScript something like so:

let sum = add(a,b);

 
 

Becomes:

let sum = add(a)(b);

 
 

It's split into a series of functions. Cockford's Law is "Once you understand Monads, you can no longer explain them to someone who does not..." What if I could wrap everything up in a protective case and then warp it with functions? That design pattern leads to The Identity Monad which is the simplest of all monads.

function Identity(value) {
   this.value = value;
}
 
var x = new Identity(5);
 
console.log(x.value);

No comments:

Post a Comment