CLEAN CODING
Cost of owing a mess is high. When starting to program your project the speed and efficiency will be high. But by the time you get to the end of it , if the coding is bad you will run in to troubles more often. And lots of time will be wasted on it.
Cost of owing a mess is high. When starting to program your project the speed and efficiency will be high. But by the time you get to the end of it , if the coding is bad you will run in to troubles more often. And lots of time will be wasted on it.
- The code should be comprehensive.simple and tidy.
- Because the debugging process mostly consists of reading time. You will need time to read the code again to understand what happened. The debugging employee will run in to trouble else.
- Starting from the beginning keep it clean and tidy.
- No need to go fast . Keep it simple and take time to write the code cleanly.
- Clean code consists of :
- Runs all the tests
- contains no duplication
- Expresses all the design ideas in the system.
- minimizes the number of methods functions and classes.
- Boy scout rule
- "Leave the campground cleaner than you found it"
- Meaningful Names
- Use intention-revealing Names
- int days;
- int daySinceCreation;
- int fileAgeInDays;
- Avoid Disinformation
- Do not refer to a grouping of accounts as an accountList unless it’s actually a List .
- Using pronounceable NameS
DtaRcrd102 to Customer
genymdhms to generationTimeStamp
modymdhms to modificationTimestamp
- Use searchable names
- Because the debugging process mostly consists of reading time. You will need time to read the code again to understand what happened. The debugging employee will run in to trouble else.
- Runs all the tests
- contains no duplication
- Expresses all the design ideas in the system.
- minimizes the number of methods functions and classes.
- "Leave the campground cleaner than you found it"
- Meaningful Names
- Use intention-revealing Names
- int days;
- int daySinceCreation;
- int fileAgeInDays;
- Avoid Disinformation
- Do not refer to a grouping of accounts as an accountList unless it’s actually a List .
- Using pronounceable NameS
DtaRcrd102to Customergenymdhmsto generationTimeStampmodymdhmsto modificationTimestamp- Use searchable names
Comments
Post a Comment