Let’s explore the journey of Mario Casciaro and Luciano Mammino, the authors of Node.js Design Patterns, Third Edition, and get some insights on how they mastered the platform.
What was your approach to learning Node.js when you started?
Mario Casciaro: When I started experimenting with Node.js, the platform was still in its infancy. I think it was around 2012, just 3 years after Ryan Dahl presented his new technology to the world. The learning material was very limited and the approach to development was completely different to that of my favourite technologies at the time (Java, C and PHP). I started reading the official documentation and, as always, worked on side projects. I immediately enjoyed creating software with Node.js, so I started working on larger projects such as a blogging platform and an Inversion of Control container. I also read the code of the most famous Node.js developers of the time to extract patterns and principles.
Where does Node.js stand in comparison to its alternatives, including .NET, PHP, etc.?
Most alternative languages are synchronous by default, which means that, in order to be able to write asynchronous code, the developer has to master the complexity of threads. Conversely, Node.js, with its “asynchronous by default” approach and its design based on the event loop and the reactor pattern, effectively lowers the barrier to entry to writing effective asynchronous code.
Which type of projects are best suited to be coded in Node.js?
Node.js is a great choice for pretty much any kind of application that relies heavily on IO: web servers, IoT devices, distributed systems, etc. Throughout the book we present many real-life examples including a website spider and downloader, a streaming file archive pipeline, a full stack web application (frontend and backend), a dynamic load balancer, a peer-to-peer network for web services, a distributed real-time chat application and a worker pool for background jobs.
Mario, you founded FrontendRobot.com, an online service that simplifies end-to-end testing. What motivated you to start your own entrepreneurial journey?
Mario: I’ve always worked on side projects mainly to learn new things or to solve my own problems. Frontend Robot was born from one of these side projects.
I realized that testing was for me one of the aspects of software development that I enjoyed the least and consequently was also the aspect that I neglected the most in my own software projects. To start creating end-to-end tests you have to choose a framework, then learn the framework, then write the actual test creating selectors for elements which you have to look up in a separate browser window, then after all that, you need to setup a testing infrastructure with browsers and test runners on one or more servers. This process would intimidate any software professional, without considering the costs involved in creating and maintaining such testing infrastructure. This is clearly not an ideal situation, since testing is actually a critical step in software engineering.
That’s how Frontend Robot was born. Its goal is to make testing fun, enjoyable and approachable for everyone. You can literally go from signing up to creating and running your first test in just a couple of minutes. There is no code to write or servers to maintain, so that the users can focus on just one thing: testing.
And of course, most of FrontendRobot is built on Node.js using many of the patterns and techniques described in Node.js Design Patterns.
Luciano, you started your professional career by freelancing instead of joining an established firm. What inspired you towards freelancing?
Luciano: I started my career very early when I was studying for my Computer Science degree. It wasn’t an easy choice, but freelancing allowed me to keep my work schedule flexible so I could complete my degree. Interestingly enough, freelancing also exposed me to a vast variety of projects which probably helped me to ramp up quickly in my career.
Tell us a bit about your book Node.js Design Patterns, Third Edition? What makes this book necessary?
Node.js Design Patterns, Third Edition aims to be the go-to book for Node.js developers who want to master the most important patterns and best practices to be able to take Node.js applications to production with confidence. In this book we have collected many of the real-life lessons that we learned in our 15+ years of collective experience with running production-grade Node.js applications. We believe that Node.js is a great piece of technology which allows for rapid prototyping of applications. We feel that there isn’t a great bulk of literature on how to take these prototypes to the next level, with Node.js Design Patterns, Third Edition we want to fill this gap.
Mario Casciaro is a software engineer and entrepreneur who worked at IBM for a number of years. He currently splits his time between Var7 Technologies (his own software company) and its role as Lead Engineer at D4H Technologies where he creates software for emergency response teams.
Luciano Mammino wrote his first line of code at the age of 12 on his father’s old i386. Since then, he has never stopped coding. He is working at FabFitFun as Principal Software Engineer where he is building software to serve millions of users every day.