The Elements of Programming Style: Difference between revisions

Content deleted Content added
Adding local short description: "1978 book by Brian W. Kernighan and P. J. Plauger", overriding Wikidata description "book by Brian Kernighan" (Shortdesc helper)
MOS fixes
Line 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 don't be too clever.
# Say what you mean, simply and directly.
# Use library functions whenever feasible.
# Avoid too many temporary variables.
# Write clearly don't sacrifice clarity for efficiency.
# Let the machine do the dirty work.
# Replace repetitive expressions by calls to common functions.
Line 69:
# Modularize. Use procedures and functions.
# Avoid gotos completely if you can keep the program readable.
# Don't patch bad code rewrite it.
# Write and test a big program in small pieces.
# Use recursive procedures for recursively-defined data structures.
Line 100:
# Make sure special cases are truly special.
# Keep it simple to make it faster.
# Don't diddle code to make it faster find a better algorithm.
# Instrument your programs. Measure before making efficiency changes.
# Make sure comments and code agree.
# Don't just echo the code with comments make every comment count.
# Don't comment bad code rewrite it.
# Use variable names that mean something.
# Use statement labels that mean something.
Line 125:
==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 - 2009 Brian Kernighan talk at Princeton}}
 
{{DEFAULTSORT:Elements Of Programming Style, The}}