Presentation is loading. Please wait.

Presentation is loading. Please wait.

Maintaining a Program In today’s lesson we will look at:

Similar presentations


Presentation on theme: "Maintaining a Program In today’s lesson we will look at:"— Presentation transcript:

1 Maintaining a Program In today’s lesson we will look at:
what we mean by “maintainability” why it’s important steps you can take to improve maintainability

2 What is Maintainability?
Sometimes programs will contain bugs that need fixing, or you might want to add additional features. Perfecting and improving programs are examples of maintenance. When maintaining a program, it’s therefore important to be able to quickly identify what the program is doing and where the changes need to be made… …especially if time is tight, or you are being paid by the hour! There are steps that you can take, when writing your code, to make it easier to maintain.

3 Why is it Important? Sometimes the maintenance takes place some time after the original code was written, and that code might be quite complex, so you might have forgotten what it does. Sometimes the program might have been created by a team of programmers, or the original programmer might have left. Sometimes it’s not immediately apparent what a program does at a quick glance – particularly if you’ve used more advanced techniques such as recursion.

4 Improving Maintainability
The three techniques most likely to appear in a GCSE exam are: Adding comments to explain sections of code Using appropriate indentation to loops, ifs, etc. Sensible naming of functions, variables, etc. You don’t need to comment every line of your code, just those that you think might require some explanation to someone else. Indentation is part of the syntax in Python, but is a matter of style in other languages, e.g. JavaScript.

5 Naming Conventions A software developer might have its own conventions for naming variables and functions, e.g. ensuring that name describes the contents CamelCase or snake_case using prefixes to tell you what type of object is being stored, such as buttonStart or checkboxYes having a prefix to suggest what a function returns, e.g. isNull will return true or false This is particularly important where you are working in a team. There are similar conventions for database structure, e.g. the Leszynski/Reddick naming convention.


Download ppt "Maintaining a Program In today’s lesson we will look at:"

Similar presentations


Ads by Google