Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Importance Of
The Quality Of Code
Why Is Good Quality Code So Important?
Good quality code is an essential property of a software because it
could lead to f...
Characteristics Of Good Quality Code
 Efficiency
 Reliability
 Robustness
 Portability
 Maintainability
 Readable
EFFICIENCY
o Directly related to the performance and speed of running the
software.
WHY IMPORTANT ?
o The quality of the s...
RELIABILITY
o Ability to perform consistent and failure-free operations every time it
runs.
WHY IMPORTANT ?
o The software...
ROBUSTNESS
o Ability to cope with errors during program execution even under
unusual condition.
WHY IMPORTANT ?
o Image ho...
PORTABILITY
o Ability of the code to be run on as many different machines and
operating systems as possible.
WHY IMPORTANT...
MAINTAINABILITY
o Code that is easy to add new features, modify existing features or fix
bugs with a minimum of effort wit...
READABLE
o The ability of allowing the code to be easily, quickly, and clearly understandable by
someone new or someone th...
Factors That Improve
The Readability Of Code
To Improve Readability Of Code
 Use of Comments
 Appropriate naming
 Proper indention
Use of Comments
o Provide the programmers with additional information about the written code
allowing them to easily under...
Appropriate Naming
o Have a significant role in program readability
o Make it noticeably easier for programmers to quickly...
Proper Indention
o Guides programmers where they should follow and implement, fix or make
changes in coding.
o Makes the s...
class Test{
public static void main()
{
for(int i = 0; i < 5; i++)
{
If(i== 5)
{
Messagebox.show(“OK”);
}
}
}
}
class Test...
References
• http://www.codeexcellence.com/2012/05/8-must-have-characteristics-for-
writing-quality-code/
• http://www.tec...
Upcoming SlideShare
Loading in …5
×

Importance of the quality of code

10,853 views

Published on

Good quality code is an essential property of a software because it could lead to financial losses or waste of time needed for further maintenance, modification or adjustments if code quality is not good enough.

Published in: Software
  • Could you use an extra $1750 a week? I'm guessing you could right? If you would like to see how you could make this type of money, right from the comfort of your own home, you absolutely need to check out this short free video. ★★★ http://scamcb.com/ezpayjobs/pdf
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • 8 Simple Tips &amp; Tricks To Extend The Life Of Your Car Battery..  http://ishbv.com/ezbattery/pdf
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Sex in your area is here: ♥♥♥ http://bit.ly/2F90ZZC ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Follow the link, new dating source: ♥♥♥ http://bit.ly/2F90ZZC ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Got a new Iphone 6 in just 7 days completing surveys and offers! Now I'm just a few days away from completing and receiving my samsung tablet! Highly recommended! Definitely the best survey site out there! ●●● http://t.cn/AieXAuZz
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Importance of the quality of code

  1. 1. Importance Of The Quality Of Code
  2. 2. Why Is Good Quality Code So Important? Good quality code is an essential property of a software because it could lead to financial losses or waste of time needed for further maintenance, modification or adjustments if code quality is not good enough.
  3. 3. Characteristics Of Good Quality Code  Efficiency  Reliability  Robustness  Portability  Maintainability  Readable
  4. 4. EFFICIENCY o Directly related to the performance and speed of running the software. WHY IMPORTANT ? o The quality of the software can be evaluated with the efficiency of the code used. o No one likes to use a software that takes too long to perform an action. HOW? o Remove unnecessary or redundant code o Write reusable code o Reduce resource consumption o Use appropriate data types, functions and looping in appropriate place
  5. 5. RELIABILITY o Ability to perform consistent and failure-free operations every time it runs. WHY IMPORTANT ? o The software would be very less useful if the code function differently every time it runs even with the same input in same environment and if it breaks down often without throwing any errors. HOW? o Take much time to review and test the code carefully and thoroughly in every possible way. o Use proper error and exception handling.
  6. 6. ROBUSTNESS o Ability to cope with errors during program execution even under unusual condition. WHY IMPORTANT ? o Image how would you feel when you use a software that keep showing strange and unfamiliar message when you did something wrong. o Software is typically buggy and fragile but it should handle any errors encountered gracefully. HOW? o Test software from every condition; both usual and unusual. o Use proper error and exception handling. o Provide clear and understandable error messages to allow user to more easily debug the program.
  7. 7. PORTABILITY o Ability of the code to be run on as many different machines and operating systems as possible. WHY IMPORTANT ? o It would be a waste of time and energy for programmers to re-write the same code again when it transferred from one environment to another. HOW? o Start from the very beginning, write code that could work on every possible environment.
  8. 8. MAINTAINABILITY o Code that is easy to add new features, modify existing features or fix bugs with a minimum of effort without the risk of affecting other related modules . WHY IMPORTANT ? o Software always needs new features or bug fixes. So the written code must be easy to understand, easy to find what needs to be change, easy to make changes and easy to check that the changes have not introduced any bugs. HOW? o Good naming of variable, method and class names o Use of proper indentation and formatting style o Good technical documentation o Write appropriate comment or summary descriptions at the top of files, classes or functions
  9. 9. READABLE o The ability of allowing the code to be easily, quickly, and clearly understandable by someone new or someone that hasn't seen it in a while. oWHY IMPORTANT ? o Ensures that everyone can understand the code written by everyone else. o If the code is messy and badly written, it would be very hard to understand what the code does and where changes need to be made. o This could waste much time trying to figure out how it all fits together before making any action and even end up re-writing the again assuming that it is buggy and carelessly written. HOW? o Use proper variable, method and class names o Use consistent indentation and formatting style o Write appropriate comment or summary descriptions at the top of files, classes or functions
  10. 10. Factors That Improve The Readability Of Code
  11. 11. To Improve Readability Of Code  Use of Comments  Appropriate naming  Proper indention
  12. 12. Use of Comments o Provide the programmers with additional information about the written code allowing them to easily understand :_ • the purpose and reason behind a piece of code, • what a piece of code would do and • what you are trying to accomplish with it. o Allows you to talk to your fellow developers about the business needs, special- requests, remaining tasks and the temporary solutions. o Proper use of commenting can make code maintenance much easier, as well as helping in finding bugs faster. o Reduce the effort and time needed to read and try to understand a previously written code. o Without comments, it can be easy to get lost in the code and won't understand a thing what and why are these code written for.
  13. 13. Appropriate Naming o Have a significant role in program readability o Make it noticeably easier for programmers to quickly determine what the code is doing, and to fix or modify for further requirements. o Reckless names for variables, functions or classes can lead to confusion about the role that these components play. a = b * c; weekly_pay = hours_worked * pay_rate; Example 1 Example 2 Correct but it does not make any sense ! Correct and show the intent and meaning of the code
  14. 14. Proper Indention o Guides programmers where they should follow and implement, fix or make changes in coding. o Makes the structure of the code more obvious, making it easier to follow improving the readability of the code. o If the indention is poorly done, other programmers are going to have a hard time following your code and determining when a block executes. o Proper code indentation will make it: • Easier to read • Easier to understand • Easier to modify • Easier to maintain • Easier to enhance saving lots of time when we need to revisit the code and use it.
  15. 15. class Test{ public static void main() { for(int i = 0; i < 5; i++) { If(i== 5) { Messagebox.show(“OK”); } } } } class Test { public static void main() { for(int i = 0; i < 5; i++) { If(i== 5) { Messagebox.show(“OK”); } } } } Example 1 Example 2
  16. 16. References • http://www.codeexcellence.com/2012/05/8-must-have-characteristics-for- writing-quality-code/ • http://www.techopedia.com/definition/27151/code-efficiency • http://www.javacodegeeks.com/2011/06/lessons-in-software-reliability.html • http://en.wikipedia.org/wiki/Robustness_(computer_science) • http://software.ac.uk/resources/guides/writing-readable-source-code • http://software.ac.uk/resources/guides/developing-maintainable-software • http://www.infernodevelopment.com/5-tips-improve-your-codes-readability • http://mrbool.com/importance-of-code-indentation/29079

×