Turning Bad JS into Clean & Clear JS

Author Avatar

Robert Stefanic

  ·  1 min read

I recently gave a clean code talk at the Northwest Chicago JavaScript meetup. While the ideas presented in this talk can really be applied to any language, I do think that JavaScript is an interesting language to look at when it comes to clean code just because the language is very flexible. It’s not a heavily opinioned language and there are a ton of ways to accomplish the same thing. JavaScript doesn’t care what approach you’re trying to take as you can mix and match styles to solve a problem. And even though there are standards that are becoming more and more recongized as JavaScript becomes more mature, there are still tons of examples of bad JavaScript code out there. So I wanted to focus on recognizing bad code, and looking at specific examples of how to fix bad code.

We’ve all heard the common good programming practice tropes, but I wanted to take some time and reflect on why these practices are parroted. I cover naming, functions, comments, and (briefly) overall design and system architecture.