Summary
Writing maintainable code is an art. Probably the best book that provides guidance on this is Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin. It's about naming functions, methods, classes, commenting, code formatting, and of course, about the correct use of OOP and SOLID. However, when reusing solutions described in this book, or in any of the Design Patterns series, we have to translate them into JavaScript, and it can be challenging due to the nature of the language. On a higher level, we have to split the code into layers such as presentation, business logic, data access, and persistence, where each bundle of code addresses the one concern and is loosely coupled with others. Here, we may choose an approach to go with. In the JavaScript world, it's usually a derivative of MVC (MVP or MVVM or other). Considering this, a decent programming design requires a lot of abstraction. Today, we can use numerous frameworks. They provide diverse programming paradigms...