CIS*2450 Software Systems Development and Integration Website
Text-only Version
Coding Standards
Why it is important for you to study standards?
- Many jobs will require you to follow specific standards.
- Software that follows published standards is more likely to be maintainable and marketable.
- There are many good ideas in the standards that you can learn from. Even the bad ideas are good to know since you have to deal with them.
Professional Software Development
- Part of being a professional software developer is the ability to read, comprehend and follow specifications.
- Standards are similiar in that they must be read, understood and followed.
- The bottom line is that you are not developing code in a vacuum. Other
people will:
- work with your code (i.e. read it!),
- maintain your code (they must understand it), and
- modify your code (starting the whole cycle over again!).
What are Coding Standards?
- Coding standards address the use of a programming language while programming standards address higher-level issues such as design.
- Coding standards help ensure
- understandability
- maintainability
- productivity
- quality
Informal Definitions
- Standards: enforced rules
- Guidelines: recommendations (maybe strong)
- Coding standards and guidelines are for the reader of the code.
Formal Definitions
What are Standards?
Standards are documented agreements containing technical specifications or other precise criteria to be used consistently as rules, guidelines, or definitions of characteristics, to ensure that materials, products, processes and services are fit for their purpose.
International standards are suppose to contribute to making life simpler, and to increasing the reliability and effectiveness of the goods and services we use.
Why Standards?
- Standards encapsulate the best or most appropriate practice.
- they capture historical knowledge, often gained by trial and error
- they preserve and codify organizational knowledge and memory
- Standards also provide a framework for quality assurance (QA).
- QA now becomes the activity for ensuring that standards have been followed
- Standards help to ensure project/personnel continuity.
- over a project's lifecycle, new team members may be added and standards help in assisting their useful integration
Who Writes Standards?
- Standards are difficult and time-consuming to create and administer. There are many national and international standards organizations.
- Certain organizations (usually governments) insist on contractors following their own standards.
- Many countries have national standards bodies where experts from industry and universities develop standards for all kinds of engineering problems, e.g. ANSI or the American National Standards Institute.
- The International Organization for Standardization, ISO, in Geneva is the head organization of all these national standardization bodies (from some 100 countries, one from each country).
ISO
- The ISO is a non-governmental organization and was established in 1947.
- ISO's work results in international agreements which are published as International Standards.
- ``ISO'' is not an acronym for the organization in any language. It is a wordplay based on the English initials and the Greek word isos, meaning ``equal'', which is the root of the prefix ``iso-'' that occurs in a host of terms, such as ``isometric'' (of equal measure or dimensions).
- In addition, the name has the advantage of being valid in each of the organization's three official languages - English, French and Russian.
ISO Standards Relevant to Computing
| ISO 646 | Good ol' 7-bit ASCII with national variants |
| ISO 2022 | ESC sequences for switching between various character sets |
| ISO 4217 | Codes for the representation of currencies and funds |
| ISO 6709 | Representation of latitude, longitude and altitude of geographic positions |
| ISO 6429 | ASCII Control Codes, also known as VT100/VT320/ANSI escape sequences |
| ISO 9899 | The C programming language |
| ISO 9945 | UNIX style system calls and shell commands (POSIX) |
- ISO 3166 Codes for the representation of names of countries.
This standard defines a 2-letter, a 3-letter and a numeric code for each country on this planet.
US/USA/840=United States
DE/DEU/276=Germany
GB/GBR/826=United Kingdom
FR/FRA/250=France
The 2-letter codes are well known in the Internet as top-level domain names. The 3-letter versions are often used at international sports events. - ISO 5218 Representation of human sexes
Sex is represented by a one-character language independent numerical code:
0=not known
1=male
2=female
9=not specified
The standard also specifies, that ``no significance is to be placed on the fact that `Male' is coded `1' and `Female' is coded `2'. This standard was developed based upon predominant practice of the countries involved and does not convey any meaning of importance, ranking or any other basis that could imply discrimination.'' :-) - ISO 8601 Representation of dates and times.
This standard defines a lot of details of the calendar, e.g. the ISO definition of the week numbers is that the first day (day number 1) of a week is Monday and that the first week in a year (week number 1) is the week that includes the first Thursday in January, i.e. the first week that has at least four days in January.
Other definitions are, e.g., that hours of a day are counted from 0 to 24 and that the international notation of dates is the Bigendian format year-month-day, e.g. 1993-04-17 and that for time is 20:36:04.
There are also string formats for computer applications specified that have to represent date and time in files and protocol packets.
Conclusion
- Standards are an excellent way to study best practices and to coordinate common concepts in many different situations.
- The professional software developer must be aware of all appropriate standards that relate to the application that they are developing.
- Standards are a sign of professional maturity.