<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>jjncj.com - programming</title>
    <link>http://jjncj.com/blog/</link>
    <description>News and writings by JJ and CJ and Family</description>
    <dc:language>en</dc:language>
    <admin:errorReportsTo rdf:resource="mailto:blogadmin@jjncj.com" />
    <generator>Serendipity 1.3.1 - http://www.s9y.org/</generator>
    <pubDate>Thu, 01 May 2008 10:52:09 GMT</pubDate>

    <image>
        <url>http://jjncj.com/blog/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: jjncj.com - programming - News and writings by JJ and CJ and Family</title>
        <link>http://jjncj.com/blog/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>The Futility of Comments</title>
    <link>http://jjncj.com/blog/archives/141-The-Futility-of-Comments.html</link>
            <category>programming</category>
    
    <comments>http://jjncj.com/blog/archives/141-The-Futility-of-Comments.html#comments</comments>
    <wfw:comment>http://jjncj.com/blog/wfwcomment.php?cid=141</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://jjncj.com/blog/rss.php?version=2.0&amp;type=comments&amp;cid=141</wfw:commentRss>
    

    <author>joshua@joshuakugler.com (Joshua Kugler)</author>
    <content:encoded>
    Anyone who has programmed for any length of time has an opinion about comments in code.  They&#039;re essential. They&#039;re not essential. Commenting is actually worse than not commenting.  It runs the gamut.  I&#039;m beginning to understand more and more that comments are actually a disctraction to clean, clear, concise code.  Especially when writing in Python, it is possible to write code that requires no comments, but is still 100% understandable and discoverable.  Sometimes a line or two is required to explain something not clear from context, but it&#039;s rare.&lt;br /&gt;
&lt;br /&gt;
After reading a piece by Steven Smith entitled &lt;a href=&quot;http://aspadvice.com/blogs/ssmith/archive/2008/05/01/Comments-in-Code-Indicate-Functions-Trying-To-Escape.aspx&quot; title=&quot;Steven Smith: Musings on ASP.NET and the .NET Developer Community&quot;&gt;Comments in Code Indicate Functions Trying To Escape&lt;/a&gt;, my lead programmer &lt;a href=&quot;http://blog.melhase.net/&quot; title=&quot;Round Rock River&quot;&gt;Troy Melhase&lt;/a&gt; (i.e. my &quot;boss&quot;), who is a strong proponent of clear code/no comments, wrote:&lt;br /&gt;
&lt;blockquote&gt;Yes.  Instead of writing comments, write code that doesn&#039;t need&lt;br /&gt;
comments.&lt;/blockquote&gt;&lt;br /&gt;
Clear, and concise, just like his code.  After musing on it a while, his ironic streak kicked in, and he composed the following &quot;epic tome,&quot; as he describes it, that so clearly illustrates the many useless blocks of comments I have seen in my time as a programmer.  He gave me permission to post it, so here you go! Enjoy.&lt;br /&gt;
&lt;br /&gt;
(BTW, visit Troy&#039;s blog.  He&#039;s written a Java to Python translator, and has a really cool stock-trading and analysis application.)&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;python&quot; style=&quot;text-align: left&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## Summary:&amp;#160; Explain why excessive comments suck.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;##&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;##&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## Author:&amp;#160; Troy Melhase&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## Email:&amp;#160; &amp;#160;troy@gci.net&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## Date:&amp;#160; &amp;#160; 05/01/2008&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;##&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;##&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## Detail:&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;##&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## Comments like this serve no purpose because you have to read all of the code in this file anyway.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## So here you are, reading useless information that I put here to satisfy a thoughtless policy&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## or an academic belief.&amp;#160; I could explain what the code does, but it&#039;s easier to blat out mindless&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## drivel that is easily mistaken for insight or actual work.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;##&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## Even if I do add useful information to the code below (doubtful), someone will have to edit this&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## information as the code changes.&amp;#160; That&#039;s like writing the code twice, and of course that doubles&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## the chances of introducing a bug.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;##&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## Plus, I&#039;ve distracted you from your purpose -- reading!&amp;#160; Reading code can be difficult without the&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## additional burden of constantly shifting gears between executable code and non-executable code (these &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## comments).&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;##&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## If you&#039;ve made it this far without giving up, you should realize that I&#039;ve still added zero information &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## to the subject and wasted your time in the process.&amp;#160; The original reply is still better, and you should&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## aim to adopt it as professional and personal coding policy.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;##&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## In case you missed the original reply, and in hopes of finding it here, buried at the bottom of this&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## epic tome (aka epic fail):&amp;#160; &amp;#160;Instead of writing comments, write code that doesn&#039;t need comments.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;##&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;##&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## Plus:&amp;#160; extra file encoding type cruft.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## Plus:&amp;#160; extra editor hint cruft.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## Plus:&amp;#160; extra version control meta data cruft.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;## Plus:&amp;#160; version control history that should be left in the version control system.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;##&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Now, this doesn&#039;t preclude &lt;i&gt;documentation&lt;/i&gt;--we use doc strings at the beginning of files, functions, and classes quite heavily--but in-line comments in code are rare. 
    </content:encoded>

    <pubDate>Thu, 01 May 2008 09:03:05 +0000</pubDate>
    <guid isPermaLink="false">http://jjncj.com/blog/archives/141-guid.html</guid>
    <category>clarity</category>
<category>comments</category>
<category>programming</category>
<category>python</category>

</item>
<item>
    <title>My feelings on PHP, exactly.</title>
    <link>http://jjncj.com/blog/archives/131-My-feelings-on-PHP,-exactly..html</link>
            <category>programming</category>
    
    <comments>http://jjncj.com/blog/archives/131-My-feelings-on-PHP,-exactly..html#comments</comments>
    <wfw:comment>http://jjncj.com/blog/wfwcomment.php?cid=131</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://jjncj.com/blog/rss.php?version=2.0&amp;type=comments&amp;cid=131</wfw:commentRss>
    

    <author>joshua@joshuakugler.com (Joshua Kugler)</author>
    <content:encoded>
    &lt;blockquote&gt;&quot;There are a lot of nice things about PHP, it&#039;s just that the language isn&#039;t one of them.&quot;&lt;/blockquote&gt;&lt;br /&gt;
from &lt;a href=&quot;http://news.e-scribe.com/409&quot;  title=&quot;From PHP to Python&quot;&gt;Paul Bissex&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&#039;Nuff said 
    </content:encoded>

    <pubDate>Fri, 14 Mar 2008 09:49:40 +0000</pubDate>
    <guid isPermaLink="false">http://jjncj.com/blog/archives/131-guid.html</guid>
    <category>php</category>
<category>programming</category>
<category>python</category>
<category>qotd</category>

</item>
<item>
    <title>Objects have failed...maybe...kind of</title>
    <link>http://jjncj.com/blog/archives/127-Objects-have-failed...maybe...kind-of.html</link>
            <category>programming</category>
    
    <comments>http://jjncj.com/blog/archives/127-Objects-have-failed...maybe...kind-of.html#comments</comments>
    <wfw:comment>http://jjncj.com/blog/wfwcomment.php?cid=127</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://jjncj.com/blog/rss.php?version=2.0&amp;type=comments&amp;cid=127</wfw:commentRss>
    

    <author>joshua@joshuakugler.com (Joshua Kugler)</author>
    <content:encoded>
    I came across this writeup a couple months ago, and composed a reply (via an e-mail to a colleague), but never posted it.&lt;br /&gt;
&lt;br /&gt;
Some people think &lt;a href=&quot;http://www.dreamsongs.com/ObjectsHaveFailedNarrative.html&quot;  title=&quot;Openning remarks by Richard P. Gabriel, November 6, 2002&quot;&gt;objects have failed&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
My response:&lt;br /&gt;
&lt;br /&gt;
Objects have &quot;failed&quot; in that they&#039;ve tried to be the be-all, end-all solution to all problems, while not being powerful enough to be the be-all, end-all.  On the other hand, they&#039;ve succeeded in that they are a good (often great) tool in many cases.  I often find that objects are nice just for state-encapsulation: keeps me from worrying about certain details at that moment; I might not even be abstracting anything of note.&lt;br /&gt;
 &lt;br /&gt;
And I think it comes down to this: procedural, functional, and OO programming tools are just that.  You use one or the other where they might be the most appropriate and most practical.  Take these few lines from a script in a project I&#039;m working on:  (disclaimer: yes, I wrote them).  &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;python&quot; style=&quot;text-align: left&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #dc143c;&quot;&gt;os&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;path&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;join&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&#039;.&#039;&lt;/span&gt;, full_name, f.&lt;span style=&quot;color: black;&quot;&gt;rstrip&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&#039;.tmpl&#039;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;,&lt;span style=&quot;color: #483d8b;&quot;&gt;&#039;w&#039;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;writelines&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #dc143c;&quot;&gt;string&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;Template&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #dc143c;&quot;&gt;os&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;path&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;join&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #dc143c;&quot;&gt;os&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;environ&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&#039;TACKDIR&#039;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt;,&lt;span style=&quot;color: #483d8b;&quot;&gt;&#039;template-manage&#039;&lt;/span&gt;,f&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;,&lt;span style=&quot;color: #483d8b;&quot;&gt;&#039;r&#039;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;read&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;substitute&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&#039;mod_name&#039;&lt;/span&gt;:mod_name&lt;span style=&quot;color: black;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
That is an interesting combination of functional (only two state variables: &#039;f&#039; from a surrounding  loop, and full_name) and object oriented (file and string.Template methods) programming.  And the combination works, works well, and is only one logical line of code, to boot.&lt;br /&gt;
 &lt;br /&gt;
I don&#039;t think it&#039;s a matter of object, functional, or procedural styles failing, it&#039;s about having a good knowledge of all three, and their capabilities, and being able to make realistic and practical decisions about what will be the best in a given situation.  It&#039;s also about using a language that lets you combine the three in a mix that works best for you and the given requirements.&lt;br /&gt;
&lt;br /&gt;
(In this case, that language is Python, but that&#039;s peripheral.)&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Fri, 08 Feb 2008 14:11:57 +0000</pubDate>
    <guid isPermaLink="false">http://jjncj.com/blog/archives/127-guid.html</guid>
    <category>functional</category>
<category>objects</category>
<category>procedural</category>
<category>programming</category>
<category>python</category>

</item>
<item>
    <title>Extracting dates from images with Python and OCR</title>
    <link>http://jjncj.com/blog/archives/116-Extracting-dates-from-images-with-Python-and-OCR.html</link>
            <category>programming</category>
    
    <comments>http://jjncj.com/blog/archives/116-Extracting-dates-from-images-with-Python-and-OCR.html#comments</comments>
    <wfw:comment>http://jjncj.com/blog/wfwcomment.php?cid=116</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://jjncj.com/blog/rss.php?version=2.0&amp;type=comments&amp;cid=116</wfw:commentRss>
    

    <author>joshua@joshuakugler.com (Joshua Kugler)</author>
    <content:encoded>
    In my job at &lt;a href=&quot;http://www.eeinternet.com&quot;  title=&quot;EEI&quot;&gt;EE Internet&lt;/a&gt;, we do a lot of remote data collection, including collection from cameras.  Now, the makers of these cameras have figured out how to put the date and time as a graphic in the image itself (&lt;a href=&quot;http://www.colville-watershed.org/stations/umiat/ideal_north.jpg&quot;  title=&quot;like this one&quot;&gt;Umiat Airfield&lt;/a&gt;) but for some reason they haven&#039;t figured out how to embed that same information in the &lt;a href=&quot;http://en.wikipedia.org/wiki/Exif#Example&quot;  title=&quot;EXIF data&quot;&gt;EXIF Data&lt;/a&gt; for that image.  Very aggravating.&lt;br /&gt;
&lt;br /&gt;
So, Python to the rescue.  I came up with a script that extracts the area given, converts it to black and white, inverts it (because these cameras have light text on dark background, and OCR doesn&#039;t seem to like that), and then feeds that file to a command-line OCR program.  It then takes that text, parses it for the date, and then prints it out in any date/time format desired.  Works quite well.&lt;br /&gt;
&lt;br /&gt;
Here it is in all its glory.&lt;br /&gt;
&lt;br /&gt;
Comments, improvements, critiques, etc., are always welcome.  And yes, you can post comments pointing to another program/project/whatever that does what I did and does it way better. &lt;img src=&quot;http://jjncj.com/blog/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;br /&gt;
&lt;li&gt;It requires Python&#039;s PIL image library&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;It defaults to using the gocr command.  This is available in the &#039;gocr&#039; package in Ubuntu.  It also seems to work well with ocrad, which is also available in Ubuntu.&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;There should not be any symlink vulnerabilities in this as the exclusive lock is kept on the file while there is data being written to it.  Once the data is written, and the file is closed, then it is passed to the OCR program as an input file. Then, it is removed.&lt;br /&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
UPDATE: Modularized it so you can call it from the command line, or import it into your own Python script and call it that way. &lt;br /&gt;&lt;a href=&quot;http://jjncj.com/blog/archives/116-Extracting-dates-from-images-with-Python-and-OCR.html#extended&quot;&gt;Continue reading &quot;Extracting dates from images with Python and OCR&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 11 Oct 2007 11:14:00 +0000</pubDate>
    <guid isPermaLink="false">http://jjncj.com/blog/archives/116-guid.html</guid>
    <category>geek</category>
<category>ocr</category>
<category>pil</category>
<category>programming</category>
<category>python</category>

</item>
<item>
    <title>Welcome to the world of Python, Jon!</title>
    <link>http://jjncj.com/blog/archives/63-Welcome-to-the-world-of-Python,-Jon!.html</link>
            <category>programming</category>
    
    <comments>http://jjncj.com/blog/archives/63-Welcome-to-the-world-of-Python,-Jon!.html#comments</comments>
    <wfw:comment>http://jjncj.com/blog/wfwcomment.php?cid=63</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://jjncj.com/blog/rss.php?version=2.0&amp;type=comments&amp;cid=63</wfw:commentRss>
    

    <author>joshua@joshuakugler.com (Joshua Kugler)</author>
    <content:encoded>
    Jon has a post about &lt;a href=&quot;http://akbourne.com/2007/04/02/getting-started-with-django/&quot;&gt;getting started with Django&lt;/a&gt;.  Welcome to Python, Jon.  I&#039;m sure you&#039;ll enjoy it.  As I&#039;ve &lt;a href=&quot;http://jjncj.com/blog/archives/15-Python...and-loving-it..html&quot;  title=&quot;Python...and loving it&quot;&gt;posted about before&lt;/a&gt;, I&#039;ve greatly enjoyed my foray into the world of Python.  While sticking with &quot;pure Django,&quot; especially if there is a CMS system on top of it, may mean you don&#039;t see Python much, if you start creating filters and editing templates, you&#039;ll probably dive right in to the language.&lt;br /&gt;
&lt;br /&gt;
If you have programming experience, snag a copy of &lt;a href=&quot;http://www.amazon.com/Python-Nutshell-OReilly-Alex-Martelli/dp/0596100469/ref=pd_bbs_sr_1/002-8818690-8576041?ie=UTF8&amp;s=books&amp;qid=1175577087&amp;sr=8-1&quot;&gt;Python in a Nutshell&lt;/a&gt;.  If you don&#039;t, grab Python in a Nutshell and &lt;a href=&quot;http://www.amazon.com/Learning-Python-Second-Mark-Lutz/dp/0596002815/ref=pd_bbs_1/002-8818690-8576041?ie=UTF8&amp;s=books&amp;qid=1175579988&amp;sr=8-1&quot;&gt;Learning Python&lt;/a&gt;.  Both have served me well.&lt;br /&gt;
&lt;br /&gt;
And of course, if you have a question, ping me.  I&#039;d be glad to share what I&#039;ve learned in my short, but productive eight months of learning Python.&lt;br /&gt;
&lt;br /&gt;
Python is a fun language, and easy to learn.  I&#039;m sure you&#039;ll have a great time. 
    </content:encoded>

    <pubDate>Mon, 02 Apr 2007 09:04:00 +0000</pubDate>
    <guid isPermaLink="false">http://jjncj.com/blog/archives/63-guid.html</guid>
    <category>django</category>
<category>programming</category>
<category>python</category>

</item>
<item>
    <title>Python...and loving it.</title>
    <link>http://jjncj.com/blog/archives/15-Python...and-loving-it..html</link>
            <category>programming</category>
    
    <comments>http://jjncj.com/blog/archives/15-Python...and-loving-it..html#comments</comments>
    <wfw:comment>http://jjncj.com/blog/wfwcomment.php?cid=15</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://jjncj.com/blog/rss.php?version=2.0&amp;type=comments&amp;cid=15</wfw:commentRss>
    

    <author>joshua@joshuakugler.com (Joshua Kugler)</author>
    <content:encoded>
    Way back in the early days of my interactions with the Internet (1996), I started learning the &lt;a href=&quot;http://www.perl.org&quot;  title=&quot;Perl.org site&quot;&gt;Perl&lt;/a&gt; programming language.  I had a client who wanted to create a database-driven web site, and before I realized I had no idea &lt;em&gt;how&lt;/em&gt; to do that, I said, &quot;I can do that.&quot;  Well, my search (probably on the term &quot;CGI&quot;) led me to &lt;em&gt;CGI Programming on the World Wide Web&lt;/em&gt; by Shishir Gundavaram.  Since that book used Perl, I learned Perl, my first &quot;real&quot; programming language (I had learned a little bit of C64/MS Basic before that).&lt;br /&gt;
&lt;br /&gt;
Fast forward ten years.  By now I&#039;ve done a few database-driven web sites, a few C/C++ projects, and a fair bit of database design and programming (in Visual Basic).  Should mean I&#039;m a Perl hacker for life, right?&lt;br /&gt;
&lt;br /&gt;
Well, maybe not.  Around the end of last year, I had just completed a 500 line script in Perl that extracted data from files, and generated pages and diagnostic data.  After that, I realized that I did not want to code my entire Master&#039;s project in Perl.  Keeping track of the data structures became a nightmare, and I realized how much I struggled to wrap my mind around the syntax, instead of it coming naturally and efficiently.  I needed something better...at least something that worked better for me.&lt;br /&gt;
&lt;br /&gt;
[I pause here to note: this is not a flame against Perl.  As I stated, I used Perl for 10 years, and enjoyed using it, and was very productive using it (at least in smaller scale projects).  I just came up against a project and domain where Perl wasn&#039;t the best fit &lt;em&gt;for me&lt;/em&gt;.  It may very well have been the best fit for someone else.  We now return to our regularly scheduled blog entry...]&lt;br /&gt;
&lt;br /&gt;
I&#039;m familiar with a lot of languages, but as stated, have only used Perl, Visual Basic, and C/C++ in any real capacity. I had heard a lot about Python, and knew enough to know that I&#039;d probably enjoy the way it&#039;s set up.  I like organization, and one of the ways Python organizes things is by using indents to denote blocks of code: all code at a particular level of indent is in the same block.  An example, using classes, methods, and &#039;if&#039; statements.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;python&quot; style=&quot;text-align: left&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;class&lt;/span&gt; DemoClass&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;object&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#inheriting from object denotes a &amp;quot;new style&amp;quot; class&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #0000cd;&quot;&gt;&lt;u&gt;_init_&lt;/u&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;, name&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Do some initialization here&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;name&lt;/span&gt; = name&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; sample_method&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;, var&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;var == &lt;span style=&quot;color: #483d8b;&quot;&gt;&#039;this&#039;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;That!&quot;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;elif&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;var == &lt;span style=&quot;color: #483d8b;&quot;&gt;&#039;thus&#039;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;Thusly!&quot;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
And there you have a fully functional python class.  Python&#039;s class syntax is so intuitive to me that I&#039;ve used (that is written) more classes in Python in the past few months than in all my years of Perl programming.  In addition, I find the syntax to use objects in Python to be more natural, and less to type for that matter.&lt;br /&gt;
&lt;br /&gt;
-- &#039;.&#039; instead of &#039;-&gt;&#039; as the object accessor.  It&#039;s just easier to type.&lt;br /&gt;
-- Calling the class name as the constructor instead of PackageName-&gt;new() makes more sense to me.&lt;br /&gt;
-- Declare a class with &#039;class ClassName&#039; instead of the several lines it takes to define a class in Perl&lt;br /&gt;
&lt;br /&gt;
There are other reasons and areas as well where the syntax, semantics, and philosophy of Python just makes more sense for me, and I may write on those in a future post.&lt;br /&gt;
&lt;br /&gt;
You can read my &lt;a href=&quot;http://jjncj.com/papers/PythonReasons.pdf&quot;  title=&quot;Python Reasons&quot; target=&quot;_blank&quot;&gt;evaluation and reasons&lt;/a&gt; (complete with Typos) which I wrote for my boss and coworker to justify coming up to speed in a new programming language for my Master&#039;s/Work project.&lt;br /&gt;
&lt;br /&gt;
To sum it all up, &quot;I&#039;m really liking and enjoying Python.&quot;  I rewrote that aforementioned 500 line script, and added even more functionality, and ended up with not much more code.  The language was very natural to learn, and it was very easy to come up to speed with the functions I needed.  I&#039;ve written about 1000 lines line python so far...I think I&#039;ve hooked. 
    </content:encoded>

    <pubDate>Sat, 10 Mar 2007 15:24:00 +0000</pubDate>
    <guid isPermaLink="false">http://jjncj.com/blog/archives/15-guid.html</guid>
    <category>geek</category>
<category>love</category>
<category>programming</category>
<category>python</category>
<category>tech</category>

</item>
<item>
    <title>AJAX just keeps getting better and better</title>
    <link>http://jjncj.com/blog/archives/24-AJAX-just-keeps-getting-better-and-better.html</link>
            <category>programming</category>
    
    <comments>http://jjncj.com/blog/archives/24-AJAX-just-keeps-getting-better-and-better.html#comments</comments>
    <wfw:comment>http://jjncj.com/blog/wfwcomment.php?cid=24</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://jjncj.com/blog/rss.php?version=2.0&amp;type=comments&amp;cid=24</wfw:commentRss>
    

    <author>joshua@joshuakugler.com (Joshua Kugler)</author>
    <content:encoded>
    Tonight I was reading through SourceForge&#039;s newsletter, and one of the top 25 projects is a relatively new one call &lt;a href=&quot;http://thinwire.sf.net/&quot;  title=&quot;ThinWire RIA Ajax Framework&quot;&gt;ThinWire&lt;/a&gt;.  There are a lot of existing frameworks out there for making AJAX applications look like &quot;desktop applications,&quot; and often they allow you to dispense with programming in HTML and Javascript.  Examples include &lt;a href=&quot;http://www.morfik.com/&quot;  title=&quot;null&quot;&gt;Morfik&lt;/a&gt;, Google Web Toolkit, and even a Python version: &lt;a href=&quot;http://pyjamas.pyworks.org/&quot;  title=&quot;Build AJAX apps in Python (like Google did for Java)&quot;&gt;Pyjamas&lt;/a&gt;.  With most frameworks, while they looked good, they were often heavy (large download), or left something to be desired in the aesthetics department. Thinwire looks to change that.  Take a look at their &lt;a href=&quot;http://207.200.22.70:8086/playground/&quot;  title=&quot;ThinWire Playground Demo&quot;&gt;Playground Demo&lt;/a&gt; for examples of the full range of the tool kit, then look at their &lt;a href=&quot;http://207.200.22.70:8086/mail/&quot;  title=&quot;ThinWire Mail Demo&quot;&gt;mail demo&lt;/a&gt; to see just how close to the &quot;desktop feel&quot; they get.  They are even working on a &lt;a href=&quot;http://www.thinwire.com/example_formcreator.html&quot;  title=&quot;null&quot;&gt;graphical form designer&lt;/a&gt; that is written using the framework itself.  Now there&#039;s power! And they claim in only a 100K download. Lest you think this is a toy framework, they also have a &lt;a href=&quot;http://www.youtube.com/watch?v=XLrPKmGmYdo&quot;  title=&quot;ThinWire Production Application&quot;&gt;video&lt;/a&gt; showing a production application written using ThinWire.  From their site:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;br /&gt;
This application has over 300 data input forms and dialogs with a wide range of complexity. It has a business rules engine that toggles the visibility of fields, required state of fields, limits dropdown options and much more....There are no page refreshes involved in updating anything within ThinWire®, the page is modified on the fly as a result of user actions that trigger event listeners on the server. Like all applications built with ThinWire®, no client-side code or HTML was written; all logic resides on the server. &lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
One teaser that caught my eye is on their front page where they say you can develop using Java, or &quot;alternatively, use a scripting language.&quot;  I can&#039;t find further explanation of that, but if I could program in this framework using Python, I think we would have a real winner. &lt;img src=&quot;http://jjncj.com/blog/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
They are &lt;a href=&quot;http://thinwire.com/blog/?p=65&quot;  title=&quot;null&quot;&gt;gunning for the Duke&#039;s Choice Award&lt;/a&gt;, so if you have experiences with ThinWire, or want to try it out, they are looking for company and developer feedback as part of the nomination process.  I&#039;ll certainly be following the development efforts. 
    </content:encoded>

    <pubDate>Tue, 13 Feb 2007 23:23:00 +0000</pubDate>
    <guid isPermaLink="false">http://jjncj.com/blog/archives/24-guid.html</guid>
    <category>ajax</category>
<category>geek</category>
<category>gui</category>
<category>java</category>
<category>programming</category>
<category>tech</category>

</item>
<item>
    <title>Time to change languages</title>
    <link>http://jjncj.com/blog/archives/17-Time-to-change-languages.html</link>
            <category>geek</category>
            <category>programming</category>
    
    <comments>http://jjncj.com/blog/archives/17-Time-to-change-languages.html#comments</comments>
    <wfw:comment>http://jjncj.com/blog/wfwcomment.php?cid=17</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://jjncj.com/blog/rss.php?version=2.0&amp;type=comments&amp;cid=17</wfw:commentRss>
    

    <author>joshua@joshuakugler.com (Joshua Kugler)</author>
    <content:encoded>
    If you&#039;re starting to end sentences &lt;a href=&quot;http://akbourne.com/2006/07/20/coding/&quot; &gt;with semicolons&lt;/a&gt; try Python. &lt;img src=&quot;http://jjncj.com/blog/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; My new primary language.  I have a draft saved at the moment about my transition to Python.  Short story: I&#039;m loving it.  Stay tuned. 
    </content:encoded>

    <pubDate>Tue, 30 Jan 2007 23:02:00 +0000</pubDate>
    <guid isPermaLink="false">http://jjncj.com/blog/archives/17-guid.html</guid>
    <category>geek</category>
<category>programming</category>

</item>

</channel>
</rss>