Staple Pattern

Illustrated by excerpt: StaplePattern -- ThinkingOutLoud DonaldNoyes 20070130

''<rant> I delve through the code base as I prepare to maintain. I notice the use of functions and macros, classes and defines peppered throughout the code. They may be a class, in a function, or a namespace, and it is not descriptive: it is a 'helper'. Helper is a code smell. You don't understand the problem, only that the solution in its current form requires help. A suggestion: choose a more helpful name.

The coup de grace comes when those enamored by the patterns movement find themselves smitten with helpers -- snippets of code who do nothing on their own and barely something when composed -- and suggest they are grand pieces of an architectural puzzle: proxy-helper-singleton-visitor; pub-sub-impl-pimple-lightweight-provider. Understand the problem better and describe better the solution. Choose better names; helpers are not helpful! </rant> ''

Here four staples are used to secure the "rant" two used to secure the "top or beginning" and two more to secure the "bottom or ending". Many other SymbolCharacters? fit this pattern:

 StaplePatternExamples? {
  "include"
  'a'
  (elaboration or extension)
  [include]
  /*
   comments
   etc.
  */
  markup{
   <html> source </html>
  Bold Text
  Italic Text
  }
 }


Related:


EditText of this page (last edited October 9, 2007) or FindPage with title or text search