<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
  <head>
    <title>cmdln.net_2007-12-12</title>
    <expansionState>0,2,4,5,12,19,27,40,55,70,83,84,92</expansionState>
  </head>
  <body>
    <outline text="Intro" Offset="00:17">
      <outline text="Terry Pratchett diagnosed with Alzheimer's"/>
    </outline>
    <outline text="Word of the Week: crash" Offset="03:49">
      <outline text="http://catb.org/jargon/html/C/crash.html"/>
    </outline>
    <outline text="Inner Chapter: Programming Paradigms 2" Offset="05:18">
      <outline text="Data structures">
        <outline text="Refresh on variables, storing simple values"/>
        <outline text="Simple being typically some form of number"/>
        <outline text="Incremental step between simple values, data structures is an array"/>
        <outline text="A series, usually a fixed number of them, of simple values, all the same type"/>
        <outline text="Data structure is a mixed bag  of simple values"/>
        <outline text="Each property or element in a structure has a name or index"/>
      </outline>
      <outline text="Scopes, local and global">
        <outline text="Local is defined in a procedure"/>
        <outline text="Has to be passed as a parameter value"/>
        <outline text="Can get cumbersome"/>
        <outline text="Some languages allow global variables"/>
        <outline text="All code every has access to the same data"/>
        <outline text="Can be dangerous, don't know as cleanly how that data changes"/>
      </outline>
      <outline text="Managing state">
        <outline text="Without data structures, you have a set of unrelated simple values"/>
        <outline text="Collecting them together communicates intent, part of the same thing"/>
        <outline text="Initially refer to state as an oblique reference to a state machine"/>
        <outline text="http://en.wikipedia.org/wiki/State_machine"/>
        <outline text="Procedures that change structures create an emergent state machine"/>
        <outline text="Understanding transitions, interactions is helpful"/>
        <outline text="Helps bound partitions of unrelated state, unintended effects"/>
      </outline>
      <outline text="Dynamic structures">
        <outline text="Fixed sized structures are only so useful"/>
        <outline text="Need to allow for however much state is needed ahead of time"/>
        <outline text="Can run into bounds problems or waste memory"/>
        <outline text="A data is just an address in memory, information about the byte layout in memory"/>
        <outline text="What if you could grab a chunk of memory at runtime, declare its structure?"/>
        <outline text="This is dynamic programming"/>
        <outline text="Usually involves a pointer"/>
        <outline text="Pointer points at memory, carries type which says how big, what structure"/>
        <outline text="Compare array to linked list"/>
        <outline text="Fixed structures can be more efficient, know read sizes ahead of time"/>
        <outline text="Dynamic can be less efficient, may have to read more, traversing pointers"/>
        <outline text="Increases complexity of state management"/>
      </outline>
      <outline text="What if some procedures only make sense to some structures?">
        <outline text="Can do this by convention, use modules to associate"/>
        <outline text="What is some of the state is changes as a side effect of other changes?"/>
        <outline text="Can't do that with pure procedural programming"/>
        <outline text="All parts of a structure are equally accessible to all procedures"/>
        <outline text="OO combines structures and procedures into the concept of an object"/>
        <outline text="Procedures on objects are usually called methods"/>
        <outline text="Structures on objects are usually called fields, attributes or members"/>
        <outline text="Other code sends messages to objects via those methods"/>
        <outline text="Can simply be thought of as calling an object's method"/>
        <outline text="The distinction is important to some languages, like Small Talk"/>
        <outline text="Means that some part of an object state can be hidden"/>
        <outline text="Methods can change but not external callers"/>
        <outline text="This is encapsulation, hiding implementation to any code outside of an object's definition"/>
        <outline text="Object definition is typically called a class"/>
      </outline>
      <outline text="Inheritance, polymorphism">
        <outline text="These are other qualities often ascribed to OO"/>
        <outline text="I think this is more specific to some early OO rather than being critical to OO"/>
        <outline text="Inheritance means that there can be a hierarchy of types"/>
        <outline text="Polymorphism means that a caller can call a method on a parent or super type"/>
        <outline text="Object of child type can have its own, different behavior"/>
        <outline text="Getting this right is problematic"/>
        <outline text="Anything that depends on aspects of state visible outside class are easily broken"/>
        <outline text="Commutation of equivalence comparison"/>
        <outline text="Point, color point example"/>
        <outline text="Interface inheritance is typically safer but often dismissed"/>
        <outline text="Too many consider implementation inheritance as primary means of code reuse"/>
        <outline text="Composing objects is safer method of reuse most of the time"/>
        <outline text="Languages with more sophisticated access models, like C++ and friendly, make composition better"/>
        <outline text="Start to think about responsibilities and collaborations"/>
      </outline>
      <outline text="Especially with dynamism, procedural code can do all OO can">
        <outline text="C++, one of the most popular OO languages was original built with C"/>
        <outline text="Pointers to functions made it possible to associate behavior in structures"/>
        <outline text="OO can be done with pure functional classes and pure data structures"/>
        <outline text="The questions that are more important are about the state being managed"/>
        <outline text="What parts of the state should be public?"/>
        <outline text="What parts should be private?"/>
        <outline text="All of the public parts combine to define a combinatorial state space"/>
        <outline text="Private do too but can control the subspace that is reach"/>
        <outline text="Have to be careful as sometimes public, private is fuzzy; side effects"/>
        <outline text="No private state, don't need OO strictly speaking"/>
        <outline text="Need to make assurances about side effects, related field changes, need OO"/>
        <outline text="Can do by convention but opens the door for coincidental effects, other mistakes"/>
      </outline>
    </outline>
    <outline text="Outro" Offset="32:58">
      <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 240-949-2638"/>
        <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>
