Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Beginning functional JavaScript : functional programming with JavaScript using ECMAScript 6
Aravinth A., Apress, New York, NY, 2017. 164 pp. Type: Book (978-1-484226-55-1)
Date Reviewed: Mar 22 2018

Functional programming is a programming paradigm centered on the evaluation of mathematical functions and is a declarative language of expressions. Side effects are unacceptable. Whenever a function is evaluated given a set of inputs, the same result is obtained. Functions are the objects of processing. There are many languages that embody the functional paradigm as a significant character of the language, such as Lisp, Scheme, OCaml, and Haskell. Other languages can be written in a manner that satisfies the functional model as well, JavaScript included. JavaScript can be used in a straightforward, imperative manner, like C++, Java, or Fortran, but it can also be written in a functional manner.

This book shows how the latest standard of JavaScript (ECMAScript 6 or ES6) ought to be written as a functional computer language. This means that the author has two items to contend with--show how the language can be used as a functional language, and embody examples in the syntax appropriate to the latest standard. There are major differences in the syntax for writing functions between ES6 and earlier versions. The reader should be adept in handling the most recent syntax of the language in order to follow the presentation. There is a workaround for those who prefer the syntax in older versions of the language. It involves a translation of the ES6 syntax in the examples using a tool called Babel, but readers are on their own after they translate. It would be better to learn the latest syntax than to translate and try to work with older syntax versions of JavaScript.

All examples in the book are in the latest syntax and can be downloaded from a GitHub archive. Each chapter takes a somewhat simple problem and then develops a solution to it. Studying the complete listings along with the code fragments in the chapter is necessary to comprehend what is taking place.

The book is quite short--164 pages including the index. It is divided into ten chapters and a single-page appendix on installing Node.js, NPM, and Babel, the software support used throughout the book. All example programs are presented as Node projects. The first chapter is a short introduction to the functional paradigm as different from the imperative or object-oriented paradigms. The second chapter introduces the arrow syntax of functions in ES6 and leads the reader through several examples of simple functions. Chapters 3 and 4 deal with higher-order functions and closure, two important issues in functional programming. Functions are objects for processing, and their scope is handled correctly so that their behavior is uniquely determined by their inputs. The fifth chapter discusses the action of functions on arrays using functional, instead of imperative, programming. Chapters 6 and 7 are paired conceptually as opposite processes. The sixth chapter is on currying and partial application for breaking down the action of functions, and the seventh is on functional composition and pipelines in creating functional action. Error handling and exceptions are the topics of the eighth chapter, followed by monads in the ninth, both treated as functors. The tenth chapter discusses generators, a new feature of ES6 to make asynchronous code look synchronous.

Although the publisher claims that the user level for this book is beginning to advanced, a novice would struggle. The reader who would most benefit from this book is one who is already knowledgeable and experienced in writing JavaScript, has worked with Node projects and NPM, and has worked with Ajax, JSON, and similar advanced topics.

More reviews about this item: Amazon, Goodreads

Reviewer:  Anthony J. Duben Review #: CR145925 (1806-0268)
Bookmark and Share
  Reviewer Selected
Featured Reviewer
 
 
Applicative (Functional) Programming (D.1.1 )
 
 
Javascript (D.3.2 ... )
 
 
Reference (A.2 )
 
Would you recommend this review?
yes
no
Other reviews under "Applicative (Functional) Programming": Date
Functional programming with Hope
Bailey R., Ellis Horwood, Upper Saddle River, NJ, 1990. Type: Book (9780133382372)
May 1 1992
Prospects for functional programming in software engineering
Banâtre J., Jones S., Le Métayer D. (ed), Springer-Verlag New York, Inc., New York, NY, 1991. Type: Book (9780387538525)
Aug 1 1992
An introduction to functional programming
Bird R. (ed), Wadler P., Prentice Hall International (UK) Ltd., Hertfordshire, UK, 1988. Type: Book (9780134841892)
May 1 1992
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy