<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
  <head>
    <title>cmdln.net_2007-11-21</title>
    <expansionState>0,2,6,8,9,12,16,25,29,33,37,45,52,58,73,74,82</expansionState>
  </head>
  <body>
    <outline text="Intro" Offset="00:17">
      <outline text="Giving thanks"/>
    </outline>
    <outline text="Listener Feedback" Offset="04:41">
      <outline text="Katy suggest Software Engineering Radio"/>
      <outline text="Natalie talks about sensor meshes"/>
      <outline text="James talks about the cycle of up and down moods"/>
    </outline>
    <outline text="Word of the Week: core" Offset="11:39">
      <outline text="http://www.catb.org/jargon/html/C/core.html"/>
    </outline>
    <outline text="Inner Chapter: Programming Paradigms 1" Offset="12:35">
      <outline text="Programming at its simplest">
        <outline text="Data and instructions"/>
        <outline text="In fact, CPU caches come in exactly those two flavors"/>
        <outline text="A processor has elements, which execute instructions">
          <outline text="Direct instructions for CPU are machine code"/>
          <outline text="Elements typically do math, similar low level operations"/>
          <outline text="Arithmetic Logic Unit, Floating Point Unit"/>
        </outline>
        <outline text="CPU has registers, that hold data">
          <outline text="Additional instructions read, store data"/>
          <outline text="To and from registers, to and from memory, disk"/>
          <outline text="Data can be simple, just data, or complex"/>
          <outline text="Complex data is a struct, usually named fields whose value is simple or another struct"/>
          <outline text="Some flavors of assembly introduce structs, more commonly seen in higher level languages"/>
          <outline text="Higher refers to language being closer to the way people think about problems, solutions"/>
        </outline>
        <outline text="For more on CPU architecture basics, see Writing Great Code, Volume 1"/>
        <outline text="With these parts alone, programs would be highly repetitive, error prone"/>
        <outline text="Flow of control instructions add decisions">
          <outline text="Some CPUs support directly, like a conditional jump"/>
          <outline text="Usually these are added with languages above machine code"/>
          <outline text="Simplest is the if statement"/>
          <outline text="Next simplest and rarely exposed directly is goto">
            <outline text="Arbitrary goto is hard to maintain because it lacks context"/>
            <outline text="Goto just jumps to some arbitrary point"/>
            <outline text="Specifying where to go is where context is useful"/>
          </outline>
          <outline text="Next flow hackers learn after if, loop, is just a special case of an if and a goto">
            <outline text="Loops goto top or bottom of some arbitrary set of instructions"/>
            <outline text="They also introduce the idea of scope, a block of instructions handled together for flow"/>
          </outline>
        </outline>
        <outline text="Even with flow of control, code can be very expansive, repetitive, error prone"/>
      </outline>
      <outline text="Procedural programming">
        <outline text="What do you do when you want to repeat the same set of operations?"/>
        <outline text="Could do with a goto but, again, lacks context"/>
        <outline text="Doesn't reveal your intent for goto, also relies on correct return with another goto"/>
        <outline text="A procedure is a special block of code, a scope, that can be called by name"/>
        <outline text="Procedures take arguments, or parameters, to work on"/>
        <outline text="At their simplest, they return a result"/>
        <outline text="For instance a square root procedure takes a number and returns its root"/>
        <outline text="For some languages, they can alter the arguments passed in, this is called a side effect">
          <outline text="Side effect relies on method of passing arguments, either by value or by reference"/>
          <outline text="By value creates a copy so changes are thrown away when the procedure returns"/>
          <outline text="By reference means the procedure is working on the same data that the calling code has"/>
          <outline text="Changes by reference outlive procedure call"/>
        </outline>
        <outline text="The point is the procedure gives first real tool for organizing code"/>
        <outline text="When I have talked about functional decomposition, it is merely the decisions on what procedures to write"/>
      </outline>
      <outline text="Procedural introduced first discussion of paradigms">
        <outline text="Also can be contrasted to functional programming"/>
        <outline text="Functional is essentially a mathematical approach"/>
        <outline text="Variables, that is pointers to data, cannot be changed"/>
        <outline text="Calls to functions always produce a result, never a side effect"/>
        <outline text="Just like the way you write out mathematical formulae, no concept of changing a value, always producing something new"/>
      </outline>
      <outline text="To me, different paradigms are like schools of art">
        <outline text="Some sense of increasing sophistication with each new one"/>
        <outline text="Not necessarily, though"/>
        <outline text="Often the same scene or subject can be addressed by different schools with similar effect"/>
        <outline text="Sometimes the differences are substantive, others not"/>
        <outline text="Newer schools often revive techniques, ideas, from older schools"/>
        <outline text="The school you are taught often shapes your approach, even when you learn other schools"/>
        <outline text="These statements are also generally true of programming paradigms"/>
        <outline text="Flexibility of approach is even truer, because of universal aspect of computers"/>
        <outline text="Any universal program, e.g. a programming language interpreter or compiler, can emulate any other"/>
        <outline text="There are often differences in performance, efficiency but the point holds"/>
        <outline text="Once I realized this analogy, I actually relaxed considerably about what paradigms I know, use"/>
        <outline text="Found it easier to be open minded"/>
        <outline text="Much of the fundamentals, like data, procedures, flow of control and basic operations are the same for all"/>
      </outline>
      <outline text="Will explore object oriented and aspect oriented programming in future installments"/>
    </outline>
    <outline text="Outro" Offset="36:50">
      <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>
