jasonbutz.info

Article Roundup - January 31, 2020

Article Roundup

Clean Code concepts adapted for JavaScript
Every example I can remember in Clean Code was in Java. That’s not necessarily an issue, but it doesn’t always translate cleanly to other languages, like JavaScript. That’s what this is. Examples of key concepts from Clean Code, but written in JavaScript.

Name the Abstraction, Not the Data
How you name things in your code is important; there is even an entire chapter in Clean Code dedicated to it. This article is a little Ruby focused and focuses on Presenter/Decorator classes, but the philosophy they are discussing is wider-reaching. If you’re having to do a lot of massaging in order to display your data then eventually you may not want one class to do all of that work. Eventually, it may make sense to split things up into different classes and name them according to where they are being used.