Writing the programs - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Writing the programs

Description:

... most critical standard is the need for a direct correspondence between program ... The entire design process is of little value if the design's modularity is not ... – PowerPoint PPT presentation

Number of Views:10
Avg rating:3.0/5.0
Slides: 13
Provided by: eng72
Category:

less

Transcript and Presenter's Notes

Title: Writing the programs


1
Writing the programs
  • In this part we look at
  • Standards for programming
  • programming guidelines
  • using design to frame the code
  • internal and external documentation

2
Programming standards
  • Standards for you
  • Standards and procedures can help you to organise
    your thoughts and avoid mistakes.
  • Standardised documentation also helps in locating
    faults and making changes, because it clarifies
    which sections of your program does what.

3
Programming standards
  • Standards for others
  • Once your code is complete it can be used in a
    variety of ways.
  • A separate team may test the code.
  • Or a another team may integrate your software
    with other programs to build and test subsystems
    and finally the entire system.
  • You may not be part of any of those teams so it
    is essential that you organise, format and
    document your code to make it easy for others to
    understand what it does and how it works

4
Programming standards
  • Matching design with implementation
  • The most critical standard is the need for a
    direct correspondence between program design
    components and the program code components.
  • The entire design process is of little value if
    the design's modularity is not carried forward
    into the code.

5
Programming guidelines
  • Each program involves at least three major
    aspects
  • control structures,
  • algorithms and
  • data structures.
  • Control structures are usually suggested by
  • the architecture and design and we want to
  • preserve them as the design is translated into
  • code. A rule of thumb is that they should be as
  • clear as possible with the flow going from top to
  • bottom.

6
Programming guidelines
  • Algorithms are usually specified in the program
  • design. In particular, when implementing
  • algorithms do not sacrifice clarity and
  • correctness for speed.
  • Data structures should be designed such that
  • data management and manipulation are
  • straightforward

7
Documentation
  • Internal documentation is descriptive material
  • written directly within the code all other
  • documentation is external documentation.
  • Examples
  • Header comment block
  • Other program comments
  • Meaningful variable names
  • Formatting to enhance understanding
  • Documenting data

8
Meaningful variable names
  • Choose names for your variables and statements
    that reflect their use or meaning.
  • weekswage (hrrate hours)
  • 0.5(hrate)(hours-40.0)
  • makes more sense to the reader than
  • a (ab) (0.5) (a) (b- 40.0)

9
External documentation
  • The ANSI standard for software documentation
  • makes recommendations for the content rather
  • than the form of software documentation and
  • suggests separating documentation content into
  • four categories
  • the abstract.
  • the application information,
  • the problem (or function) definition,
  • the programming information.

10
Abstract
  • The abstract summarizes the software's major
  • capabilities and purposes.
  • The abstract's goal is to provide the user with
    enough information to enable an easy decision
    about whether the software is suitable for the
    user's needs.
  • According to the standard, this information
    should include specific functions of the
    software, the required computer environment, and
    all the materials available to the user in the
    software package, including manuals.

11
Application Information
  • The application information section summarized
  • the problems the software is designed to solve,
  • and specifies how to use the software, especially
    for preparing input data and interpreting
    computed results.
  • This section should be concise enough to enable
    effective use of the software and to serve as a
    reference source for user questions.
  • It also includes a brief discussion of the
    comparative strengths and weaknesses of the
    software in relation to other competing or
    related software packages.

12
Application Information
  • The application information describes
  • the function of each major program option
  • the way the software handles files
  • the effect of data storage requirements on the
    software
  • the range of values and variables that can be
    used in the software
  • the control commands required to execute the
    program
  • the nature of the output, including the way the
    output relates to the input
Write a Comment
User Comments (0)
About PowerShow.com