How JavaScript Works

How JavaScript Works, Douglas Crockford, Virgule Solidus, 2018

You will remember Douglas Crockford, creator of the JSON Data Interchange Format, the world’s most loved data format, and the jslint utility to help you debug your code. He is an opinionated JavaScript expert who wrote “JavaScript: The Good Parts” . The book rightly suggested that you just use the good features of JavaScript, and shun the bad ones.

His new book, How Javascript Works is not for beginners. It is scathingly critical of JavaScript, though the language is clearly the author’s favourite. It explores cases where JavaScript does unexpected things, or things which are clearly incorrect. It compares features with how they work in other languages. For an example of a questionable design decision, numbers are stored as floats. This has implications which can trip you up and we learn all the details.

Crockford devotes a few chapters to discussing the libraries he created to support big numbers and a rational data type. This is an opportunity to learn how to write great code.

A humorous book, net weight 1 pound (it says so on the cover), publisher name is Virgule Solidus. That is printed on the cover in a slanted font with the l’s aligned vertically, and Crockford has explained that in latin both the words mean forward slash. (as you no doubt know, slashes start a comment in Javascript). Crockford has started to correct the English language, and as a first step he has changed the spelling of ‘one’ to ‘wun’. Very good!

The book is clearly self published. I wish O’Reilly had edited it!

Functional Thinking

Functional Thinking, Neal Ford, O’Reilly, 2014

As a programmer, you probably started with Procedural (C, Pascal, Fortran), worked up to OO (C++, Java, ..), perhaps with a side trip to declarative (XSLT). Now, Functional is more prominent (which we could have been doing all along with Lisp). Many people drift into Functional via JavaScript and jQuery but let’s think a bit more before coding.

This book helps you think in the Functional way. Its examples are in the Java ecosystem (including Groovy, Scala and Clojure). It is well written, and you will want to spend lots of time in its 150 pages.

Many of the ideas first appeared in Neal’s articles. You will also like his blog.

Functional Programming for Java

Functional Programming for Java Developers Tools for Better Concurrency, Abstraction, and Agility, Dean Wampler, – 2011

Java programmers will want to read this book. The author also wrote the Scala book. Well writen, just 70 pages!

  • FP is more concise and modular than OOP
  • Java type design—such as avoiding nulls
  • data structures and algorithms using FP principles
  • the Actor model and software transactional memory
  • functional libraries and frameworks