Barbarian Meets Coding
barbarianmeetscoding

WebDev, UX & a Pinch of Fantasy

6 minutes readtypescript

Rejoice! JavaScript-mancy OOP: Mastering the Arcane Art of Summoning Objects In JavaScript is Complete!

A young wizard practices the fine wizardring arts with mixed success throwing fireballs at her master.
Announcing the completion of my second book JavaScriptmancy OOP and how it came about.

More than two years ago I had an idea.

I was going to write the most awesome JavaScript book of all time mixing two of my passions: programming and fantasy. It would be a complete guide for C# developers coming into JavaScript and it would teach them using common C# patterns and practices as the perfect gateway. All the while carefully navigating the most obscure and arcane parts of JavaScript, and opening the door to all the awesomeness JavaScript has to offer.

To make the book more fun and interesting it would have a theme - Fantasy - and a story - the hero’s (or heroine’s) journey of the wizard Mooleen in her quest to learn JavaScript and save the world. All the chapters would be wrapped within a Fantasy story of epic proportions, with all the code samples and exercises inspired by fantasy and related to the overarching story.

The name of this book was (is) JavaScript-mancy: Mastering the Arcane Art of Writing Awesome JavaScript.

a JavaScriptmancy sample cover

As time went by, I came to realize that the task I had set before me - writing a book about everything JavaScript - would be an arduous and time-consuming one. So after writing more than a thousand pages I decided to split the original volume into smaller ones and thus The JavaScript-mancy Series was born. I did this both for the readers and for my own sake. Being confronted by a 2000 pages book can be daunting for any reader and mustering the willpower to write a 2000 pages volume which could take years to complete is extremely difficult.

So I broke down the original book into two books that would include the more mature parts I had written at the time:

The first of these I published last year and the second one has been my sole focus for the past year. I’m happy to announce that I have just finished the last review for JavaScript-mancy OOP and so my second book is completed (writes Jaime with overwhelming happiness). Behold!

JavaScript-mancy OOP: Mastering the Arcane Art of Summoning Objects Book Cover

556 pages, 12 chapters, ~100K words, thousands of lines of sample code, dozens of exercises, a pretty funny fantasy story and this final pixel art cover that I’m super happy with. All wrapped in lots of love and the infinite care of a craftsman.

Ok! So What’s in The Book?

The goal of this book is to provide a great and smooth introduction to JavaScript Object-Oriented Programming to C# developers. To teach you how you can bring and reuse all your C# knowledge into JavaScript and, at the same time, boost your OOP skills with new paradigms that take advantage of JavaScript dynamic nature.

Since we humans like familiarity and analogy is super conductive to learning, the first part of the book is focused on helping you learn how to bring your OOP knowledge from C# into JavaScript. We start by examining the pillars of object oriented programming: encapsulation, inheritance and polymorphism and how they apply to JavaScript and its prototypical inheritance model.

We continue with how to emulate classes in JavaScript prior to ES6 which will set the stage perfectly to demonstrate the value of ES6 classes.

After that we focus on alternative object-oriented paradigms that take advantage of the dynamic nature of JavaScript to achieve great flexibility and composablity in a fraction of the code: object composition with mixins, traits and stamps.

Later we move onto object internals and the obscure art of meta-programming in JavaScript with the new Reflect API, proxies and symbols.

And finally, we complete our view of object-oriented programming in JavaScript with a deep dive into TypeScript, a superset of JavaScript that enhances your developer experience with new features and type annotations.

Get the Book! Save the World!

And now is time to get the book! JavaScript-mancy OOP: Mastering the Arcane Art of Summoning Objects, a compendium of OOP techniques available in JavaScript, ES2015, ESNext and TypeScript.

JavaScript-mancy OOP: Mastering the Arcane Art of Summoning Objects Book Cover

What’s Next?

Next I’m going to take a super short break to gather some energy and soon I’ll be back with the next book in the series, a book about functional programming in JavaScript.

Director’s Cut. What Didn’t Get Into The Book…

One thing that I really, really wanted to have in this book were illustrations. Fantasy illustrations are a classic ingredient of classic Fantasy books and therefore a perfect candidate for my books. However, my drawing skills aren’t yet up to par as you can see below:

Since I soooo reallly sooo want to have illustrations in these books, I’m going to start devoting more time to enhancing my drawing skills so we can have the JavaScript-mancy series illustrated following the best Fantasy tradition.

Thank you!

I wanted to wrap up this article by thanking everyone who contributed to making this book a reality.

First of all, thank you dear reader for choosing this series. You’ve given me the most valuable thing you have on this earth, your time, and I really hope that you’ve found the time that you’ve spent on any of my books valuable and enjoyable. When I started writing the JavaScript-mancy series little did I know about the humongous quest I was embarking in. Two years later, I have written more than a thousand pages, loads of code examples, hundreds of exercises, spent an insane amount of time reviewing the drafts, reviewing the reviews, reviewing the reviewing of the reviews, etc… But all of this work is meaningless without you, the reader. Thank you for trusting in me and in this series. Go forth JavaScript-mancer!

What follows is a recollection of all the people that have contributed to make this book better.

I would like to start by thanking my beloved wife Malin who’s infinitely patient and supportive of me. She’s the best listener in the history of mankind and an awesome person to exchange ideas with. Also my son Teo who has taught me a new meaning to the expression unconditional love, how infinitely cute babies are, that not all babies look the same and how to be super productive in small intervals of 14 minutes spread throughout the day.

My beloved parents Ricardo and Berta, and my sister Sofia. I’d like to thank my dad Ricardo for been loving, for pushing me to be excellent, and for been The Scourge of God all the times I slacked off throughout my life. I’d like to thank my mum Berta for her infinite love and care, and for her love of books that I seem to have inherited. Thank you Sofia for always taking care of me far better than I take care of you as an older brother.

I would also like to thank all the people that in smaller or greater measure helped me ensure the quality of this book. Infinite thanks to Artur Mizera for his numerous notes, comments, improvements, thorough reviews of the code samples and encouragement. Thank you Nathan Gloyn for being the first person to step up and volunteer to help me review the JavaScript-mancy series. Thank you Andreas Bäcklund for your helpful notes, advice, kind comments and encouragement. Thank you Kári Helgason for your thorough reviews of the first chapters of the book, thoughtful recommendations and encouraging comments.

Finally, I’d like to thank all the awesome members of the JavaScript, Angular and .NET communities, you public speakers, you open source contributors, you platform builders, you authors and bloggers, you conference or meetup organizers, you meetup attendees, you anonymous developer sitting at home, thank you for making the web such a wonderful and exciting place.

One Last Thing

Do you think it’d be interesting to learn more about how I wrote this book? Then stay tuned for an upcoming article on the topic of writing. Until then, take care and be kind!


Jaime González García

Written by Jaime González García , dad, husband, software engineer, ux designer, amateur pixel artist, tinkerer and master of the arcane arts. You can also find him on Twitter jabbering about random stuff.Jaime González García