Refactoring

Sponsored links
JavaScript/TypeScript

How to write clean if-else statements

if-else statements can easily be nested and make the code unreadable if we don't consider anything to write it. if-else ...
JavaScript/TypeScript

TypeScript Make the function parameter more maintainable by using interface

Many programming languages support interface keyword. TypeScript also supports the feature. This is one of the important...
JavaScript/TypeScript

TypeScript Utility types defined with infer keyword

infer keyword is one of the difficult features that TypeScript offers. Some utility types use infer keyword, so let's le...
JavaScript/TypeScript

Implement IoT State Machine Transition By State Pattern In TypeScript

In my project, my team needed to implement State machine. One of the developers implemented it by using many if-else but...
JavaScript/TypeScript

Reduce the number of if-else and switch-case conditional clauses

Have you found a function is not readable because of lots of conditional clauses such as if-else or switch-case? It's ti...
JavaScript/TypeScript

TypeScript Replace switch-case logic with Record object

Switch-case is one of the basics for conditional statements and it is supported by many programming languages. It is use...
JavaScript/TypeScript

TypeScript How to refactor a function to use named parameters

TypeScript and JavasScript don't offer named parameters. How can we do a similar thing? Is there are any to refactor the code to apply the technique?
JavaScript/TypeScript

5 Refactoring techniques that you can immediately apply

Many software developers want to know techniques that they can immediately apply to make their code readable. A function...
JavaScript/TypeScript

Advanced state machine pattern

I recently implemented logic to provide state machine info. At first I didn't implement it by State pattern but I felt i...
JavaScript/TypeScript

Replacing a static function by using proxy class

This is 4th post in Become a better and decent programmer series.In the first post, I explained how to extract logic in ...
Sponsored links