Back to Search Start Over

Programming Style: Examples and Counterexamples.

Authors :
Kernighan, Brian W.
Plauger, P.J.
Source :
ACM Computing Surveys. Dec74, Vol. 6 Issue 4, p303-319. 17p.
Publication Year :
1974

Abstract

Computer programs can be written many different ways and still achieve the same effect. Until recently, programmers have had little reason to favor one method of expressing code over another. We have come to learn, however, that functionally equivalent programs can have extremely important stylistic differences. Good programming style cuts across application areas, technique and language. Programs written with good style are easier to read and understand, and often smaller and more efficient, than those written badly. Yet few programmers have ever been taught what style is, as we can see from even cursory inspection of their code. Even the techniques of structured programming do not ensure that code will be good; "structured" programs can be just as bad as their unstructured counterparts. This paper is a survey of some aspects of programming style, primarily expression and structure, showing by example what happens when principles of style are violated, and what can be done to improve programs. To add the ring of truth to our discussion, the examples are all taken verbatim from programming textbooks. [ABSTRACT FROM AUTHOR]

Details

Language :
English
ISSN :
03600300
Volume :
6
Issue :
4
Database :
Academic Search Index
Journal :
ACM Computing Surveys
Publication Type :
Academic Journal
Accession number :
12143435
Full Text :
https://doi.org/10.1145/356635.356641