<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Programmer Musings</title>
    <link rel="alternate" type="text/html" href="http://anomaly.org/wade/blog/" />
    <link rel="self" type="application/atom+xml" href="http://anomaly.org/wade/blog/atom.xml" />
   <id>tag:anomaly.org,2010:/wade/blog//1</id>
    <link rel="service.post" type="application/atom+xml" href="http://anomaly.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1" title="Programmer Musings" />
    <updated>2009-10-21T04:38:55Z</updated>
    <subtitle>General thoughts on the craft/art/science of programming and related topics.</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 3.2</generator>
 
<entry>
    <title>SVG: Coming of Age</title>
    <link rel="alternate" type="text/html" href="http://anomaly.org/wade/blog/2009/10/svg_coming_of_age_1.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://anomaly.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=203" title="SVG: Coming of Age" />
    <id>tag:anomaly.org,2009:/wade/blog//1.203</id>
    
    <published>2009-10-21T04:40:10Z</published>
    <updated>2009-10-21T04:38:55Z</updated>
    
    <summary>In the past few months, I have been focusing more on SVG. The most important reason was the SVG Open 2009 conference the first weekend of October.1 Some truly amazing demos and research are being done in this area despite...</summary>
    <author>
        <name>GWade</name>
        
    </author>
            <category term="SVG" />
    
    <content type="html" xml:lang="en" xml:base="http://anomaly.org/wade/blog/">
        <![CDATA[<p>In the past few months, I have been focusing more on <acronym title="Scalable Vector Graphics">SVG</acronym>. The most important reason was the <a href="http://www.svgopen.org/2009/">SVG Open 2009</a> conference the first weekend of October.<sup><a href="#note1">1</a></sup></p>

<p>Some truly amazing demos and research are being done in this area despite nay-sayers claiming that the technology is dead. Some of the biggest announcements leading up to the conference included two solutions for the one major browser that does not yet have native <acronym title="Scalable Vector Graphics">SVG</acronym> support.</p>

<p>* <a href="http://code.google.com/p/svgweb/">SVG Web</a> a JavaScript library for running SVG in any browser.<br />
* <a href="http://code.google.com/chrome/chromeframe/">Google Chrome Frame</a> a plugin that gives IE support for SVG, canvas, HTML5, etc.</p>

<p>The presentations ranged from interesting uses of vector graphics to great tools for business or government to jaw-dropping effects that you would have had to see to believe. Some of the presentations are already available from the SVG Open website, with others hopefully following soon.</p>

<p>One of the most profound things I got out of the conference is the large number of people that have not been deterred by the pessimism that has seemed to surround SVG in recent years. These people are doing amazing work and getting things done, despite inconsistent browser implementations and one, big holdout among the major browsers. Everyone seemed excited that browser implementations are becoming more complete and consistent with every release. The HTML 5 specification is defining the ability to write SVG inline.</p>

<p>Truly, SVG is coming of age.</p>

<p><a name="note1">[1]</a>  Disclaimer: I was on the organizing committee.</p>]]>
        
    </content>
</entry>
<entry>
    <title>All the Cool Kids are Going to git, But...</title>
    <link rel="alternate" type="text/html" href="http://anomaly.org/wade/blog/2009/06/all_the_cool_kids_are_going_to.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://anomaly.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=202" title="All the Cool Kids are Going to git, But..." />
    <id>tag:anomaly.org,2009:/wade/blog//1.202</id>
    
    <published>2009-06-27T19:13:05Z</published>
    <updated>2009-06-27T19:35:12Z</updated>
    
    <summary>There has been a lot of talk lately about projects moving to git. So far I the write-ups from people converting to git have all been glowing endorsements of the new one, true way. There&apos;s almost a religious fervor related...</summary>
    <author>
        <name>GWade</name>
        
    </author>
            <category term="CodeCraft" />
            <category term="Tools" />
            <category term="Version Control" />
    
    <content type="html" xml:lang="en" xml:base="http://anomaly.org/wade/blog/">
        <![CDATA[<p>There has been a lot of talk lately about projects moving to <a href="http://git-scm.com/">git</a>. So far I the write-ups from people converting to git have all been glowing endorsements of the new <em>one, true way</em>. There's almost a religious fervor related to the subject.</p>

<p>Since my experience has not been quite that good, I thought it was worth documenting what I have seen. Based on some of the responses I've seen to any negative comments I expect to be blasted if anyone actually reads this. But, if anyone else runs into these kinds of problems, you'll at least know one person has seen the same.</p>

<h2 class="subhead">What I Want in Version Control</h2>

<p>I have fairly simple needs from a version control system based on the last couple of decades of software development.</p>

<ol>
  <li>I want to be able to store my source in a <acronym title="Version Control System">VCS</acronym>.</li>
  <li>I want to be sure it can be recovered at any time.</li>
  <li>I want to be able compare different versions of a particular file or multiple files.</li>
  <lI>I want to be able to mark certain revisions so that I can get back to them.</li>
  <li>I want to be able to reorganize the files without major pain.</li>
  <lI>I want to be able to work on my code from different systems.</li>
</ol>

<p>I don't have a particular agenda or approach I care about. I just want to be able to work with my code and have the <acronym title="Version Control System">VCS</acronym> help me. At present, I don't have a major need for distributed version control, but it might be nice. For me, a <acronym title="Version Control System">VCS</acronym> is a tool, not a religion.</p>

<p>As time has gone on, I have used several <acronym title="Version Control System">VCS</acronym> or <acronym title="Software Configuration Management">SCM</acronym> systems. These include: <acronym title="Revision Control System">RCS</acronym>, <acronym title="Concurrent Versioning System">CVS</acronym>, Subversion, and ClearCase. (I also had to help support some people using SourceSafe long ago.) I've done branching and merging in all of those (except <acronym title="Revision Control System">RCS</acronym>), so I'm fairly conversant with the general issues.</p>

<h2 class="subhead">git: First Impressions</h2>

<p>A couple of years ago, I tried to use git and was badly frustrated, I could not get data committed. I wasn't able to follow my normal workflow. The tool forced me to completely change the way I was working. I immediately dropped it. I had a similar experience with another distributed <acronym title="Version Control System">VCS</acronym> tool (I don't remember which one), and so I discounted the whole mess as a bad idea.</p>

<p>Later, a fellow Perl Monger started talking a lot at the local meetings about how git was working well for him, and even gave a talk on the subject. It seemed like git might be worth trying again. With the information from that talk and better online resources that had become available in the intervening time, I was able to use git for a few minor projects I was working on.</p>

<p>It turns out that my original problem had to do with the <em>index</em> feature. This had apparently been a problem for many people and the newer tutorials made a point of explaining this feature better. I eventually got used to the extra step of re-adding files I had changed (or using the <code>-a</code> switch).</p>

<p>I was becoming somewhat comfortable with the tool.</p>

<h2 class="subhead">The First Disaster</h2>

<p>Because I was comfortable with my Subversion repositories and I had been told about the <code>git svn</code> tool, I was using Subversion as my remote repository. This allowed me to have it backed up with all of my other repositories and fit my comfort zone better than having the whole repository in the local directory. (I know a lot of people swear by that feature. But I remember disasters in the old <acronym title="Revision Control System">RCS</acronym> days when the repository was also stored with your sandbox. It was too easy to lose both your current work and all of the history with one mistake.)</p>

<p>Things seemed to be going along okay until one day when I decided to push some changes from my laptop to the Subversion repository and pull them to my working directory on my desktop.</p>

<p>At the time, I think that my desktop was up to date with the master branch. I had been doing some <em>history rewriting</em> clean up a few commits on a (local) branch. I merged a branch on my laptop to master and pushed the changes to the Subversion repository. A day or two later I pulled from the Subversion repository to my desktop machine. (The details are a little hazy since I expect the version control to keep up with what I've saved and when.) When I did, there were merge conflicts like crazy. Almost every file was conflicted somewhere. I tried to resolve the conflicts by hand and could not get everything back into a stable state.</p>

<p>This was quite surprising, because I've merged multi-month long branches in <acronym title="Concurrent Versioning System">CVS</acronym> (with much pain and suffering) as well as resolved merges in Subversion without much problem. Given the hype about how easy merges are with git, I was not expecting this.</p>

<p>Eventually, I came to the conclusion that the best thing to do was to blow away my working directly and start over with <code>git svn</code> with a new working directory. This was not a good feeling. Although I'm pretty sure there was nothing in my desktop working directory that I lost, this was not the kind of behavior I expected from a <acronym title="Version Control System">VCS</acronym>.</p>

<p>With some research, I eventually convinced myself that I must have messed up somewhere in the history rewriting and that was the cause of my mistake. Maybe history rewriting and Subversion weren't compatible or something.</p>

<h2 class="subhead">Twice is Coincidence</h2>

<p>A few months later, I was working on another project. I was still using Subversion as the remote repository for working with git. Honestly, despite all of the assurances that everything that goes into git comes back out again, I was still more comfortable with Subversion for safety.</p>

<p>Once again I was working on the code from two different machines. I had just finished some relatively hairy work and pushed to the remote (Subversion) repository. A day or two later, I pulled on the other machine and <em>BAM</em>, I'm in conflict hell again. I tried to resolve the issues without a whole lot of success. The conflicts did not seem to match up with what I could see on either machine. This time I'm sure I hadn't done any history rewriting. (I wasn't using that feature after the previous disaster.)</p>

<p>After fighting with the mess (and pulling two or three more times), I eventually gave up and blew away my working directory and rebuilt it.</p>

<p>I checked for similar stories on-line and talked with my local expert to no avail.</p>

<p>The biggest problem I had with it was that the actions that blew up that day were identical to things I had been doing all along. I couldn't track down exactly what I'm doing wrong or even localize it to a sequence of steps that caused the problem. As a developer myself, I know that reporting a bug that randomly blows up after doing something that worked the last dozen times in a row was not going to be taken too seriously.</p>

<p>At this point, it's worth reminding you that I've been using version control tools for almost 20 years. I've recovered from disasters in almost every one that I've used. I have never been left in this situation before.</p>

<h2 class="subhead">Glutton for Punishment?</h2>

<p>Despite a few bad experiences so far, most of my usage of git has done what I needed. I was still not completely comfortable with the new workflow. But the ability to add aliases and script new commands is quite addictive. I knew that my experiences had to be odd, otherwise people would be reporting them and dropping git like a hot rock.</p>

<p>I had a new project that I wanted to work on, so I decided to do things a little differently. This time, I worked entirely in git, no Subversion repository. I made a bare repository along side my Subversion (and <acronym title="Concurrent Versioning System">CVS</acronym>) repositories to give me a single spot to back up and began working on the new project.</p>

<p>Things went along fine for a month or so, until I needed to get ready for a conference. I had been working mostly on my desktop, but would need my laptop updated before I could go to the conference. I merged a couple of feature branches back to master and made certain everything was working fine. I pushed the master branch to the remote (git) repository. I went immediately to the laptop and did a pull. <em>BAM</em>, my working directory was suddenly a smoking crater with conflict shrapnel everywhere.</p>

<p>Unfortunately, this was a Catalyst project and I ran into a new kind of conflict hell. The Catalyst system uses a Perl ORM that creates class descriptions for data stored in a database. The main description of the classes are protected by an MD5 sum to show they haven't changed. Merging files with this sum in it are guaranteed to have conflicts. Unfortunately, I couldn't get the code to match up with either MD5. By this point, I had learned about the <code>git reset</code> command. But I still wasn't able to completely recover.</p>

<h2 class="subhead">Still Using git?</h2>

<p>In any normal circumstance, I would probably have throw away any tool that causes me this much grief. I have not yet had the religious conversion that many seem to have where git is concerned.</p>

<p>The only saving grace is that despite the disasters, I've always been able to recover my code (if not my working directory). I also haven't been able to nail down the problem. My latest attempt to stop the problems is to stop using the git that comes with Ubuntu and update to the latest.</p>

<p>I'm not convinced that git is as wonderful as everyone says, but it does have features I like.</p>

<p>Unlike most of the people writing about git, I'm not a <em>true believer</em>. It's got some advantages over the systems I've used before. But, despite their flaws, I've never had either Subversion or CVS to leave me with a smoldering crater where my working directory was.</p>

<p>I'm sure that someone (if anyone actually reads this) will tell me that I'm doing something horribly wrong, or that I just don't understand the beautiful elegance of Linus's vision. Frankly, I don't care. Elegance of design doesn't matter if the implementation blows up. As Richard Feynman once said,</p>

<blockquote>It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.</blockquote>

<p>I use version control to support my code. If it doesn't, I will switch to a new system. I haven't given up on git yet (it hasn't yet lost any code I've committed), but one more explosion may the last.</p>]]>
        
    </content>
</entry>
<entry>
    <title>More SVG and Perl</title>
    <link rel="alternate" type="text/html" href="http://anomaly.org/wade/blog/2009/05/more_svg_and_perl_1.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://anomaly.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=201" title="More SVG and Perl" />
    <id>tag:anomaly.org,2009:/wade/blog//1.201</id>
    
    <published>2009-05-07T02:30:35Z</published>
    <updated>2009-05-07T23:13:14Z</updated>
    
    <summary>In my last post, I talked about a quick little project that has grown into experimenting with several new tools/processes. I finally got a reasonable release out on CPAN as SVG::Sparkline version 0.30. This version supports 6 different sparkline types:...</summary>
    <author>
        <name>GWade</name>
        
    </author>
            <category term="SVG" />
    
    <content type="html" xml:lang="en" xml:base="http://anomaly.org/wade/blog/">
        <![CDATA[<p>In my last <a href="/wade/blog/2009/04/svg_sparklines_in_perl.html">post</a>, I talked about a quick little project that has grown into experimenting with several new tools/processes.</p>

<p>I finally got a reasonable release out on <a href="http://search.cpan.org/">CPAN</a> as <a href="http://search.cpan.org/search?query=SVG%3A%3ASparkline&mode=all">SVG::Sparkline</a> version 0.30. This version supports 6 different sparkline types: Area, Bar, Line, RangeArea, RangeBar, and Whisker. It also has better documentation in the form of a manual and a cookbook.</p>

<p>Proving once again that you never know who's watching, <a href="http://blog.codedread.com/">Jeff Schiller</a> (of SVG fame) commented on my last post that I needed a demo. &lt;grumble/&gt; I had a little demo application that I was using to print a primitive gallery of sparklines for my own debugging purposes. I've cleaned up the output and put the <a href="http://anomaly.org/wade/projects/svgSparklines/">Sparkline Gallery</a> on-line.</p>

<p>I also found that the module did not have as high <a href="http://cpants.perl.org/kwalitee.html">Kwalitee</a> as I expected. So, I did some cleanup to improve that value. (If you haven't run across <em>kwalitee</em> before, you might think it's a misspelling. Actually, it's a part joke/part serious measure for Perl modules. Check out the article for details.</p>

<p>I would have had this version finished sooner, if another SVG project had not distracted me. David Dailey <a href="http://tech.groups.yahoo.com/group/svg-developers/message/62224">mentioned</a> the idea of a Friendly Little Intermittent Clockfest. The last few times this subject came up, I was not tempted. For some reason, this time it bit me. Sometime soon, I'll probably be adding an SVG clock gallery to my site as well.</p>

<p>Every now and then the programming muse shows up and the ideas start flowing.&lt;grin/&gt;</p>

<p><em>Update:</em> Thanks to a minor failure on my part the 0.30 release was missing the Manual. I've released 0.31 to fix that.</p>]]>
        
    </content>
</entry>
<entry>
    <title>SVG Sparklines in Perl</title>
    <link rel="alternate" type="text/html" href="http://anomaly.org/wade/blog/2009/04/svg_sparklines_in_perl.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://anomaly.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=200" title="SVG Sparklines in Perl" />
    <id>tag:anomaly.org,2009:/wade/blog//1.200</id>
    
    <published>2009-04-26T01:48:10Z</published>
    <updated>2009-04-26T02:22:36Z</updated>
    
    <summary>For the last few weeks, I&apos;ve been working on a Perl module for creating Sparklines* in SVG. The original purpose of the project was a demonstration of working with SVG from Perl. It was intended to be an example in...</summary>
    <author>
        <name>GWade</name>
        
    </author>
            <category term="CodeCraft" />
            <category term="Perl" />
            <category term="SVG" />
            <category term="Web Development" />
    
    <content type="html" xml:lang="en" xml:base="http://anomaly.org/wade/blog/">
        <![CDATA[<p>For the last few weeks, I've been working on a Perl module for creating Sparklines<super><a href="#note">*</a></super> in <acronym title="Scalable Vector Graphics">SVG</acronym>. The original purpose of the project was a demonstration of working with <acronym title="Scalable Vector Graphics">SVG</acronym> from Perl. It was intended to be an example in a talk I was going to give for our local <a href="http://houston.pm.org/">Perl Mongers group</a>. As usual, it has grown to be much more than that. (I still hope to get back to that talk.&lt;shrug/&gt;)</p>

<p>In the process, I've been exploring a few other ideas that were not part of the original plan. I planned to develop the module as I usually do and then release it to <acronym title="Comprehensive Perl Archive Network">CPAN</acronym>. I released an early version (something I normally do not do) and got feedback from an interested developer within 24 hours. This was on a barely functional module.</p>

<p>Based on that email exchange and conversations with some local developers, this is turning into a much more robust and flexible module than originally intended. The interface has improved dramatically. There will be more types than originally planned. There are more ways to configure the look of the generated Sparklines. There is now a cookbook explaining how to generate different effects.</p>

<p>I've also put the module on <a href="http://github.com/">Github</a> as <a href="http://github.com/gwadej/svg-sparkline/tree/master">svg-sparkline</a>. Although I've been playing with git off and on for a few months now, this is the first time I've tried to use with it seriously.</p>

<p>Unlike many of my past projects, this one requires more visual design thought than I normally need. In a way, this <em>quick, little project</em> has turned into a way to experiment with several new ideas and skills at once. We'll have to see how this one turns out.</p>

<p><em>Note:</em><br />
<a name="note">*</a> A <em>Sparkline</em> is an <em>intense, word-sized graphic</em> intended to convey useful information inline within text. The concept was proposed by Edward Tuft in his book <em>Beautiful Evidence</em>. For more on sparklines, see Tuft's <a href="http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR&topic_id=1&topic=">article</a> on the subject.</p>]]>
        
    </content>
</entry>
<entry>
    <title>Chronistic Coupling, Communications</title>
    <link rel="alternate" type="text/html" href="http://anomaly.org/wade/blog/2009/03/chronistic_coupling_communicat_1.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://anomaly.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=199" title="Chronistic Coupling, Communications" />
    <id>tag:anomaly.org,2009:/wade/blog//1.199</id>
    
    <published>2009-03-15T05:29:51Z</published>
    <updated>2009-03-15T18:28:34Z</updated>
    
    <summary>The comments from Ian and rlb3 have made me think a bit more on what I said last time about Chronistic Coupling. One thing I didn&apos;t make perfectly clear is that I&apos;m not advocating avoiding Chronistic Coupling at all costs....</summary>
    <author>
        <name>GWade</name>
        
    </author>
            <category term="CodeCraft" />
            <category term="Design" />
            <category term="Objects" />
    
    <content type="html" xml:lang="en" xml:base="http://anomaly.org/wade/blog/">
        <![CDATA[<p>The comments from Ian and rlb3 have made me think a bit more on what I said <a href="http://anomaly.org/wade/blog/2009/02/serialized_objects_and_chronis.html">last time</a> about <em>Chronistic Coupling</em>. One thing I didn't make perfectly clear is that I'm not advocating avoiding Chronistic Coupling at all costs.</p>

<p>Any real system will require some amount of Chronistic coupling. The key design point is to decide how much. Choosing the wrong level of coupling will certainly impact how your system evolves in the future. Over the next few posts, I'm going to explore some of these levels of Chronistic coupling with some examples.</p>

<h2 class="subhead">Communications Protocols</h2>

<p>Once upon a time, people doing communication between two processes (or computers) regularly debated how the data should be transferred: ASCII or binary. (This was pre-Unicode.) The advocates of the binary approach argued that it was more efficient for two reasons:</p>

<ul>
   <li>Fewer bytes sent over the network</li>
   <li>No time spent converting to a network format and back</li>
</ul>

<p>When we transferred data at 1200 or 2400 bps these arguments were pretty convincing. Especially when communicating between processes on the same machine.</p>

<p>However, there were problems when communicating between machines that were not the same architecture. When crossing the architecture boundary, you had to do conversions anyway. Some places where the binary format might change include:</p>

<ul>
   <li>Byte order</li>
   <li>Size of primitive data types</li>
   <li>Format of floating point data storage</li>
   <li>Padding in larger binary structures (structs, etc.)</li>
   <li>Encoding of strings (nul-terminated, length, etc.)</li>
</ul>

<p>Soon, a sizable amount of effort could be applied to converting binary data from other machines to the native format. The worst part about this was the lack of information in the data stream to help troubleshoot problems. Normally, you found out that your decoding logic was wrong when some portion of the binary data stream gave ridiculous results, or when you got to the end of the stream and found you had too little or too much data.</p>

<p>Meanwhile, text-based protocols sent more data over the wire (which became less of a problem as networks became faster). But, where a text-based protocol really shines is in debugging the data stream. If the next number in the stream is 1000000 and you expected a 16-bit short int, it's easy to see there's a problem. In a binary stream, the first two bytes of a long int look the same as an actual short int, there's no way to tell (at the protocol level) that something is wrong.</p>

<p>There were still problems. There was the EBCDIC vs. ASCII issue, which has mostly gone away. There is also the line ending problem, (LF vs, CRLF vs. CR).</p>

<p>The biggest win for the text-based protocols was the success of TCP/IP protocols on the network. A large number of the protocols that run the Internet are basically text. For example, HTTP, SMTP, FTP, Telnet, and more are basically a series of text strings sent between the client and server.</p>

<p>The major solutions to the size issue are relatively straight-forward. First, the networks got faster, so the problem is less of an issue. In places where bandwidth is still a problem, we can compress the text stream (gzip) to reduce the number of bytes. Since the compression is something that can be used by everyone, it is been greatly optimized over the years giving more benefit to everyone.</p>

<h2 class="subhead">The Present</h2>

<p>As a result of the (possibly compressed) text-based protocols used on the net today, machines with very different architectures can communicate easily. Text protocols have a lower chronistic coupling than binary protocols. An email client written to work on 16-bit Windows 3.1 could send messages to a client on a 32-bit Windows XP system. A web page served from a 64-bit Linux box can be viewed comfortably on Mac OS X, Windows Vista, or a mobile phone. More importantly, these clients don't need to know if the web page was generated from a C++ program, Ruby, Java, Lisp, or even Forth. It just doesn't matter.</p>

<p>Our video and audio formats are still binary because of the large amount of data being transferred. We still have chronistic coupling issues there. If you don't have the right codec for the file, you are basically out of luck. Many of these codecs are tied directly to the architecture where they were written.</p>

<p>In this case, the trade-off for reduced size is still more important than the ease of porting to multiple architectures.</p>]]>
        
    </content>
</entry>
<entry>
    <title>Serialized Objects and Chronistic Coupling</title>
    <link rel="alternate" type="text/html" href="http://anomaly.org/wade/blog/2009/02/serialized_objects_and_chronis.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://anomaly.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=198" title="Serialized Objects and Chronistic Coupling" />
    <id>tag:anomaly.org,2009:/wade/blog//1.198</id>
    
    <published>2009-02-09T04:10:46Z</published>
    <updated>2009-02-09T04:12:31Z</updated>
    
    <summary>Many programs have a need to store program state to disk at various points. An approach used by many of these programs is to serialize the objects representing the program state directly to disk (or a database). Back in 2004...</summary>
    <author>
        <name>GWade</name>
        
    </author>
            <category term="CodeCraft" />
            <category term="Design" />
            <category term="Objects" />
    
    <content type="html" xml:lang="en" xml:base="http://anomaly.org/wade/blog/">
        <![CDATA[<p>Many programs have a need to store program state to disk at various points. An approach used by many of these programs is to <em>serialize</em> the objects representing the program state directly to disk (or a database). Back in 2004 (<a href="http://anomaly.org/wade/blog/2004/01/xmlserialized_objects_and_coup.html">XML-Serialized Objects and Coupling</a>), I described a <em>coupling</em> problem caused by automatically serializing objects to XML.</p>

<p>Since that time, I have worked with other systems with similar functionality and have decided the problem was worse than I described five years ago. Serializing an object to disk with the intent of reading it in at a later date, couples the structure of the object from a past date to the structure of the object at a future date. If the object never changes form, that is not a problem. If the object structure needs to change, then the serialization process becomes more complicated. It has to take one of three forms:</p>

<ol>
   <li>Convert the object to and from the old format.</li>
   <li>Recognize the old object and transform it into the new structure.</li>
   <li>Institute a versioning system that allows reading and writing the current format and older formats.</li>
</ol>

<h2 class=:"subhead">Chronistic Coupling</h2>

<p>Recently, I have begun calling this effect <em>Chronistic Coupling</em>. (I like Temporal Coupling better, but that name is already taken.) Although you might think of this as another manifestation of <em>Data Coupling</em>, I think the time element makes Chronistic Coupling stronger (and more subtle) than data coupling. Unlike simple data coupling, object serialization couples the object <em>structure</em> through time. The older object format reaches forward in time to effect how the new program can structure its data.</p>

<p>If we allow saving in old formats, we must be very careful not to introduce an <em>anachronism</em>. This would be an old-style object that is inconsistent with the old program. This can cause problems that are hard to troubleshoot. You have to be able to identify where the <em>old</em> data came from to determine the problem. (In one system I worked on, we augmented the version of the data set with an extra piece of data describing the version of the program that saved this data.)</p>

<h2 class="subhead">Costs of Chronistic Coupling</h2>

<p>There is a sort of seductive quality to the idea that we can serialize objects and reinstantiate them at another time. This pattern recurs many times in the field of programming. Although it seems like a really good idea to have the data completely encapsulated by the object by serializing and deserializing the data straight to storage and back, the reality is there are still tradeoffs.</p>

<p>The obvious issue is to be certain that the data we read in is consistent with the design of the object. Most serialization needs to be augmented with some form of validation.</p>

<p>A separate issue that people often don't notice is that changes in the responsibilities and structure of an object can be hampered by Chronistic Coupling. At the very least, the code needed to deserialize old objects becomes much more complicated. In the worst case, it may be necessary to keep older classes in the design for the sole purpose of allowing us to convert old object into new object.</p>

<p>Where things really start to go bad is when a substantial portion of an object hierarchy changes. The object you have serialized may not bear any resemblance to the new classes. If the new object hierarchy is different enough, you would have to parse the old serialized object into a neutral format that can be used to instantiate the new objects, Either that, or you don't make the design improvements, because the work is too great (for this release). </p>

<p>In this way, the old design reaches into the future to prevent changes to the design. Often, the only way to <em>fix</em> the problem is to abandon backwards compatibility. This may result in major problems for clients or the need to provide special utility software to convert old data to a new format. </p>

<h2 class="subhead">Conclusion</h2>

<p>I am not saying that object serialization should always be avoided. The purpose of coining the term Chronistic Coupling is to give name to a cost that you may not realize that you are paying. In some cases, it might be better to store data in an object-neutral format and build new objects to represent the data rather than store the objects themselves. The unfortunate part of this is that there is no magical way to convert your objects to and from this simpler format.</p>

<p>No software can exist without some forms of coupling. However, some of the best minds in our field remind us to reduce coupling where we can. If you decide to use object serialization, remember that you are increasing coupling in the time dimension. It is important to consider whether or not this increased coupling is worth the cost.</p>]]>
        
    </content>
</entry>
<entry>
    <title>The Literals of Functional Programming</title>
    <link rel="alternate" type="text/html" href="http://anomaly.org/wade/blog/2009/01/the_literals_of_functional_pro_1.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://anomaly.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=197" title="The Literals of Functional Programming" />
    <id>tag:anomaly.org,2009:/wade/blog//1.197</id>
    
    <published>2009-01-26T02:30:02Z</published>
    <updated>2009-01-28T23:12:21Z</updated>
    
    <summary>I was listening to an older episode of Software Engineering Radio where they interviewed Martin Odersky on Scala (Episode 62). In the interview, Odersky made a comment about closures being the literals of functional programming. This statement struck me as...</summary>
    <author>
        <name>GWade</name>
        
    </author>
            <category term="CompSci General" />
            <category term="Languages" />
            <category term="Perl" />
            <category term="Programming Philosophy" />
    
    <content type="html" xml:lang="en" xml:base="http://anomaly.org/wade/blog/">
        <![CDATA[<p>I was listening to an older episode of <a href="http://se-radio.net/">Software Engineering Radio</a> where they interviewed Martin Odersky on Scala (<a href="http://se-radio.net/podcast/2007-07/episode-62-martin-odersky-scala">Episode 62</a>). In the interview, Odersky made a comment about closures being the literals of functional programming. This statement struck me as surprising. The more I thought about it, the more interesting and subtle the concept became.</p>

<p>In functional programming, functions are first-class values. (OOP advocates often say first-class objects, but this concept is more fundamental than that.) If a function is a value, like an integer is a value, a closure (or anonymous function) is the equivalent of a literal (like 2). This idea has been wandering around in my head for the last few days. The more I think about it, the more interesting it appears.</p>

<p>To get the most that you can out of an analogy, you need to apply what you know from one side of the analogy to the other to see if it gives any insight. Let's start with what we know about literals:</p>

<h2 class="subhead">Magic Literals</h2>

<p>We all know the problems with magic literals. Leaving them scattered around the code is a guaranteed way to make unmaintainable code. If the same magic literal is used in multiple spots, the making changes is harder than it needs to be. We normally solve this problem by replacing the literal with a defined constant. If that constant is well-named, this improves the readability of the code. (If the constant is not well-named, it can actually make things worse.)</p>

<p>There are a few cases where we may decide to use a literal despite this fact.</p>

<p>The initial index for a loop is almost always 0 (for C, C++, Perl, Java, etc.). There's really no need to name this literal, because it's function is obvious and it will not change (for a given language). Just as importantly, it's hard to come up with a name that means more to us that the value of the constant itself (please don't name it <code>ZERO</code>).</p>

<p>If you are working with date manipulation code, the literals <code>7</code> and <code>12</code> are obvious enough that we might not choose to make the constants <code>DAYS_PER_WEEK</code> or <code>MONTHS_PER_YEAR</code>. This decision is not quite as obvious, but it would be relatively easy to justify not making a constant. On the other hand, most people would probably prefer <code>MINUTES_PER_DAY</code> to <code>1440</code> and <code>SECONDS_PER_DAY</code> to <code>86400</code>. This shows that if the use of the literal is obvious enough, we may not need to name it. If there's any question about the purpose of the constant, we give it a name.</p>

<p>Another possibility would involve implementing an algorithm from a book that contained a large number of single use magic literals. You would probably keep the literals and reference the original algorithm in a comment rather than add constants that weren't in the original algorithm. In this case, being faithful to the original algorithm trumps concerns over magic literals.</p>

<h2 class="subhead">Function Literals</h2>

<p>The first thing that is worth considering about anonymous functions from this analogy is the possibility that giving the function a name might be wise. If the function is used in many places, giving it a name is probably good for maintenance.  (Just like making a constant out of a numeric literal simplifies maintenance.) Likewise, code containing a large number of anonymous functions is likely to be hard to maintain.</p>

<p>Also like the magic literal issue, there may be cases where the anonymous function is obvious enough that no name is needed. I'm going to propose some examples using Perl for the syntax. This is mostly because Perl has a fairly reasonable syntax for anonymous functions. It also has three operators for manipulating lists that make use of anonymous functions: <code>map</code>, <code>grep</code>, and <code>sort</code>, Let's use <code>map</code>. (The <code>map</code> operator generates a new list by applying an anonymous function to all of the elements of another list.)</p>

<p><code><br />
   @newlist = map { $_*2 } @oldlist;<br />
</code></p>

<p>Once you know that <code>$_</code> is the argument to the subroutine, it is obvious that this anonymous function doubles its argument. In this context, <code>@newlist</code> is a list where all of the elements are the doubles of the elements of <code>@oldlist</code>. A similarly obvious example (with better named variables) would be:</p>

<p><code><br />
    @elapsed_secs = map { $_*60 } @elapsed_minutes;<br />
</code></p>

<p>This anonymous function converts minutes to seconds by multiplying by 60. Giving the function a name would not really clarify things any. What about</p>

<p><code><br />
    @newlist = map { $_*($_*17 + 33) + 42 } @oldlist;<br />
</code></p>

<p>This example is the equivalent of a magic literal in the code. I can't imagine anyone looking at this and deciding that it is perfectly clear. Much like code containing the magic literal 17, this function should be named. Otherwise, the code is hard to read and maintain.</p>

<h2 class="subhead">Filtering with Predicates</h2>

<p>Another place that anonymous functions are useful is when filtering a list using <code>grep</code>. Like the <code>map</code> cases above, we can see that simple tests make good <em>function literals</em>.</p>

<p><code><br />
    @positive = grep { $_ > 0 } @unfiltered;<br />
</code></p>

<p>This anonymous function obviously selects positive numbers. Just like the next one selects numbers below a cutoff.</p>

<p><code><br />
   @selected = grep { $_ < $cutoff } @unfiltered.<br />
</code></p>

<p>However, just like the <code>map</code>, we can have examples that would benefit from naming the function.</p>

<p><code><br />
   @filtered = grep { $_ > 3 && $_ < 13 && $_%2 == 0 } @unfiltered;<br />
</code></p>

<p>It's going to be practically impossible to understand this without some help, so turning this anonymous function into a named function is probably worthwhile.</p>

<h2 class="subhead">Further Consideration</h2>

<p>Like numeric literals, functional literals can make code harder to understand. However, giving all closures names as a knee-jerk reaction is not a valid answer. Consider naming anonymous functions when it would make the code clearer without breaking it. I'm still not sure whether anonymous functions are as bad for maintenance as numeric literals. More thought and experimentation is needed.</p>

<p>So far, I don't feel like I've made it through very many of the implications of anonymous functions being the functional programming equivalent of literals. I'll probably write more later, as more implications come to me.</p>]]>
        
    </content>
</entry>
<entry>
    <title>Programming for/by Kids</title>
    <link rel="alternate" type="text/html" href="http://anomaly.org/wade/blog/2009/01/programming_forby_kids.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://anomaly.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=196" title="Programming for/by Kids" />
    <id>tag:anomaly.org,2009:/wade/blog//1.196</id>
    
    <published>2009-01-03T21:27:30Z</published>
    <updated>2009-01-03T21:42:49Z</updated>
    
    <summary>My son has talked several times about learning to program, but he&apos;s young enough that the normal programming approaches bore him. I had tried implementations of Logo in the past, without much success. A couple months ago, I was checking...</summary>
    <author>
        <name>GWade</name>
        
    </author>
            <category term="Languages" />
    
    <content type="html" xml:lang="en" xml:base="http://anomaly.org/wade/blog/">
        <![CDATA[<p>My son has talked several times about learning to program, but he's young enough that the normal programming approaches bore him. I had tried implementations of Logo in the past, without much success.</p>

<p>A couple months ago, I was checking the <a href="http://blog.makezine.com/">Make magazine blog</a> and stumbled upon an article about a <a href="http://blog.makezine.com/archive/2008/11/scrolling_mario_game_in_s.html">Scrolling Mario game in Scratch</a>. A little checking of the <a href="http://scratch.mit.edu/">Scratch site</a> left me convinced that this might work for a 9 year-old.</p>

<p>For an old programmer like myself, the graphical nature of the language is pure pain. I want to type in the expressions and code I need, instead of snapping together little blocks. The graphical nature of the thing is like programming with both hands tied behind my back. On the other hand, these same features make it much easier for the little boy. We went through the tutorial in about half an hour and he's been <em>coding</em> ever since. So far, I've been impressed with what he can put together.</p>

<p>The biggest surprise for me is what he is working on. When I started coding (much later in life than 9) I was building programs to solve problems and control things. I expected (from his other interests) that he would quickly get into games. Instead, he seems to be mostly building animated stories. Some of them quite good for the amount of time he spends on them.</p>

<p>If you know a young child who has some interest in programming and who doesn't have the patience for traditional languages, give Scratch a try. You may be surprised (and impressed) at the results.</p>]]>
        
    </content>
</entry>
<entry>
    <title>Interesting Ads</title>
    <link rel="alternate" type="text/html" href="http://anomaly.org/wade/blog/2008/12/interesting_ads.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://anomaly.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=195" title="Interesting Ads" />
    <id>tag:anomaly.org,2008:/wade/blog//1.195</id>
    
    <published>2008-12-21T05:42:54Z</published>
    <updated>2008-12-21T06:06:00Z</updated>
    
    <summary>The company SourceGear makes tools for software developers, mostly in the version control area. The company&apos;s founder is Eric Sink. Based on his blog and book, Sink seems to understand both business and technical issues. In 2007, I saw a...</summary>
    <author>
        <name>GWade</name>
        
    </author>
            <category term="Computer - Business" />
    
    <content type="html" xml:lang="en" xml:base="http://anomaly.org/wade/blog/">
        <![CDATA[<p>The company <a href="http://www.sourcegear.com/">SourceGear</a> makes tools for software developers, mostly in the version control area. The company's founder is Eric Sink. Based on his <a href="http://www.ericsink.com/">blog</a> and <a href="http://anomaly.org/wade/blog/2006/05/review_of_eric_sink_on_the_bus_1.html">book</a>, Sink seems to understand both business and technical issues.</p>

<p>In 2007, I saw a reference to their new advertising campaign styled as a comic book. At the time, they had t-shirts made featuring the villain <em>The Evil Mastermind</em>. The shirts looked amusing and the concept seemed worth a shot. I had seen similar ads before and they seemed okay.</p>

<p>I've been seeing the ads all year in programming magazines, and I admit they're good and really different. I've liked the way they use the <em>Evil Mastermind</em> to point out some of the inane non-technical hurdles we as developers need to jump through. They also have their t-shirt promotion running again (still?). If you are willing to meet <a href="http://www.sourcegear.com/TEM/TEMshirt.html"><acronym title="The Evil Mastermind">TEM</acronym>'s demands</a>, you can have a t-shirt for free.</p>

<p>So, here I am, paying for my shirt with an action picture of me.</p>

<p><img src="/wade/images/helmandcloak.png"  width="444" height="500" alt="G. Wade action shot"/></p>

<p>Anyone who knows me knows how much I hate being in a picture, but this was worth it.</p>

<p>Since I don't currently work in the Windows realm, I can't really say anything about their software; but the ads are great.</p>]]>
        
    </content>
</entry>
<entry>
    <title>SVG Lives: the Summary</title>
    <link rel="alternate" type="text/html" href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_summary.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://anomaly.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=194" title="SVG Lives: the Summary" />
    <id>tag:anomaly.org,2008:/wade/blog//1.194</id>
    
    <published>2008-11-23T18:20:08Z</published>
    <updated>2008-11-23T18:23:20Z</updated>
    
    <summary>This is the last in a series of posts refuting some recurring claims about the death of SVG, In the first post, I gave a brief overview of SVG. In the subsequent posts, I refuted each of the major claims...</summary>
    <author>
        <name>GWade</name>
        
    </author>
            <category term="SVG" />
    
    <content type="html" xml:lang="en" xml:base="http://anomaly.org/wade/blog/">
        <![CDATA[<p>This is the last in a series of posts refuting some recurring claims about the death of <acronym title="Scalable Vector Graphics">SVG</acronym>, In the <a href="http://anomaly.org/wade/blog/2008/11/reports_of_svgs_death_exaggera.html">first post</a>, I gave a brief overview of <acronym title="Scalable Vector Graphics">SVG</acronym>. In the subsequent posts, I refuted each of the major claims that I have seen for the death of <acronym title="Scalable Vector Graphics">SVG</acronym>.</p>

<p>Those claims were:</p>

<ol>
  <li><a href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_widget_claim.html">Death by lack of <acronym title="Graphical User Interface">GUI</acronym> Widget Claim</a></li>
  <li><a href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_3d_graphics_clai.html">Death by lack of the 3D Graphics Claim</a></li>
  <li><a href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_videoaudio_claim.html">Death by lack of the Video or Audio Playback Claim</a></li>
  <li><a href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_internet_explore.html">Death bby lack of the Internet Explorer support  Claim</a></li>
</ol>

<p>I hope by now you can seem that these recurring myths are based mostly on misunderstanding or misinformation. <acronym title="Scalable Vector Graphics">SVG</acronym> is a very effective technology, but it is not designed to do everything. Its popularity and usefulness have been growing for almost a decade now. Despite regular doom-sayers proclaiming the death of <acronym title="Scalable Vector Graphics">SVG</acronym>, it lives on and grows stronger every year.</p>

<p>If you are interested in learning more about <acronym title="Scalable Vector Graphics">SVG</acronym>, you should check out the following resources:</p>

<ul>
  <li><a href="http://www.planetsvg.com/">Planet <acronym title="Scalable Vector Graphics">SVG</acronym></a> from the <acronym title="Scalable Vector Graphics">SVG</acronym> Interest Group</li>
  <li><a href="http://wiki.svg.org/Main_Page">The <acronym title="Scalable Vector Graphics">SVG</acronym> Wiki</a></li>
  <li><a href="http://www.w3.org/Graphics/SVG/">Scalable Vector Graphics (SVG)</a> at the World Wide Web Consortium site: the definitive reference</li>
  <li><a href="http://www.w3.org/Graphics/SVG/IG/resources/StateOfArt-Dailey.html">State of the Art: An <acronym title="Scalable Vector Graphics">SVG</acronym> Primer for Today's Browsers</a> (It's long but it contains both simple and amazing examples.)</li>
  <li><a href="http://www.kevlindev.com/index.htm">KevLinDev</a>: lots of examples and tutorials</li>
  <li><a href="http://www.svgbasics.com/"><acronym title="Scalable Vector Graphics">SVG</acronym> Basics Tutorial</a></li>
  <li><a href="http://www.svg.org/">SVG.org</a></li>
</ul>

<p>You could also search the web for <acronym title="Scalable Vector Graphics">SVG</acronym>, new sites and resources pop up every day.</p>]]>
        
    </content>
</entry>
<entry>
    <title>SVG Lives: the Internet Explorer Claim</title>
    <link rel="alternate" type="text/html" href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_internet_explore.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://anomaly.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=193" title="SVG Lives: the Internet Explorer Claim" />
    <id>tag:anomaly.org,2008:/wade/blog//1.193</id>
    
    <published>2008-11-23T16:15:27Z</published>
    <updated>2008-11-23T18:24:29Z</updated>
    
    <summary>This is the next in a series of posts refuting some recurring claims about the death of SVG, In the first post, I gave a brief overview of SVG. Each subsequent post takes a claim and refutes it. The Claim...</summary>
    <author>
        <name>GWade</name>
        
    </author>
            <category term="SVG" />
    
    <content type="html" xml:lang="en" xml:base="http://anomaly.org/wade/blog/">
        <![CDATA[<p>This is the next in a series of posts refuting some recurring claims about the death of <acronym title="Scalable Vector Graphics">SVG</acronym>, In the <a href="http://anomaly.org/wade/blog/2008/11/reports_of_svgs_death_exaggera.html">first post</a>, I gave a brief overview of <acronym title="Scalable Vector Graphics">SVG</acronym>. Each subsequent post takes a claim and refutes it.</p>

<h2 class="subhead">The Claim</h2>

<blockquote><acronym title="Scalable Vector Graphics">SVG</acronym> is dead because it is not supported by Internet Explorer</blockquote>

<p>This argument is possibly the most complicated. For a long time, almost the only way to view <acronym title="Scalable Vector Graphics">SVG</acronym> in a browser was by using the <acronym title="Adobe SVG Viewer">ASV</acronym> plugin that worked best under <acronym title="Internet Explorer">IE</acronym>. Adobe has not improved this plugin in years and Microsoft has done nothing to make it easier to use. Meanwhile, the other major browsers (Firefox, Opera, and Safari, to name a few) have steadily been improving their native support for <acronym title="Scalable Vector Graphics">SVG</acronym>.</p>

<p>At present, <acronym title="Internet Explorer">IE</acronym> seems to be the only browser without any native support for <acronym title="Scalable Vector Graphics">SVG</acronym>. Despite the fact that <acronym title="Internet Explorer">IE</acronym> is the dominant browser, it's popularity has been falling in recent years (down to around 80% from the upper 90% range a few years ago). For some sites, the proportion of <acronym title="Internet Explorer">IE</acronym> visitors is even lower.</p>

<p>Several companies and individual groups have been revisiting the idea of developing a new <acronym title="Scalable Vector Graphics">SVG</acronym> plugin for <acronym title="Internet Explorer">IE</acronym>. When one of these projects completes, users of <acronym title="Internet Explorer">IE</acronym> would have the same access to <acronym title="Scalable Vector Graphics">SVG</acronym> as users of other browsers.</p>

<p>That isn't the whole story though. <acronym title="Scalable Vector Graphics">SVG</acronym> has actually spread in places other than the web. <acronym title="Scalable Vector Graphics">SVG</acronym> has been growing in popularity among cell phone systems, especially outside the United States. <acronym title="Scalable Vector Graphics">SVG</acronym> is very popular in the cartography community. Some companies are using <acronym title="Scalable Vector Graphics">SVG</acronym> behind the scenes, because it is relatively easy to manipulate from code, and then rasterizing the results.</p>

<p>Once upon a time, lack of support in <acronym title="Internet Explorer">IE</acronym> would have meant the death of almost any web format. Now, <acronym title="Inernet Explorer">IE</acronym> is not the only game on the web. More importantly, the market for <acronym title="Scalable Vector Graphics">SVG</acronym> as a vector format has spread beyond the web to phones, maps, and even operating systems (the <acronym title="K Desktop Environment">KDE</acronym> window manager on Linux makes extensive use of <acronym title="Scalable Vector Graphics">SVG</acronym>.)</p>

<p>Next time: <a href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_summary.html">Summary</a></p>]]>
        
    </content>
</entry>
<entry>
    <title>SVG Lives: the Video/Audio Claim</title>
    <link rel="alternate" type="text/html" href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_videoaudio_claim.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://anomaly.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=192" title="SVG Lives: the Video/Audio Claim" />
    <id>tag:anomaly.org,2008:/wade/blog//1.192</id>
    
    <published>2008-11-23T14:30:18Z</published>
    <updated>2008-11-23T16:39:07Z</updated>
    
    <summary>This is the next in a series of posts refuting some recurring claims about the death of SVG, In the first post, I gave a brief overview of SVG. Each subsequent post takes a claim and refutes it. The Claim...</summary>
    <author>
        <name>GWade</name>
        
    </author>
            <category term="SVG" />
    
    <content type="html" xml:lang="en" xml:base="http://anomaly.org/wade/blog/">
        <![CDATA[<p>This is the next in a series of posts refuting some recurring claims about the death of <acronym title="Scalable Vector Graphics">SVG</acronym>, In the <a href="http://anomaly.org/wade/blog/2008/11/reports_of_svgs_death_exaggera.html">first post</a>, I gave a brief overview of <acronym title="Scalable Vector Graphics">SVG</acronym>. Each subsequent post takes a claim and refutes it.</p>

<h2 class="subhead">The Claim</h2>

<blockquote><acronym title="Scalable Vector Graphics">SVG</acronym> is useless because it doesn't support video or audio.</blockquote>

<p>It's time to go back to our original <acronym title="Scalable Vector Graphics">SVG</acronym> definition. <acronym title="Scalable Vector Graphics">SVG</acronym> is, first and foremost, a vector image format. Although <acronym title="Scalable Vector Graphics">SVG</acronym> does provide some animation support, it is not a multimedia control language. The ability to play external video or audio is not necessary for doing 2D vector graphics. While this ability may be nice, it has nothing to do with <acronym title="Scalable Vector Graphics">SVG</acronym>'s design goals.</p>

<p>Saying this is a flaw in <acronym title="Scalable Vector Graphics">SVG</acronym> is more or less equivalent to saying the <acronym title="Joint Photographic Experts Group">JPEG</acronym> format is useless because it doesn't support playing external audio. No one would seriously expect a raster image format to play external audio. That does not stop this claim for the death of <acronym title="Scalable Vector Graphics">SVG</acronym>.</p>

<p>Many people have done very impressive work making animations with <acronym title="Scalable Vector Graphics">SVG</acronym>. Although, the full <acronym title="Synchronized Multimedia Integration Language">SMIL</acronym> language was designed to coordinate multimedia presentations, <acronym title="Scalable Vector Graphics">SVG</acronym> only included a subset that was appropriate to animating vector graphics. While powerful, this subset does not include the ability to play external video or audio.</p>

<p>The fact that <acronym title="Scalable Vector Graphics">SVG</acronym> has no support for video or audio playback doesn't impact its use in static vector images or even animated vector images. Despite the claim, <acronym title="Scalable Vector Graphics">SVG</acronym> is strong and healthy.</p>

<p>Next time: <a href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_internet_explore.html">The Internet Explorer Claim</a></p>]]>
        
    </content>
</entry>
<entry>
    <title>SVG Lives: the 3D Graphics Claim</title>
    <link rel="alternate" type="text/html" href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_3d_graphics_clai.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://anomaly.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=191" title="SVG Lives: the 3D Graphics Claim" />
    <id>tag:anomaly.org,2008:/wade/blog//1.191</id>
    
    <published>2008-11-23T04:39:03Z</published>
    <updated>2008-11-23T16:19:53Z</updated>
    
    <summary>This is the next in a series of posts refuting some recurring claims about the death of SVG, In the first post, I gave a brief overview of SVG. Each subsequent post takes a claim and refutes it. The Claim...</summary>
    <author>
        <name>GWade</name>
        
    </author>
            <category term="SVG" />
    
    <content type="html" xml:lang="en" xml:base="http://anomaly.org/wade/blog/">
        <![CDATA[<p>This is the next in a series of posts refuting some recurring claims about the death of <acronym title="Scalable Vector Graphics">SVG</acronym>, In the <a href="http://anomaly.org/wade/blog/2008/11/reports_of_svgs_death_exaggera.html">first post</a>, I gave a brief overview of <acronym title="Scalable Vector Graphics">SVG</acronym>. Each subsequent post takes a claim and refutes it.</p>

<h2 class="subhead">The Claim</h2>

<blockquote><acronym title="Scalable Vector Graphics">SVG</acronym> is useless because it doesn't support even basic 3D features</blockquote>

<p>This claim makes a little more sense than the previous one, but not much. The focus of <acronym title="Scalable Vector Graphics">SVG</acronym> was on <em>2 dimensional vector graphics</em>. It is obviously possible to render 3D objects by projecting them onto a 2D representation. After all, that's how 3D graphics are always displayed on a monitor. You can use <acronym title="Scalable Vector Graphics">SVG</acronym> as the 2D representation. However, <acronym title="Scalable Vector Graphics">SVG</acronym> does not provide any particular help for projections or 3D objects, because its focus is 2D graphics..</p>

<p>All of the image manipulation supported by <acronym title="Scalable Vector Graphics">SVG</acronym> is designed to support 2D vector graphics. This means that there is no support for perspectives or non-linear transforms. The painting model does not support explicit z-ordering. There is no support for 3D coordinates. None of these things are required for 2D vector graphics, so they do not exist in <acronym title="Scalable Vector Graphics">SVG</acronym>.</p>

<p>There are some separate projects that target 3D vector formats (<acronym title="Virtual Reality Modeling Language">VRML</acronym> and X3D are probably the most complete). X3D has even been written with a goal of being compatible with <acronym title="Scalable Vector Graphics">SVG</acronym>.</p>

<p>The fact that <acronym title="Scalable Vector Graphics">SVG</acronym> doesn't support 3D does not reduce its utility as a 2D vector image format. Despite this claim, <acronym title="Scalable Vector Graphics">SVG</acronym> is still alive and well.</p>

<p>Next time: <a href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_videoaudio_claim.html">The Video/Audio Claim</a></p>]]>
        
    </content>
</entry>
<entry>
    <title>SVG Lives: the Widget Claim</title>
    <link rel="alternate" type="text/html" href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_widget_claim.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://anomaly.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=190" title="SVG Lives: the Widget Claim" />
    <id>tag:anomaly.org,2008:/wade/blog//1.190</id>
    
    <published>2008-11-23T04:16:28Z</published>
    <updated>2008-11-23T15:09:17Z</updated>
    
    <summary>This is the second in a series of posts refuting some recurring claims about the death of SVG, In the last post, Reports of SVG&apos;s death exaggerated, I gave a little history and refresher on SVG. This time I will...</summary>
    <author>
        <name>GWade</name>
        
    </author>
            <category term="SVG" />
    
    <content type="html" xml:lang="en" xml:base="http://anomaly.org/wade/blog/">
        <![CDATA[<p>This is the second in a series of posts refuting some recurring claims about the death of <acronym title="Scalable Vector Graphics">SVG</acronym>, In the last post, <a href="http://anomaly.org/wade/blog/2008/11/reports_of_svgs_death_exaggera.html">Reports of <acronym title="Scalable Vector Graphics">SVG</acronym>'s death exaggerated</a>, I gave a little history and refresher on <acronym title="Scalable Vector Graphics">SVG</acronym>. This time I will try to tackle one of the claims about the death of <acronym title="Scalable Vector Graphics">SVG</acronym>.</p>

<h2 class="subhead">The Claim</h2>

<blockquote><acronym title="Scalable Vector Graphics">SVG</acronym> is useless because it doesn't have a widget toolkit for building <acronym title="Graphical User Interface">GUI</acronym>s</blockquote>

<p>This argument seems to resurface every year or so. Invariably it is floated either by someone trying to build a website completely on <acronym title="Scalable Vector Graphics">SVG</acronym> or by someone trying to compare <acronym title="Scalable Vector Graphics">SVG</acronym> to a <acronym title="Graphical User Interface">GUI</acronym>-building technology (recently that has been Microsoft's <acronym title="eXtensible Application Markup Language">XAML</acronym>).</p>

<p>The argument normally starts by asking for a particular widget in <acronym title="Scalable Vector Graphics">SVG</acronym>. A few people will show how they have constructed something, which leads to complaints about having to actually build what are <em>obviously</em> primitive tools. Next come the demands for a widget set in <acronym title="Scalable Vector Graphics">SVG</acronym>. After several rounds of emails, the person decides that <acronym title="Scalable Vector Graphics">SVG</acronym> is completely useless, because <em>it doesn't even have radio buttons or a text-entry field</em>.</p>

<p>The important point here is that <acronym title="Scalable Vector Graphics">SVG</acronym> is a vector image format. It was never designed to replace <acronym title="Graphical User Interface">GUI</acronym> widgets. It is just an extremely powerful format for specifying 2D images. This claim makes as much sense as saying <em><acronym title="Portable Network Graphics">PNG</acronym> will never amount to anything because it doesn't support scroll bars and drop down boxes</em>. Obviously, no one would make this claim. But, this reason for claiming the death of <acronym title="Scalable Vector Graphics">SVG</acronym> keeps recurring.</p>

<p>Amusingly enough, the <acronym title="K Desktop Environment">KDE</acronym> window manager for Linux uses <acronym title="Scalable Vector Graphics">SVG</acronym> extensively for graphical elements in its user interface. One reason is because vector formats are very efficient for stylized images that may need to scale to multiple sizes. This describes many of the graphical elements that display on most desktops.</p>

<p>The fact that <acronym title="Scalable Vector Graphics">SVG</acronym> does not have a built-in set of <acronym title="Graphical User Interface">GUI</acronym> widgets does not detract from its utility as a vector image format. As <acronym title="K Desktop Environment">KDE</acronym> has shown, <acronym title="Scalable Vector Graphics">SVG</acronym> can be used to build parts of a graphical user interface. That is not because it has built-in support for <acronym title="Graphical User Interface">GUI</acronym> widgets. It is because <acronym title="Scalable Vector Graphics">SVG</acronym> supports 2D graphics and many <acronym title="Graphical User Interface">GUI</acronym> elements are basically 2D graphics with behavior.</p>

<p>This claim is about <acronym title="Scalable Vector Graphics">SVG</acronym> not having support for something it was not designed for. Obviously, this is not proof that the format is dead. <acronym title="Scalable Vector Graphics">SVG</acronym> is alive and well.</p>

<p>Next time: <a href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_3d_graphics_clai.html">The 3D Graphics Claim</a></p>]]>
        
    </content>
</entry>
<entry>
    <title>Reports of SVG&apos;s death exaggerated</title>
    <link rel="alternate" type="text/html" href="http://anomaly.org/wade/blog/2008/11/reports_of_svgs_death_exaggera.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://anomaly.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=189" title="Reports of SVG's death exaggerated" />
    <id>tag:anomaly.org,2008:/wade/blog//1.189</id>
    
    <published>2008-11-22T05:55:00Z</published>
    <updated>2008-11-23T18:24:13Z</updated>
    
    <summary>A message appeared recently on the SVG Development mailing list that, once again, predicts the death of SVG. This meme comes up pretty regularly on the various mailing lists for SVG. Most of them are trolls, of course. But this...</summary>
    <author>
        <name>GWade</name>
        
    </author>
            <category term="SVG" />
    
    <content type="html" xml:lang="en" xml:base="http://anomaly.org/wade/blog/">
        <![CDATA[<p>A message appeared recently on the <acronym title="Scalable Vector Graphics">SVG</acronym> Development mailing list that, once again, predicts the death of <acronym title="Scalable Vector Graphics">SVG</acronym>. This meme comes up pretty regularly on the various mailing lists for SVG. Most of them are trolls, of course. But this one got me thinking again about what <acronym title="Scalable Vector Graphics">SVG</acronym> is and what it is not.</p>

<p>I thought it might be interesting to consider some of these claims and try, once again, to put them to rest. I'll cover each claim in a separate entry over the next few posts. To do that, we need a little background material.</p>

<h2 class="subhead">What is <acronym title="Scalable Vector Graphics">SVG</acronym></h2>

<p>Let's start off with the basics. <acronym title="Scalable Vector Graphics">SVG</acronym> stands for <em>Scalable Vector Graphics</em>. It is an open <acronym title="eXtensible Markup Language">XML</acronym>-based vector graphics format described by a <a href="http://www.w3.org/">World Wide Web Consortium</a> (<acronym title="World Wide Web Consortium">W3C</acronym>) <a href="http://www.w3.org/Graphics/SVG/">recommendation</a>. Unlike the formats you may be more familiar with (<acronym title="Joint Photographic Experts Group">JPEG</acronym>, <acronym title="Portable Network Graphics">PNG</acronym>, <acronym title="Graphics Interchange Format">GIF</acronym>, etc.), <acronym title="Scalable Vector Graphics">SVG</acronym> is not a grid of colored pixels or raster format. <acronym title="Scalable Vector Graphics">SVG</acronym> describes graphical objects through lines, curves, and manipulations of objects.</p>

<p>This gives a number of advantages. The first is part of the name: scalable. When you scale a normal raster format larger, the image gets worse (jaggies). When you scale a raster format smaller, you lose information. This isn't a bug, it is a property of all raster formats. Vector formats, on the other hand, are described by mathematical entities like lines and circles. You can scale them to any size without visual artifacts or loss of data.</p>

<p><acronym title="Scalable Vector Graphics">SVG</acronym> also supports three other features in addition to the scalability that is part of being a vector format. First, <acronym title="Scalable Vector Graphics">SVG</acronym> supports declarative animation based on the <acronym title="Synchronized Multimedia Integration Language">SMIL</acronym> <acronym title="World Wide Web Consortium">W3C</acronym> recommendation. Secondly, <acronym title="Scalable Vector Graphics">SVG</acronym> supports scripting through ECMAscript. These two features mean <acronym title="Scalable Vector Graphics">SVG</acronym> can be used for dynamic images as well as static images. Finally, <acronym title="Scalable Vector Graphics">SVG</acronym> supports declarative filter effects that can be used to create visually complex images.</p>

<h2 class="subhead">The Claims</h2>

<p>In the next few posts, I'll explore some of these claims.</p>

<ol>
  <li><a href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_widget_claim.html"><acronym title="Scalable Vector Graphics">SVG</acronym> Lives: the Widget Claim</a></li>
  <li><a href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_3d_graphics_clai.html"><acronym title="Scalable Vector Graphics">SVG</acronym> Lives: the 3D Graphics Claim</a></li>
  <li><a href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_videoaudio_claim.html"><acronym title="Scalable Vector Graphics">SVG</acronym> Lives: the Video/Audio Claim</a></li>
  <li><a href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_internet_explore.html"><acronym title="Scalable Vector Graphics">SVG</acronym> Lives: the Internet Explorer Claim</a></li>
</ol>

<p>Finally, I'll summarize the discussion: <a href="http://anomaly.org/wade/blog/2008/11/svg_lives_the_summary.html"><acronym title="Scalable Vector Graphics">SVG</acronym> Lives: the Summary</a></p>]]>
        
    </content>
</entry>

</feed> 

