Programming Best Practices

It is easy to create one-off code that works as specified before a deadline. It is another thing to get that code to be maintainable and modular. Reputable external resources and my own opinions abound within this Programming Best Practices category.

Avoid “for in” loops in JavaScript

Newcomers to JavaScript from other programming languages often neglect an important aspect that makes their code prone to subtle, difficult-to-detect bugs down the road. JavaScript’s "for in" loop is not your C-like-language’s “for each” construct. "for in" enumerates all properties of … Continue reading

Posted in Computing, Programming Best Practices, Web Best Practices | 5 Comments

Dynamic Modularity in Java

I am really excited about the Netbeans OpenIDE Lookup library! The library allows you to retrieve service-providing class implementations at runtime. My favorite part is that it is elegantly simple to use, just one call to a static method returns … Continue reading

Posted in Computing, Programming Best Practices | Leave a comment

Programming Paradigms, Functions as First Class Citizens in PHP

Hunt and Thomas, authors of The Pragmatic Programmer, firmly advocate that code-crafters: “Learn at least one new language every year. Different languages solve the same problems in different ways. By learning several different approaches, you can help broaden your thinking … Continue reading

Posted in Computing, Programming Best Practices | Leave a comment

Left-Handing Literals

The Problem Languages with C-like syntax are inherently prone to accidental switching of the equality and assignment operators. While the midnight oil burns and deadlines loom, even experienced programmers can find themselves typing “=” instead of “==”. A caffeinated finger twitch can neglect … Continue reading

Posted in Computing, Programming Best Practices | Leave a comment