The Elements of Programming Style: Difference between revisions

Content deleted Content added
Taibah U (talk | contribs)
mNo edit summary
Tried to remove some of the language that strikes me as subjective. Added references to some of the many programming style books that this early text helped spawn.
Line 4:
'''''The Elements of Programming Style''''', by [[Brian W. Kernighan]] and [[P. J. Plauger]], is a study of [[programming style]], advocating the notion that computer programs should be written not only to satisfy the compiler or personal programming "style", but also for "readability" by humans, specifically [[software maintenance]] engineers, [[programmers]] and [[technical writers]].
 
The book pays explicit homage, in title and tone, to ''[[The Elements of Style]]'', by [[William Strunk Jr.|Strunk]] & [[E. B. White|White]] and is considered a practical template promoting [[Edsger Dijkstra|Edsger Dijkstra's]] [[structured programming]] discussions. It has been influential and has spawned a series of similar texts tailored to individual languages, such as "The Elements of C Programming Style", "The Elements of C# Style", "The Elements of Java(TM) Style", "The Elements of MATLAB Style", etc.
 
The book is built on short examples from actual, published programs in programming textbooks. ItsThis advice is therefore delivered notresults in ana academicpractical or pedagogical vacuum, buttreatment rather inthan thean contextabstract ofor examples which are believable and realistic, sometimes uncomfortablyacademic sodiscussion. The style is diplomatic and generally sympathetic in its criticism, and unabashedly honest as well— some of the examples with which it finds fault are from the authors' own work (one example in the second edition is from the first edition).
 
Its lessons are summarized at the end of each section in pithy maxims, such as "Let the machine do the dirty work."
 
Modern readers may find it a shortcoming that its examples use older [[procedural programming languages]] ([[Fortran]] and [[PL/I]]) which are quite different from those popular today. (Few of today's popular languages had been invented when this book was written.) However, many of the book's points that generally concern stylistic and structural issues transcend the idiosyncrasiesdetails of particular languages.
 
==References==