Content deleted Content added
+cat and add 2009 lecture |
m →Lessons: replaced: recursively-defined → recursively defined |
||
(5 intermediate revisions by 5 users not shown) | |||
Line 1:
{{Short description|1978 book by Brian W. Kernighan and P. J. Plauger}}
{{third
{{Infobox book
| italic title = <!--(see above)-->
Line 53 ⟶ 54:
==Lessons==
Its lessons are summarized at the end of each section in [[Aphorism|pithy maxims]], such as "Let the machine do the dirty work":
# Write clearly
# Say what you mean, simply and directly.
# Use library functions whenever feasible.
# Avoid too many temporary variables.
# Write clearly
# Let the machine do the dirty work.
# Replace repetitive expressions by calls to common functions.
Line 68 ⟶ 69:
# Modularize. Use procedures and functions.
# Avoid gotos completely if you can keep the program readable.
# Don't patch bad code
# Write and test a big program in small pieces.
# Use recursive procedures for recursively
# Test input for plausibility and validity.
# Make sure input doesn't violate the limits of the program.
Line 99 ⟶ 100:
# Make sure special cases are truly special.
# Keep it simple to make it faster.
# Don't diddle code to make it faster
# Instrument your programs. Measure before making efficiency changes.
# Make sure comments and code agree.
# Don't just echo the code with comments
# Don't comment bad code
# Use variable names that mean something.
# Use statement labels that mean something.
# Format a program to help the reader understand it.
# Document your data layouts.
# Don't over-comment.
Modern readers may find it a shortcoming that its examples use older [[procedural programming languages]] ([[Fortran]] and [[PL/I]])
==Reception==
Line 124:
==External links==
*[http://www.softwarequotes.com/showquotes.aspx?id=574&name=P. J. Plauger selected quotes from ''The Elements of Programming Style'']
*{{YouTube|id=8SUkrR7ZfTA|title=Elements of Programming Style
{{DEFAULTSORT:Elements Of Programming Style, The}}
[[Category:1974 non-fiction books]]
[[Category:Computer programming books]]
[[Category:Collaborative non-fiction books]]
[[Category:McGraw-Hill books]]
|