The Joy of JavaScript
Luis Atencio
  • MEAP began March 2019
  • Publication in October 2019 (estimated)
  • ISBN 9781617295867
  • 325 pages (estimated)
  • printed in black & white

A great deep dive into Javascript fundamentals which many other books lack.

Ray Booysen
Whether for building interactive browser-based applications or creating server-side applications in Node, JavaScript is the most widely used language for web programming. With new features, language improvements, paradigms, and potential use cases appearing regularly, there’s never been a more exciting time to be a JavaScript developer. In The Joy of JavaScript, author and JavaScript expert Luis Atencio teaches you key design concepts that lead to clean, lean, modular, and easy-to-maintain code.
Table of Contents detailed table of contents

Part 1: Foundations

1 JavaScript Reloaded

1.1 JavaScript + Babel: past, present, and JS.Next

1.2 One language to rule them all

1.3 JavaScript’s object model

1.3.1 No blueprints, just prototypes

1.3.2 Object modeling

1.4 Sample application: an immutable transaction system

1.5 Inheritance vs composition: why not both?

1.6 Higher-order functional programming

1.6.1 Function composition

1.6.2 Higher-kinded composition with ADTs

1.7 Separating concerns like a pro

1.8 Taming asynchronous behavior

1.9 Types for JavaScript?

1.10. Transpilers and modern JS

1.10. Summary

2 Prototype-centric object modeling

2.1 Reviewing "prototypal inheritance"

2.1.1 Understanding the property resolution process

2.1.2 Differential inheritance

2.2 Constructor functions

2.2.1 Revealing internal object plumbing

2.2.2 Abstracting object creation

2.2.3 The new gotchas

2.3 Class-based inheritance

2.3.1 Prototypes !== classes

2.3.2 Limitations of JavaScript’s class system

2.4 Summary

3 Delegation-based, compositional object models

3.1 Object/behavior delegation with OLOO

3.2 Types of delegation

3.2.1 Explicit delegation

3.2.2 Implicit delegation

3.3 Functional mixins

3.3.1 Object.assign uncovered

3.3.2 Assignment vs definition

3.4 Assembling objects using mixins

3.4.1 Mixin linearization

3.5 Summary

Part 2: Just enough FP

4 Writing composable, pure code

4.1 What is functional programming, exactly?

4.1.1 Functions as data

4.1.2 Guidelines for purity

4.2 Composition: the functional way

4.2.1 Decomposing complex code to obtain simpler code

4.2.2 Working with side effects

4.3 Lazy coding

4.3.1 Curried function application

4.3.2 The curry and composition dynamic duo

4.4 Working with immutable objects

4.5 Point-free coding

4.6 Imperative to functional transformation

4.7 Looking into the future

4.7.1 Function binding

4.7.2 Pipelining

4.8 Summary

5 Higher-kinded composition

5.1 Closing over data types

5.1.1 Using containers for encapsulation and immutability

5.1.2 Contextual composition

5.1.3 JavaScript data types

5.2 New Array APIs: {flat, flatMap}

5.2.1 Array.prototype.flat

5.2.2 Array.prototype.flatMap

5.3 The map/compose correspondence

5.4 Universal protocols

5.4.1 Functors

5.4.2 Monads

5.5 Kinds of Algebraic Data Types

5.5.1 Records

5.5.2 Choices

5.6 Implementing the Validation ADT

5.6.1 Why use an ADT?

5.6.2 Modeling success and failure

5.6.3 Basic usage

5.6.4 Higher-kinded composition with Validation

5.6.5 Point-free coding with ADTs

5.6.6 Validating complex data structures

5.6.7 Third-party integration

5.7 ADTs that help shape the future of JavaScript

5.7.1 Maybe and optional chaining

5.7.2 Try and throw expressions

5.7.3 Pattern matching

5.8 Summary

Part 3: Code as data

6 Modular programming

7 Hooked on metaprogramming

Part 4 Scalable software

8 Untangling async flows

9 State Management that scales

10 A look into typed JavaScript<A>

Appendixes

Appendix A: Babel

Appendix B: ESLint

Appendix C: Prettier

Appendix D: Debugging: how to run and debug the code: Git, Docker

Appendix E: TC39 proposals to watch out for

About the Technology

As web applications have become more complex and sophisticated, JavaScript has advanced with them, thanks in large part to TC39, a JavaScript task group committed to evolving and improving the language. JavaScript has become lightweight and dynamic, with first-class functions and support for classes and asynchronous programming. JavaScript is multi-paradigm, supporting object-oriented, functional, reactive, and event-driven styles of programming. And transpilers like Babel make it possible to compile code written in other languages into JavaScript. It’s never been easier, more rewarding, or more joyful to be a JavaScript developer!

About the book

The Joy of JavaScript teaches you how to design JavaScript applications founded in sound computer science concepts and real-world industry success. First, you’ll get up close and personal with JavaScript’s object system. From there, you’ll dive into programming objects and functions. As you build various domain models, you’ll learn the pros and cons of techniques ranging from prototype-centered tightly coupled object configurations to loosely coupled delegation-based compositions. You’ll also explore ways of connecting objects with pure functions, and driving business logic with immutability and algebraic data types.

Using JavaScript’s shiny new module system and dynamically hooking into your data with Proxy and Reflect APIs, you’ll master tracing, logging, and performance trackers without having to modify your application components. You’ll also discover blockchain concepts as you develop pieces of a transaction management system. Along the way, you’ll explore topics like using JavaScript with different paradigms and how to overlay type information into JavaScript without having to switch to TypeScript. Illustrated, easy-to-grasp use cases and a hands-on peer-to-peer project lock in all you’ve learned, then take your learning further by showing you how to untangle complex asynchronous behaviors using promises, generators, and ES7 async-await syntax.

What's inside

  • JavaScript’s objects and module system
  • Working with higher order functions
  • Driving application business logic with functional programming principles
  • Dynamically hooking into data with Proxy and Reflect APIs
  • Taming complex asynchronous behavior using reactive programming
  • Static type-checking with Flow
  • A hands-on peer-to-peer event driven system project
  • Future JavaScript proposals coming down the pike

About the reader

Perfect for intermediate JavaScript developers with basic familiarity with HTTP, HTML/CSS, and Git/CLI.

About the author

Luis Atencio is a software engineer for Citrix Systems, where he develops and architects web applications leveraging Java, PHP, and JavaScript platforms. He blogs about software engineering at http://luisatencio.net, has spoken in many dev conferences, and has written articles for PHPArch magazine and DZone Refcardz. Luis is the author of Manning’s Functional Programming in JavaScript and the co-author of Manning’s RxJS in Action.

Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
MEAP combo $39.99 pBook + eBook + liveBook
MEAP eBook $31.99 pdf + ePub + kindle + liveBook
Prices displayed in rupees will be charged in USD when you check out.

placing your order...

Don't refresh or navigate away from the page.

FREE domestic shipping on three or more pBooks