Emotional Attachment to Code
A few years ago, I was working on a front-end project for a client. I was running into a performance problem. An event was being triggered »
Magic numbers are numbers that appear in source code without any explanation of what they mean. This makes the code difficult to understand and maintain. In »
A few years ago, I was working on a front-end project for a client. I was running into a performance problem. An event was being triggered »
A magic number is a number that appears directly in source code, but should really be given a name and used as a variable. The aim »
Don't Repeat Yourself (DRY) is an important principle in software development. Code repetition harms maintainability by making it difficult to keep behavior consistent across the application. »
When a variable is declared without being assigned a value its initial value is undefined. How do you check if a value is undefined in JavaScript? »
This article shows how object lookups can sometimes be used as a more maintainable alternative to if statements. Selecting a matching value The code below determines »
Many code standards recommend a maximum number of characters per line. This article explains why such a limit is desirable and looks into what the limit »
Using JavaScript makes it possible to dynamically add and remove HTML content in the browser. This article shows an approach to adding HTML content that is »
Most medium and large software projects have a style guide to ensure different developers write code in a consistent way. Styles guides document coding conventions on »
In addition to file size, one reason it can be tempting to compromise on readability is performance. However, this article demonstrates why that's a bad idea. »