It's been five years since I published my book, Functional Programming in Javascript. And since then a dramatic shift in the programming language has unfolded. Ideas that had been only talked about for years, in stuffy books such as mine, had quite suddenly become standard and reliable practice. New concepts have been added to the language, such as arrow function expressions and promises. Javascript programmers have fully embraced its functional programming bones hidden under its C-like veneer.
It would be presumptuous of me to say my book had anything to do with this shift. But sometimes it's nice to think of the possibility that somebody who read my book had gone on to implement one of the many new platforms, structures, APIs, or libraries that embrace Javascript's functional programming paradigm. If that's true, then it could be one of my greatest contributions to computer science. Even if it was riddled with grammatical errors!
I have been content these last five years merely using these functional programming ideas I wrote about for my own projects. Underachieving as ever in the basement of the public radio station who employs me.
Enough about me, though. Here are some of my favorite passages from the book, Functional Programming in Javascript:
- "For decades, functional programming has been the darling of computer science aficionados, prized for its mathematical purity and puzzling nature that kept it hidden in the dusty computer labs occupied by data scientists and PhD hopefuls."
- "The next evolutionary leap in Moore's Law might be a compiler that parallelizes our code for us, and could function composition be it? No, it doesn't quite work that way. The JS engine is what is really doing the parallelization, not automagically but with well though-out code."
- I even have a sweet quote from the lead programmer for Doom, John Cormack: "'Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function.'"
- "If you think all this abstract babble about categories, functors, and monads has no real-world application, think again. jQuery, the popular JavaScript library that provides an enhanced interface for working with HTML is, in fact, a monadic library." BOOM!
But that was five years ago. Today, if you put the title of the book into Amazon, it doesn't even come up on the first page of the search results. And several newer books from the same publisher show up sooner than the original. Mastering Javascript Functional Programming, Mastering Javascript Functional Programming: 2nd Edition, Hands on Functional Programming with TypeScript, and many more.
Should I write a 2nd edition? The publisher has asked me several times, though the frequency of those requests has deminished as of late. But I think not. I didn't exactly earn a whole lot of money, and now I'm only getting a less than $100 a year in royalties.
But of course it's not all about the money. About a year ago I was in one of the world's largest book stores - Powell's City of Books in Portland, OR. After locating the magazine I was looking for (a copy of Grassroots Motorsports which had a page about my project car), I found myself looking for another publication that was personal to me: Functional Programming in Javascript by Danny Mantyla. And to my astonishment, I found it. A used copy! There was even notes written in the margin.
I put the copy back on the shelf where I found it. Maybe somebody else will find it too.