CODE REFACTORING
CODE REFACTORING
The most popular guiding principle for code refactoring & order of importance is like:
Readability > Modularity > Efficiency > Length of Code
👉Readability
Make sure that your code is easy to understand but not just that you know yourself but maybe say your future self, can you quickly understand what's going on is everything organized in a logical way, is everything commented so that you can easily understand what each part of the code is about. And also this is a very common scenario if you're working in any sort of company or team you're likely to be cooperating on the same piece of code. So try to keep a code readable.
👉Modularity
Now the next thing is modularity and this kind of relates to how easy is it to reuse bits of your code and how easy is it to narrow down. Say if you know one particular part of your web site breaks down is your code modular enough that you would be able to narrow down on the exact section of code or code file that's responsible for the problems that's occurring now.
👉Efficiency
How fast does your code run.There's ways of making your code very efficient and very fast. Now a lot of that happens that the choosing the programming language level so you know you want something fast choose something like C.. .Write something that's close to the mantel but there's also other ways of improving the efficiency of your code. But it's much much less important than keeping your code modular and readable.
So that's why it's number three.
👉Length of Code
Now if you're cutting down on the length to improve readability then that's great that's really really important. Making sure that you're not repeating yourself in your code so that you keep your code really well structured and readable that is very important up there number one but if you're purely just reducing the length of your code and actually making your code less readable less comprehensible then that's bad and you're building code for enterprise or for your company then that's you know probably not what you want to do.
What do you think about this article make sure you comment below👇
The most popular guiding principle for code refactoring & order of importance is like:
Readability > Modularity > Efficiency > Length of Code
👉Readability
Make sure that your code is easy to understand but not just that you know yourself but maybe say your future self, can you quickly understand what's going on is everything organized in a logical way, is everything commented so that you can easily understand what each part of the code is about. And also this is a very common scenario if you're working in any sort of company or team you're likely to be cooperating on the same piece of code. So try to keep a code readable.
👉Modularity
Now the next thing is modularity and this kind of relates to how easy is it to reuse bits of your code and how easy is it to narrow down. Say if you know one particular part of your web site breaks down is your code modular enough that you would be able to narrow down on the exact section of code or code file that's responsible for the problems that's occurring now.
👉Efficiency
How fast does your code run.There's ways of making your code very efficient and very fast. Now a lot of that happens that the choosing the programming language level so you know you want something fast choose something like C.. .Write something that's close to the mantel but there's also other ways of improving the efficiency of your code. But it's much much less important than keeping your code modular and readable.
So that's why it's number three.
👉Length of Code
Now if you're cutting down on the length to improve readability then that's great that's really really important. Making sure that you're not repeating yourself in your code so that you keep your code really well structured and readable that is very important up there number one but if you're purely just reducing the length of your code and actually making your code less readable less comprehensible then that's bad and you're building code for enterprise or for your company then that's you know probably not what you want to do.
Comments
Post a Comment