JavaScript/TypeScript Reducing number of conditional clauses by command pattern This is 3rd post in Become a better and decent programmer series.In the first post, I explained how to extract logic in ... 2021.02.10 JavaScript/TypeScript
JavaScript/TypeScript How to make code testable In this post, we created a shopping application which is available on console and refactored it. It has only one class w... 2021.02.03 JavaScript/TypeScript
JavaScript/TypeScript How to become a better programmer I hadn't been decent programmer for a long time because I hadn't written unit test. Decent programmer should at least be... 2021.01.20 JavaScript/TypeScript
JavaScript/TypeScript Dependency injection in Typescript. Constructor? Setter? Factory method? Decoupling class relationships is important for unit testing. Less cohesion makes writing unit tests easier. This post shows 3 ways to do it. Constructor injection, setter injection, and using the factory method to inject the desired instance. 2020.09.13 JavaScript/TypeScript