Mindblown: a blog about philosophy.

  • Conclusion

    In the first part of this lesson you saw how to improve the performance of code that uses jQuery by selecting elements the right way. We discussed when to take advantage of the context parameter of jQuery() and when to avoid its use. We also covered how to avoid using the Universal selector. Later you learned how to achieve…

  • Starting with Backbone.js

    As you’ve seen, Backbone.js allows developers to break their code into small pieces. Let’s take a brief look at its components. Model Models are the objects representing the data of your application. Models have as properties the attributes that feature the objects. Here you usually add the methods to validate the data, initialize the properties,…

  • Creating single-page applications with Backbone.js

    As we discussed in the introduction, when working on large projects there’s a real need to have good code organization. Imagine for a moment what would happen to software developed by companies like Google or Microsoft if they had bad code organization. With products where new features are added and old ones are updated frequently,…

  • Installing, updating, and deleting packages

    Before installing a package, there’s an important decision to make. You have to decide if the dependency you’re going to install is needed in production or is only necessary for you as a developer. To give you a concrete idea, jQuery is a package you need in production because your whole JavaScript code, or part…

  • Managing dependencies with Bower

    The development of a web project usually involves the use of third-party components to speed up the process. A project that employs one or two third-party components can be easily managed manually, as we used to do until a few years ago. As things get more complicated, developers needed a reliable way to install and…

  • Using RequireJS with jQuery

    Back in lesson 12, we taught you what jQuery plugins are and how you can develop your own to extend jQuery’s powers. Being plugins for jQuery, they depend on, well, jQuery. And the code you write using your jQuery plugins’ methods depends on jQuery and these plugins. This is a perfect situation in which to employ…

  • Loading modules with RequireJS

    In the previous section we discussed two simple approaches to organize your code into modules. But they have a major drawback: you have to manually manage the dependencies of each module. For example, a method of one module may need to use a property of another object. To avoid this issue you have to pay…

  • Organizing your code into modules

    When working on large applications you have to pay attention to organize your code properly. Limiting global namespace pollution and providing logical module organization are priorities, and code written using jQuery is no exception. You should take care of its structure in the same way you would do for any other code written without it.…

  • Optimizing filters

    Many of the filters supported by jQuery aren’t part of the CSS specification, so they can’t take advantage of the performance provided by the use of native methods such as querySelectorAll(). For some of them, such as :input, :visible, and others, it’s better to first select using a pure CSS selector and then filter using the filter() method. For example,…

  • Improving the performance of your selectors

    Achieving high performance is a huge concern, today more than ever. Every web project should take care of this aspect from the start in order to avoid publishing pages that take up to 10 seconds to load. Performant code isn’t only something to brag about with friends; it can improve the satisfaction of your users.…

Got any book recommendations?