crater icon indicating copy to clipboard operation
crater copied to clipboard

Refactor utilities.js

Open ahmed0saber opened this issue 1 year ago • 2 comments

ahmed0saber avatar Jul 14 '23 23:07 ahmed0saber

The refactor is good but the current domain check function checks a lot of values and it seems to be working well. Can you explain the reasoning behind updating the implementation for that?

mohitpanjwani avatar Aug 05 '23 05:08 mohitpanjwani

Hello @mohitpanjwani , the only reason for any refactoring process is to make the code more readable, more cleaner, more maintainable, also there is a rule in refactoring which discusses not changing the functionality of code during code refactor, so I'm not fixing a bug, error or anything, also I'm not adding a feature, but I'm just trying to write the same functionality in a better way, so it's easy to understand it and maintain it in the future. The first code (before refactoring) may take 1 hour to be understood then maintained if any problem occurred there, but the second one (after refactoring) may take about 10 minutes or less, so refactoring code can save us time, and cost depends on time, so we can also save some money or invest this time to do something else that may have much urgent priorities.

ahmed0saber avatar Aug 05 '23 11:08 ahmed0saber