<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
  <head>
    <title>cmdln.net_2007-09-26</title>
    <expansionState>0,1,4,6,7,8,12,16,19,20,27,32,40,48,56,66,67,75</expansionState>
  </head>
  <body>
    <outline text="Intro" Offset="00:17">
      <outline text="ADDCast #47">
        <outline text="http://addcast.net"/>
        <outline text="This was the reason my voice was rough"/>
      </outline>
    </outline>
    <outline text="Word of the Week: considered harmful" Offset="02:43">
      <outline text="http://www.catb.org/jargon/html/C/considered-harmful.html"/>
    </outline>
    <outline text="Inner Chapter: Over-Engineering" Offset="04:22">
      <outline text="Few things get to me like over engineered code">
        <outline text="Difficult to use">
          <outline text="Involves way too many parameters"/>
          <outline text="Typically exposes too much about the internal workings"/>
          <outline text="Exposure requires implicit knowledge"/>
        </outline>
        <outline text="Difficult to maintain">
          <outline text="Often brittle"/>
          <outline text="Slight changes cause unexpected side effects"/>
          <outline text="Even tracking down a piece code responsible for some feature is an effort"/>
        </outline>
      </outline>
      <outline text="What is over-engineered?">
        <outline text="Typically tries too hard to be general"/>
        <outline text="Violates single responsibility in the sense of trying to solve too many problems"/>
      </outline>
      <outline text="How do you recognize it?">
        <outline text="Too many parameters in methods, functions">
          <outline text="Re-factoring to introduce a parameter object can help"/>
          <outline text="Often exposes a concept that was over-looked"/>
          <outline text="Some shared state"/>
          <outline text="Is that state unique to the code in question?"/>
          <outline text="If not, can probably be abstracted away into another package or library"/>
          <outline text="If so, how much does a caller really need to know versus internal concern?"/>
        </outline>
        <outline text="Often calls have to be &quot;just so&quot;">
          <outline text="Argument values seem arbitrary"/>
          <outline text="Certain combinations don't work"/>
          <outline text="This often begs for some defaults"/>
          <outline text="Pick what will serve for 80% of the time and remove those arguments or pieces of state"/>
        </outline>
        <outline text="Violates locality of reference">
          <outline text="You have to travel more than one or two frames to find a declaration"/>
          <outline text="Argument, state is initialized by some unrelated, remote code"/>
          <outline text="Address this by copying existing state into local type"/>
          <outline text="Copy construction can enforce assumptions, raise local errors"/>
          <outline text="Again think about that shared state. is it hap hazard or intentional?"/>
          <outline text="Nothing wrong with promoting state objects to their own concern"/>
          <outline text="Think about various calling context's, like requests and sessions"/>
        </outline>
        <outline text="Too many interfaces">
          <outline text="An interface is very helpful for stipulating a contract with no constraint on implementation"/>
          <outline text="One or two is often enough"/>
          <outline text="More can be confusing as interface don't speak as clearly to cooperations"/>
          <outline text="Provide default implementations of interfaces with reasonable default behavior"/>
          <outline text="Just because some aspect of your code can be extended doesn't mean it should"/>
          <outline text="What is truly an external concern?"/>
          <outline text="What is part of the encapsulated logic?"/>
        </outline>
      </outline>
      <outline text="Things to keep in mind">
        <outline text="What is the most simple design, implementation that does the job?"/>
        <outline text="The more specialized your code, the harder it is to re-use"/>
        <outline text="Simple interfaces, logic, lead to surprising re-use"/>
        <outline text="The less code you have, the less room for bugs"/>
        <outline text="Also, the easier it is to harden, defend code"/>
        <outline text="The fewer relationships, responsibilities, the easier it is to describe"/>
        <outline text="The easier it is to describe, the less likely someone will misuse"/>
      </outline>
      <outline text="My favorite example of just enough engineering, Java Collections">
        <outline text="Very few interfaces"/>
        <outline text="Very consistent behavior across all interfaces"/>
        <outline text="Strong use of convention"/>
        <outline text="Once you know how to do something with one type, that's how it works with all"/>
        <outline text="Advanced uses are possible, and not difficult"/>
        <outline text="More sophisticated features don't make simple use any harder"/>
        <outline text="Good defaults"/>
      </outline>
      <outline text="Learning how not to over-engineer can be one of the most difficult challenges"/>
      <outline text="Know when to say enough and stop coding"/>
    </outline>
    <outline text="Outro" Offset="21:12">
      <outline text="Contact me">
        <outline text="Email to feedback@thecommandline.net"/>
        <outline text="Web site at http://thecommandline.net/"/>
        <outline text="IM to command.line@skype"/>
        <outline text="Listener comment line is 360-252-7284"/>
        <outline text="del.icio.us tag is &quot;for:cmdln&quot;"/>
        <outline text="http://twitter.com/cmdln"/>
      </outline>
      <outline text="I'd like to thank libsyn.com for AAC hosting and Wouter de Bie for MP3 hosting"/>
      <outline text="These notes and the show audio and music are covered by a Creative Commons license">
        <outline text="http://creativecommons.org/licenses/by-nc-sa/3.0/us/"/>
        <outline text="Attribution, non-commercial, share alike"/>
      </outline>
    </outline>
  </body>
</opml>
