Book Review: Mastering TypeScript

June 15th 2015 TypeScript Book Review

Nathan Rozentals: Mastering TypeScript

Once again I received a review copy of a book from Packt Publishing. This time it was Mastering TypeScript by Nathan Rozentals. Its subject happened to relate to some new responsibilities I have at work recently, therefore I am now much more interested in it than I would have been in the past.

The book starts out pretty slow with the necessary introduction to the language and the tooling available for it. Complete beginners in TypeScript will probably appreciate this part the most, but it is really exhaustive, therefore even existing developers might learn something new. The same goes for type definitions; not only will the reader know how to use them, he will also learn to write his own, for JavaScript libraries that don't have them yet.

Still, in my opinion the real value is delivered in the later chapters of the book, where the focus shifts from the language specification to real-world scenarios. The author is reinforcing best practices all the time: explaining the SOLID principles, promoting testing and test driven development, implementing design patterns, such as factory, service locator, mediator and others. Seeing real software engineering approaches applied to TypeScript and JavaScript code is really valuable.

Unfortunately, JavaScript development today is strongly dependent on 3rd party libraries. This is a quickly evolving field with many alternatives available for every task. Because of this, the author couldn't completely avoid being subjective in his choice of frameworks, which he used in his samples. I like, how he compared them through the lens of a TypeScript developer, although you still shouldn't regard it as a guide to choosing the right one. It's just an incomplete overview that can get you started, when picking your own set of MV*, testing or modularization libraries.

I have mixed feelings about the custom frameworks developed throughout the book, implementing reflection, service locator and message bus functionalities. Although they have pedagogical value, they might be too tempting to use in own projects. In my opinion using these instead of maintained alternative open source libraries is not a good idea; and this isn't clearly communicated in the book.

In spite of that I have no reservations about recommending the book to any existing or future TypeScript developer. It can serve as the first book to start learning the language, but can teach you a lot even if you have already been programming in it for a while. Some of the samples towards the end of the book can become quite complex, but if you read the whole book and occasionally look at the code downloads, you should still be able to follow them.

The book is available on Amazon and sold directly by the publisher.

Get notified when a new blog post is published (usually every Friday):

If you're looking for online one-on-one mentorship on a related topic, you can find me on Codementor.
If you need a team of experienced software engineers to help you with a project, contact us at Razum.
Creative Commons License