Lazy Loading ES2015 modules in the browser (article)

In September, 2016 I published an article on Avenue Code Snippets, about Lazy Loading ES2015 modules in the browser.

Article Lazy Loading ES2015 modules in the browser - Avenue Code Snippets

Abstract

Over the last few years, developers have been relentlessly moving their server-side sites to the client-side on the premise that the page performance would be improved.

However, this may not be enough. Have you ever considered that your site may be downloading more stuff than is being actually used? Meet Lazy-loading, a design pattern about deferring the initialization (loading/fetching/allocation) of a resource (code/data/asset) until the point at which it is needed.

This article demonstrates how to load ES2015 modules synchronously (during the page load) and asynchronously (performing lazy-loading) using System.js.

Mastering ES6 higher order functions for Arrays

In September, 2015 I published another article on AirPair, about the native Higher-order functions for Arrays in JavaScript, and how to develop your own higher-order function for Array.

Article Mastering ES6 higher-order functions for Arrays - AirPair

Abstract

Higher-order functions are beautifully concise yet expressive when dealing with data. Elevate your functional programming skills by learning ES6 higher-order functions for Arrays!

Catching up with JavaScript higher-order functions

In August, 2015 I published an article on AirPair, about the Higher-order functions in JavaScript.

Article Catching up with JavaScript higher-order functions - AirPair

Abstract

They are all around you, your code, your company, your community, your frameworks. You may not be aware of them or perhaps you never properly understood what is going on with them, but trust me: your life will never be the same without them. They are unique and pave the way for Functional programming. With you, Higher-order functions!

Leveling up - Simple steps to optimize the Critical Rendering Path

In May, 2015 I published an article on AirPair, about the Critical Rendering Path and how to optimize it.

Article Leveling up: Simple steps to optimize the Critical Rendering Path - AirPair

Abstract

Web development is tricky. There is a myriad of goals to strive for, which can be very cumbersome for your page performance, and can spike your Speed Index way up.

The Critical Rendering Path (or CRP) is the sequence of steps the browser takes to render the critical content of a webpage. This article explains about simple steps on how to optimize your page’s Critical Rendering Path in order to achieve better performance.

The mind-boggling universe of JavaScript Module strategies

In April, 2015 I published an article on AirPair, about JavaScript Module strategies and how to work with them.

Article The mind-boggling universe of JavaScript Module strategies - AirPair

Abstract

If you feel like “no matter what you do, there is always something funky in your JavaScript code”, I would bet that your Module strategy is not working out so well.

The importance of adopting a proper JavaScript Module strategy is often underestimated as a preference contest, so it is indeed important to really understand your needs. This article exposes the foundations of different JavaScript Module strategies such as ad hoc, CommonJS, AMD and ES6 modules, and how to get started with ES6 modules right now.

Revisiting XP - be a thoughtful programmer by exercising more collective ownership

In March, 2015 I published an article on InfoQ, about effectively exercising collective ownership to avoid confrontation and technical debt.

Article Revisiting XP: be a thoughtful programmer by exercising more collective ownership - InfoQ

Abstract

All in all, developers face regular frustration. This is pretty much because we are all artful individuals, so every single developer has his own tenets. Such tenets represent much more than what is taught in college - they actually constitute the developer’s personality! They are your fingerprint, something that can identify you. When a second developer reads your code, he will start making assumptions about you.

When two developers’ personalities run into each other, there is generally confrontation. While this can be extremely educational and uplifting, it can also be disturbing and troublesome if both parties don’t share a positive attitude. A key factor here is exercising what I call “thoughtful programming”.

This article will give a few suggestions about how to program in a more thoughtful way, by revisiting one of the XP (Extreme programming) rules: the concept of collective ownership.

Boosting applications with REST and Backbone.js [pt]

In January, 2014 I published an article (in Portuguese) in Java Magazine #123, about smart client-side applications, comparing them with other web application styles such as Java web frameworks.

Article Boosting applications with REST and Backbone.js - DevMedia

Summary

This article introduces smart client-side applications, comparing them with other web application styles such as Java web frameworks, highlighting the productivity usaging concepts such as REST, JSON and MVC on the client-side. Then, it presents Backbone.js and its main parts such as Models, Collections, Views and Routers, besides templating using Handlebars.js and communicating with a Play Framework back-end over REST and JSON.

When is the subject useful?

This subject is useful for Java developers that need to bring the desktop experience to his web applications, reducing the response and navigation time as well properly organizing the JavaScript code in a structure based on MVC architectural pattern.

What do I need to know about HTML 5? [pt]

In July, 2013 I published an article (in Portuguese) in Java Magazine #116, sobre o HTML 5 as an alternative for development exclusively based on the server-side. This technology introduces and standardizes many innovative features on the browser or mobile device, in a safe, portable and native way.

Article What do I need to know about HTML 5? - DevMedia

Summary

HTML 5 emerged as a movement to leverage many features designed to better explore the client-side in web applications, which can be beneficial in a few scenarios. This movement introduces certain client-side features such as offline work, persistence, multi-threading, low-level network communication, reproducing audio and video without plugins, geolocalization and form validation. All those features will be addressed on this article, as well a brief comment about the Dashorn project, which aims to make it possible to run JavaScript directly on the JVM.

When is the subject useful

This subject is useful for Java developers which want to learn how to bring the desktop experience to web applications, reducing the response and navigation time, working without depending on any plugin and having just one client-side codebase independent of device and platform.

Understanding and optimizing the Garbage Collection - Part 3 [pt]

In April, 2012 I published an article (in Portuguese) in Java Magazine #104, about common problems in Java code which ignore how Garbage Collection operates, how to write code to optimize this process and how to analyse the heap memory status in runtime.

Article Understanding and optimizing the Garbage Collection - Part 3 - DevMedia

Summary

The article begins by reviewing JVM options to log the Garbage Collection process activities as well presenting the JConsole tool for a picture of the heap memory situation. Next, states about memory leaks and shows an example of a code with this problem, analysing its runtime execution on JConsole. Lastly, presents other subjects as the finalize() method, weak references and concludes suggesting some good practices.

When is the subject useful

The subject is very relevant to any Java developer, even though the consequences of a badly configured Garbage Collection process won’t be much evident in development environments, certainly will make the difference in production environments. It is important to understand the reasons that cause malfunctioning of the Garbage Collection and how to avoid those scenarios, using good practices for such.

Understanding and optimizing the Garbage Collection - Part 2 [pt]

In March, 2012 I published an article (in Portuguese) in Java Magazine #103, about the operation of the colletors from the JVMs Oracle JRockit (used by WebLogic Java EE application server), IBM Virtual Machine for Java (used by WebSphere Java EE application server), those ones which implement JSR-1 (also known as Real-Time Specification for Java or RTSJ) and Dalvik (used by Android devices).

Article Understanding and optimizing the Garbage Collection - Part 2 - DevMedia

Summary

This article begins by presenting the JVM Oracle JRockit and its heap memory configuration, its collectors and how to use them. Next, presents the JVM IBM Virtual Machine for Java, its heap memory configuration, its collectors and how to use them. From here, presents the JSR-1 specification and its concepts about developing real-time applications in Java, and demonstrates the operation of 5 real-time collectors. Yet, presents the JVM Dalvik and its challenges about Garbage Collection, as well its collector and improvements about memory management.

When is the subject useful

The subject is very relevant to Java developers which work with any of the aforementioned JVMs, to better understand the consequences of using these collectors in particular scenarios. Besides that, Java developers which don’t yet work with any of those JVMs can learn how those options manage to solve in a different way the same challenges the JVM HotSpot faces, adding to your knowledge.