Tag: clean-code
All the articles with the tag "clean-code".
Why you should avoid magic numbers in code?
Published: at 03:53 AMMagic numbers are numbers in code that don't have any meaning to them. So it is always a good practice to assign the number to a variable and name the variable corresponding to its value.
How to eliminate multiple If checks?
Published: at 03:53 AMIt is tedious to return a value based on a key when using multiple If checks. If the new value is added we need to add one more If check for that value. The simple solution is we can use the Config object to the pattern to eliminate this problem.