Archive for the ‘Refactoring’ Category

What Tutorials Don’t Tell You: How to Approach Projects

Posted on: No Comments
I often hear that people who follow tutorials find themselves unable to approach JavaScript projects on their own. One reason this happens is that tutorials give you a neat set of steps rather than the actual process of figuring out those steps on yo...

Saved from Callback Hell

Posted on: No Comments
Callback hell is real. Often developers see callbacks as pure evil, even to the point of avoiding them. JavaScriptʼs flexibility does not help at all with this. From the surface, it seems callbacks are the perfect foot gun, so it is best to replace th...

JavaScript Refactoring Techniques: Specific to Generic Code

Posted on: No Comments
In a recent thread on SitePoint's forums, some code was given to let one dropdown box control when another dropdown box is visible. Even though the code worked just fine, I realized that it left much to be desired. It was brittle and incapable of withs...

Cleaning up Code: Is Refactoring for Aesthetics worth It?

Posted on: No Comments
Most development teams want to get their codebase into a better, more maintainable state. But what definition of better should be chosen? In many cases, it is not necessary to dig deep into Domain Driven Design (DDD) to achieve this goal. Sometimes, it...

15 Ways to Write Self-documenting JavaScript

Posted on: No Comments
Isn't it fun to find a comment in code that's completely out of place and useless? It's an easy mistake to make: you change some code, and forget to remove or update the comment. A bad comment won't break your code, but imagine what would happen when ...

Untangling Spaghetti Code: How to Write Maintainable JavaScript

Posted on: No Comments
Almost every developer has had the experience of maintaining or taking over a legacy project. Or, maybe it's an old project which got picked up again. Common first thoughts are to throw away the code base, and start from scratch. The code can be messy,...

Upgrade Your App to Angular 1.5 Components and Beyond!

With each new release of AngularJS, the development team is trying to bridge the gap between AngularJS 1.x and 2. With the release of AngularJS 1.5, developers will be able to write applications structurally similar to AngularJS 2.0. In this tutorial, ...

Technical Debt: Rescuing Legacy Code through Refactoring

Posted on: No Comments
How can you get a legacy codebase under control and bring it to a new level of maturity? In this post, Jeroen summarizes the lessons learned from years of working on a large legacy web application. This article was originally published by intracto. Le...