crater
crater copied to clipboard
Refactor utilities.js
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?
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.