Hello, everyone. Here I’d like to share my thoughts and impressions about the JS courses I’ve recently attended in Binary Studio Academy PRO. The idea of the course was to introduce modern tools, frameworks and approaches that are highly popular now among front-end developers. I should also note that primarily I’m a .Net Developer and don’t spend lots of time on front-end tasks at my projects. That was one of reasons why I decided to attend this course: so that I can learn something new about the stuff that appears to be always somewhere near the dotnet stack from now on.
First lecture was about most popular js-specific patterns which may seem to be simple at first sight but which have proven their usefulness during further hometasks. Yeah, each lecture was followed by a hometask that we were to complete till next lecture. That was one of the keys, why this course had real effect. Only when you get your hands dirty with something you can say that (a) you’ve learned it, (b) you liked it and finally that (c) you will use it in future. Otherwise it’s just nice time spending with colleagues.
Second lecture was an introduction to existing tools, libraries and design patterns that are in front-end development. MVC, MVVM, 2-way binding, AMD and other serious words mixed with library names were on the slides. The idea was to show that there are many approaches to structure and modularize your web-application. The main point was that you SHOULD structure it to reduce problems of maintaining constantly growing codebase along the project lifetime. Your choice may depend on scale and difficulty of your project.
Next several lectures were about Backbone JS as one of the most popular and well-proven front-end framework nowadays. Its idea of having only Views and Models was strange at first glance, because in .Net world we accustomed that design pattern abbreviation that starts with MV-prefix should be followed by some other capital letters, like MVC, MVP or MVVM. Apparently Backbone JS gives you freedom in choosing how you would use these models and views, which is one of its features - not to tie you to strict paradigm that you will eventually bypass. As the framework is highly supported by open-source community and has great potential for extensibility, it has lots of plugins already available to meet your most popular needs. Libraries for local storage support, caching model data, saving model states, configuration of validation were introduced during lecture and tested afterwards within home tasks.
The advantage of Backbone is that it doesn’t force you to some specific way of rendering the view. Although it provides the default template engine, you can and should still use additional libraries to simplify and organize view rendering. So next lectures have covered two most popular libraries for processing views -Marionette and Thorax. Both of them use template engine to process html views from given data thus reducing the boilerplate code of writing rendering logic from scratch.
At the end of the course we’ve built the simple film catalogue with master-detail views powered by Backbone + Marionette or Thorax + several Backbone plugins. Several key points that I’ve learned from the course:
- You can and should decouple your js application into separate logical modules, and there are many libraries that will help you with that.
- These divided modules are better to have in separate files according to AMD or CommonJS. Its also very handy to use Require.js to resolve modules dependencies.
- It’s better to use Backbone with Marionette, Thorax or similar library to clarify rendering code and avoid its duplication in each view.
- It’s better to have real REST-full api on your web-server to use Backbone seamlessly without necessity to override http-related methods.
I will definitely consider using Backbone.js in my future projects, though we should always remember that any framework is a silver bullet and we must use it wisely. Backbone with view library is very convenient for complex web-solutions that could constantly require some tuneup, render optimizations, etc. For simple projects, like several pages with CRUD operations over business entities without tight limitations on response speed, frameworks like Angular JS will suit better. Our lector Nikita promised us that this will be the subject of his next course, so I’m looking forward to it.
Enjoyed this article?
you might want to subscribe for our newsletter to get more content like this: