<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

  <channel>
    <title>Software will save us</title>
    <link>http://www.netalive.org/swsu/</link>
    <description>Unqualified ramblings about technology and the sorry state of software development.</description>
    <dc:language>en-us</dc:language>
    <dc:creator>jaz@netalive.org</dc:creator>
    <dc:rights>Copyright 2008</dc:rights>
    <dc:date>2008-06-22T05:11:19+00:00</dc:date>
    <admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=3.2" />
    <admin:errorReportsTo rdf:resource="mailto:jaz@netalive.org"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>

    <item>
      <title>Setter methods make kittens cry</title>
      <link>http://www.netalive.org/swsu/archives/2008/06/setter_methods_make_kittens_cry_1.html</link>
      <description>Do use setters if being edited is the central purpose of that class. Do not use setter methods to create an object. Setter methods intended for creation will still be accessible during the whole lifetime of the object. Someone might...</description>
      <guid isPermaLink="false">138@http://www.netalive.org/swsu/</guid>
      <content:encoded><![CDATA[<p>Do use setters if being edited is the central purpose of that class. Do <b>not</b> use setter methods to create an object. Setter methods intended for creation will still be accessible during the whole lifetime of the object. Someone might use them and break <em>all your stuff</em>. Basically everything involving caches or <a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#hashCode()">hashCode()</a> will die in your arms. Like when changing an attribute will cause some remote piece of code have maps with broken mappings and suddenly sport sets with duplicate elements. Being paranoid makes for good code karma.</p>

<p>Furthermore, do not use setters to wire up required attributes. I often see code like this:</p>

<pre><code>Foo foo = new Foo();
foo.setAttribute1(a1);
foo.setAttribute2(a2);
foo.setAttribute3(a3);</code></pre>

<p>This is bad because until the last line has executed, <code>foo</code> lives in some sort of twilight zone, where it exists but may not be used yet. Your class should not allow to create an object with invalid state. Better use the constructor to wire up attributes:</p>

<pre><code>Foo foo = new Foo(a1, a2, a3);</code></pre>

<p>Some people will argue that this will become hard to read if you have a lot of attributes. In such cases you should use a <del>Builder</del> separate factory class that collects all attributes with setters and can create the object once all required attributes are present (otherwise throw an exception). This shifts the enforcement of valid object creation from compile time to runtime, but still <a href="http://c2.com/cgi/wiki?FailFast">fails fast</a> if necessary.</p>

<p>A related point I would like to make is that immutable objects (objects that cannot change their state after instantiation) also make for good code karma. Mutable objects can be a pain to work with and force their clients to make <a href="http://c2.com/cgi/wiki?DefensiveCopy">defensive copies</a>. Immutable objects are also thread-safe by default (you might <a href="http://www.jcip.net/">still</a> screw it up though).</p>
</li>
</ol>]]></content:encoded>
      <dc:subject></dc:subject>
      <dc:date>2008-06-22T05:11:19+00:00</dc:date>
    </item>
    <item>
      <title>You don&apos;t know Java: Method type parameters</title>
      <link>http://www.netalive.org/swsu/archives/2008/04/you_dont_know_java_method_type_parameters.html</link>
      <description>When someone tells you they know Java, smile and say &quot;no, you don&apos;t&quot;. Proceed to soften them up with questions about covariance and contravariance and how they relate to parametrized types. When they start crying, go in for the kill....</description>
      <guid isPermaLink="false">133@http://www.netalive.org/swsu/</guid>
      <content:encoded><![CDATA[<p>When someone tells you they know Java, smile and say "no, you don't". Proceed to soften them up with questions about <a href="http://www.ibm.com/developerworks/java/library/j-jtp01255.html">covariance and contravariance</a> and how they relate to parametrized types. When they start crying, <a href="http://madbean.com/2004/mb2004-3/">go in for the kill</a>.</p>

<p>But let's talk about something nice today: Method type parameters. Few people know that type parameters in Java are not limited to types, but that <em>every method and constructor can declare their own type parameters</em>. And if this alone wasn't cool enough, <em>it can actually be useful!</em></p>

<p>To illustrate, I need a couple of interfaces from Java kindergarden:</p>

<pre><code>interface CanWalk {
    void walk(int steps);
}

interface CanSwim {
    void swim(int strokes);
}

interface CanSleep {
    void sleep(int minutes);
    boolean isSleeping();
}

interface Animal implements CanSleep { }

interface Cat implements Animal, CanWalk { }

interface Dog implements Animal, CanWalk, CanSwim { }</code></pre>

<p>Say we want to write a method that simply takes an <code>Animal</code> and returns it. This is the way we used to roll:</p>

<pre><code>Animal returnMe(Animal animal) {
    return animal;
}</code></pre>

<p>What's bad about this method is, that it returns its value as <code>Animal</code>, even if we gave it a <code>Cat</code>. So if we wanted our cat back, we need to cast it manually:</p>

<pre><code>Cat cat = (Cat)returnMe(new Cat());</code></pre>

<p>We can improve on this by binding a type variable to the <code>returnMe</code> method like this:</p>

<pre><code>&lt;A extends Animal&gt; A returnMe(A a) {
    return a;
}</code></pre>

<p>This way we don't need the cast:</p>

<pre><code>Cat cat = returnMe(new Cat());</code></pre>

<p>To give an actually useful example, let's write a method <code>getAwake</code> that is given a list of objects implementing <code>CanSleep</code>, and returns those objects that return <code>false</code> from <code>isSleeping()</code>:</p>

<pre><code>&lt;A extends CanSleep&gt; List&lt;A&gt; getAwake(List&lt;A&gt; potentialSleepers) {
    return Lists.select(potentialSleepers, new Filter&lt;A&gt;() {
        public boolean passes(A element) {
            return !element.isSleeping();
        }
    });
}</code></pre>

<p>... with <code>Lists.select</code> working like <a href="http://www.ruby-doc.org/core/classes/Enumerable.html#M003156"><code>select</code> in Ruby lists</a>, but you cool kids already figured that out by yourself. Again we can give <code>getAwake</code> a list of cats, and get a list of cats back, rather than a list of animals. You can see how method type parameters allow us to be more expressive about our method signatures.</p>

<p>This might be stretching the attention span of the YouTube generation, but here's one more cool thing: Method type parameters with composite upper bounds:</p>

<pre><code>&lt;Duckish extends CanWalk & CanSwim & CanSleep&gt; void rockTheBeach(Duckish duckish) {
    duckish.walk(100); // check out the chicks
    duckish.swim(20);  // cool down in the water
    duckish.sleep(60); // take a nap
}</code></pre>

<p>This is about as much fun as you'll ever be able to have writing Java. Enjoy!</p>]]></content:encoded>
      <dc:subject></dc:subject>
      <dc:date>2008-04-12T15:01:14+00:00</dc:date>
    </item>
    <item>
      <title>Names are important</title>
      <link>http://www.netalive.org/swsu/archives/2007/03/names_are_important_1.html</link>
      <description>For a profession that is all about naming things, most programmers are being terribly careless with names. Although you get away with it most of the time, you look so immensely stupid when two pieces of code disagree over the...</description>
      <guid isPermaLink="false">130@http://www.netalive.org/swsu/</guid>
      <content:encoded><![CDATA[<p>For a profession that is all about naming things, most programmers are being terribly careless with names. Although you get away with it most of the time, you look so immensely stupid when two pieces of code disagree over the meaning of a name. Names are important.</p>

<p>One of the things I still love about Perl is that, by convention, it is considered rude to invade other people's namespace. So we put all our public methods and constants into the <code>@EXPORT_OK</code> array and let the client decide which part of that he wants to use in their code. I should be able to do the same with <a href="http://www.netalive.org/swsu/archives/2007/03/whoops_open_classes_not_cool_after_all.html">code extending existing classes</a>: Let me decide which extensions I want patched in on a per-class basis. I believe <a href="http://blogs.msdn.com/howard_dierking/archive/2007/02/09/more-c-3-0-extension-methods.aspx">extension methods in C# 3.0</a> work this way. Do copy this.</p>

<p>Another name issue few languages get right are namespaces. Namespaces are important, because sooner or later you will have two different <code>Node</code> classes in your project and you need to tell your code which one to use. Let's look how some popular languages are dealing with this:</p>

<dl>

<dt>PHP</dt>
<dd>
<p>Bashing PHP is a bit like beating up an old man, but here we go anyway: PHP has no notion of namespaces at all. To work around this, people are using <code>Really_Long_Classnames_With_Packagish_Names_Prefixed</code> to lessen the chance of namespace clashes. LOL.
</p>
</dd>

<dt>Java</dt>
<dd>
<p>
Has a wonderful culture of putting classes in packages named after some domain you own. So my <code>Node</code> class would be packaged as <code>org.netalive.swsu.Node</code> and people could <code>import</code> this name and just write <code>Node</code>. Bad: When you need to use two different <code>Node</code> classes in the same piece of code. As you can only import one <code>Node</code> without name clashes your code will look like <code>Map&lt;Node,&nbsp;incredibly.long.package.name.of.other.Node&gt;</code>. Horrible when it happens, and it happens frequently. For instance, both <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/awt/List.html">the most basic GUI widget in Swing</a> and <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html">the most basic data structure in Java</a> are called <code>List</code>.
</p>
</dd>

<dt>Perl and Ruby</dt>
<dd>
<p>
Uses <code>Package::Subpackage::Classname</code> syntax for improved looks, but since you cannot import or alias these long names, this is more about organizing files and not <em>really</em> better than PHP's <code>Package_Subpackage_Classname</code> workaround. At least you can switch into a namespace and add and replace methods without using fully qualified names. It's kind of OK for untyped languages because you only need to reference types when calling a constructor or another static method. Still the possibility of another <code>Tree::Node</code> class in a second library is always there and sometimes urges you to use more unique package names than you would like.
</p>
</dd>

<dt>Python</dt>
<dd>
<p>
I don't speak Python, but from what I've seen this is a language that got namespaces right. You can import a namespace as in Java, you can selectively import symbols as in Perl, and here's the goodness: You can <code>import reallylongmodulename as shortcut</code> to alias <code>reallylongmodulename</code> into <code>shortcut</code>. Nice.
</p>
</dd>

</dl>

<p>
I think what Python does (importing and importing into aliases) should be the minimum requirement for any language that wants to take names seriously. The package naming convention from Java is cool, because the DNS is the only naming scheme humanity ever reached something like an agreement over, and unique names are good. Imagine blowing up the planet because some piece of code felt ambivalent about the semantics of <code>System.Nuke</code>. We would look all kinds of stupid if this sort of thing ever happened.</p>]]></content:encoded>
      <dc:subject></dc:subject>
      <dc:date>2007-03-21T09:16:12+00:00</dc:date>
    </item>
    <item>
      <title>Whoops! Open classes not cool after all!</title>
      <link>http://www.netalive.org/swsu/archives/2007/03/whoops_open_classes_not_cool_after_all.html</link>
      <description>Ruby, Perl and many other languages let you reopen an existing class or namespace and add additional methods to it, or replace existing methods with new code. Everyone thinks that is &quot;like super-cool&quot; and &quot;really feels the spirit of getting...</description>
      <guid isPermaLink="false">129@http://www.netalive.org/swsu/</guid>
      <content:encoded><![CDATA[<p>Ruby, Perl and many other languages let you reopen an existing class or namespace and add additional methods to it, or replace existing methods with new code. Everyone thinks that is "like super-cool" and "really feels the spirit of getting things done", probably accompanied by some generic "LOL Java, agile languages FTW!" rant.</p>

<p>Surprisingly, open classes have one serious problem: <strong>People are using them!</strong></p>

<p>Right now the two most popular uses for reopening classes are (1) adding methods to core classes like objects or lists and (2) patching totally not public code with your own funky version. Both are terrifyingly bad ideas which will probably break with the next update of the code you're patching, or as soon as another clever library attempts to do the same. But let's enjoy some examples together:</p>

<ol>

<li><p>It is impossible to use <a href="http://www.prototypejs.org/">prototype.js</a> and <a href="http://www.json.org/js.html">json.js</a> at the same time <a href="http://www.stevekallestad.com/blog/making_prototype_compatible_with_jsonjs.html">because prototype.js does something nasty to Object.prototype</a>. But never mind since these are only the two most commonly Javascript libraries <em>on the planet</em>.</p></li>

<li><p>What Rails is doing to the Ruby core, and what some plugins are doing to Rails, is downright scary in some places. Thankfully Rails is heavily maintained and bugs are patched quickly.</p></li>

<li><p>While developing a <a href="http://video.google.com/url?docid=5767167495196384205&esrc=sr1&ev=v&q=even+stupider+mage+tricks&vidurl=http://video.google.com/videoplay%3Fdocid%3D5767167495196384205%26q%3Deven%2Bstupider%2Bmage%2Btricks&usg=AL29H21LwzPr-zwgTwCv2eTdEBxTV10XQA">World of Warcraft</a> addon in <a href="http://www.lua.org/">Lua</a>, we discovered that the preferred way to intercept chat messages was to replace the existing message handler, intercept the messages you need and hand over the rest to a copy of the old handler. Unfortunately, since our addon name was lexically smaller than the name of another addon that used the same trick, and World of Warcraft loads addons in alphabetical order, our new message handler was replaced by a third addon handler by that other, lesser addon and everything went to hell.</p></li>
</ol>

<p>I'm not even sure if the last example is valid in this context, but it's also about bad scope and globals, and I really needed to stress the fact that I'm writing kick-ass World of Warcraft addons <em>this very minute</em>.</p>

<p>Anyway, don't you think it's funny how twenty years after people realized that "<a href="http://www.php.net/">globals</a> are teh suck" we're falling into the same bad habits all over again? Yes, open classes are fun toys to play with, but you can also fuck up royally if you don't pay attention. So, please, <em>do</em> think about what happens when other libraries attempt to pull the same hackery as you. <em>Do</em> consider the chance that a second library <em>also</em> wants to decorate the <code>draw</code> method, and <em>do</em> assume it will <em>also</em> save the existing method using <code>alias :original_draw :draw</code>. And <strong>OH MY GOD</strong> do <em>not</em> patch up <em>private</em> methods that have clearly not been cleared for public consumption by the original author!</p>

<p>Patching private methods. I mean, what the hell. Think of the children!</p>]]></content:encoded>
      <dc:subject></dc:subject>
      <dc:date>2007-03-20T15:03:00+00:00</dc:date>
    </item>
    <item>
      <title>Gapless MP3 loops in Flash</title>
      <link>http://www.netalive.org/swsu/archives/2007/01/gapless_mp3_loops_in_flash_1.html</link>
      <description>When encoding a sound loop as MP3, the encoder will add ugly gaps of silence at the beginning and end of your track, making the resulting file not very loopable at all. This is due to the way MP3 encoding...</description>
      <guid isPermaLink="false">128@http://www.netalive.org/swsu/</guid>
      <content:encoded><![CDATA[<p>When encoding a sound loop as MP3, the encoder will add ugly gaps of silence at the beginning and end of your track, making the resulting file not very loopable at all. This is due to the way MP3 encoding works.</p>

<p>Although there are some <a href="http://www.compuphase.com/mp3/mp3loops.htm">instructions</a> (scroll down to "Part 2") how to remove those gaps from your sound file, the amount of hackery involved is not for the faint of heart. The same guy also wrote <a href="http://www.compuphase.com/mp3/mp3loop.zip">a tool to automate the process</a> but it's restricted to a maximum of 8 seconds of sound, and you can totally not buy a full version.</p>

<p>You're lucky if you're working in Flash however. The MP3 encoder inside the Flash IDE knows about the problem and will make sure any MP3 it compresses will loop without gaps. So:</p>

<ol>
<li>Have an uncompressed sound loop as WAV oder AIFF. If your loop is already an MP3, remove the silent padding at the beginning and end of the track and save it as WAV.</li>
<li>Import the uncompressed sound into the library of your clip.</li>
<li>In the sound properties, set the desired MP3 compression.</li>
<li>Loop away.</ol>
</ol>]]></content:encoded>
      <dc:subject></dc:subject>
      <dc:date>2007-01-16T13:43:28+00:00</dc:date>
    </item>
    <item>
      <title>You don&apos;t know jack about thread-safety</title>
      <link>http://www.netalive.org/swsu/archives/2006/12/you_dont_know_jack_about_threadsafety_1.html</link>
      <description>All you hotshot programmers need to drop what you&apos;re doing and secure a copy of Java Concurrency in Practice. 50 pages into the book my face was frozen in pure horror, as Brian Goetz and his friends happily ran over...</description>
      <guid isPermaLink="false">126@http://www.netalive.org/swsu/</guid>
      <content:encoded><![CDATA[<p>All you hotshot programmers need to drop what you're doing and secure a copy of <a href="http://jcip.net/">Java Concurrency in Practice</a>. 50 pages into the book my face was frozen in pure horror, as Brian Goetz and his friends happily ran over everything I ever thought I knew about thread-safe programming.</p>

<p>What do you think the following code will print to the console?</p>

<pre><code>public class NoVisibility {

    private static boolean ready;
    private static int number;

    private static class ReaderThread extends Thread {
        public void run() {
            while (!ready) Thread.yield();
            System.out.println(number);
        }
    }

    public static void main(String[] args) {
        new ReaderThread().start();
        number = 42;
        ready = true;
    }
}</code></pre>

<p>Unless your answer is <cite>"either zero, 42 or nothing at all"</cite> you really need to read <a href="http://jcip.net/">the book</a> before someone notices.</p>]]></content:encoded>
      <dc:subject></dc:subject>
      <dc:date>2006-12-24T15:27:56+00:00</dc:date>
    </item>
    <item>
      <title>There&apos;s nothing wrong with bloggers</title>
      <link>http://www.netalive.org/swsu/archives/2006/12/theres_nothing_wrong_with_bloggers.html</link>
      <description><![CDATA[&lt;tom&gt; there's nothing wrong with bloggers &lt;tom&gt; it's just that like &lt;tom&gt; when they're ALL in ONE ROOM, all SWEATING, all POSTING, &lt;tom&gt; all EDITING ONE DOCUMENT COLLABORATIVELY WITH SUBETHAEDIT, &lt;tom&gt; it gets a bit much &lt;liz&gt; do non-bloggers not...]]></description>
      <guid isPermaLink="false">125@http://www.netalive.org/swsu/</guid>
      <content:encoded><![CDATA[<pre>&lt;tom&gt; there's nothing wrong with bloggers
&lt;tom&gt; it's just that like
&lt;tom&gt; when they're ALL in ONE ROOM, all SWEATING, all POSTING, 
&lt;tom&gt; all EDITING ONE DOCUMENT COLLABORATIVELY WITH SUBETHAEDIT, 
&lt;tom&gt; it gets a bit much
&lt;liz&gt; do non-bloggers not sweat then?
&lt;tom&gt; they do, but their sweat doesn't have an rss feed</pre>]]></content:encoded>
      <dc:subject></dc:subject>
      <dc:date>2006-12-08T00:35:12+00:00</dc:date>
    </item>
    <item>
      <title>Why you should stop blogging</title>
      <link>http://www.netalive.org/swsu/archives/2006/07/why_you_should_stop_blogging.html</link>
      <description>Look kids, I really believe this blogging thing has gone out of hand, so here are some things I need to get off my chest before anyone gets hurt. First off, you really don&apos;t have to apologize for not having...</description>
      <guid isPermaLink="false">124@http://www.netalive.org/swsu/</guid>
      <content:encoded><![CDATA[<p>Look kids, I really believe this blogging thing has gone out of hand, so here are some things I need to get off my chest before anyone gets hurt.</p>

<p>First off, you really don't have to apologize for not having updated your weblog in a while. I'll just assume you had something better to do. Also your guides on overcoming writer's block and getting your daily blogging rythm going make me cry. It's not a freaking competition, mmkay? The whole beauty of this syndication thing is that I will still hear you after three years of blogging absence. I actually prefer reading occasional burts of goodness over the stream of consciousness shit that is clogging up the internet.</p>

<p>Second, if you ever forego a night with your friends in order to be able to update your weblog and I <em>catch</em> you, it's not going to be a pretty sight. Understand that our time on this planet is very limited and there are only so many bars you can hit before nature collects its toll. You must choose how to spend the time that is given you, and if the majority of it is spent blogging, you really need to reconsider that choice.</p>

<p>Also your weblog is probably not going to get you laid, ever. That implies that you should not see blogging as a popularity contest. You probably don't want to be among the "A-List" bloggers and if you ever find yourself aspiring that goal, please see the previous paragraph about bars and friends. Enjoy what weblogs have to offer, but don't use weblogs as your sole source of knowledge and self-affirmation. Always remember that the "blogosphere" is an echo chamber that can give you a very distorted image of reality if consumed without enough perspective. The vast majority of the online world does not read or write weblogs, and in no way are we smarter or hipper or more interesting or better informed than they are.</p>

<p>The most important people in your life will probably not have a weblog. They also won't turn up on a Google search.</p>

<p>Finally, stay away from World of Warcraft. That is all.</p>]]></content:encoded>
      <dc:subject></dc:subject>
      <dc:date>2006-07-30T22:23:38+00:00</dc:date>
    </item>
    <item>
      <title>My homework could totally beat up your homework</title>
      <link>http://www.netalive.org/swsu/archives/2006/06/my_homework_could_totally_beat_up_your_homework.html</link>
      <description>How&apos;s that for a university project: We&apos;re currently writing the AI code for a heavily pimped Lego Mindstorms robot, which has to collect &quot;flags&quot; in a labyrinth and shoot down the Lego bots of the other, lesser teams. Best project...</description>
      <guid isPermaLink="false">122@http://www.netalive.org/swsu/</guid>
      <content:encoded><![CDATA[<p>How's that for a university project: We're currently writing the AI code for a heavily pimped <a href="http://mindstorms.lego.com/eng/default.aspx">Lego Mindstorms</a> robot, which has to collect "flags" in a labyrinth and shoot down the Lego bots of the other, lesser teams.</p>

<p>Best project <em>ever</em>.</p>]]></content:encoded>
      <dc:subject></dc:subject>
      <dc:date>2006-06-29T13:30:03+00:00</dc:date>
    </item>
    <item>
      <title>Attention kids! Aggregation no longer cool</title>
      <link>http://www.netalive.org/swsu/archives/2006/03/attention_kids_aggregation_no_longer_cool.html</link>
      <description>The last groovy thing anyone did with aggregation was in 2003 when Mark Pilgrim started Atom to piss off Dave Winer. That&apos;s three years of interweb time, so could everyone please stop talking about the subject. No one cares anymore....</description>
      <guid isPermaLink="false">121@http://www.netalive.org/swsu/</guid>
      <content:encoded><![CDATA[<p>The last groovy thing anyone did with aggregation was in 2003 when Mark Pilgrim started Atom to piss off Dave Winer. That's three years of interweb time, so could everyone please stop talking about the subject. No one cares anymore. Thank you.</p>]]></content:encoded>
      <dc:subject></dc:subject>
      <dc:date>2006-03-02T19:11:50+00:00</dc:date>
    </item>
    <item>
      <title>In defense of the nearly tautologic diagram</title>
      <link>http://www.netalive.org/swsu/archives/2005/10/in_defense_of_the_nearly_tautologic_diagram_1.html</link>
      <description>Aristotle Pagaltzis rallies against pattern hype in general, and Martin Fowler&apos;s dependency injection article in particular: Where was the meat? I read and reread the definition, examined the flimsy code snippets carefully, stared at the nearly tautologic diagrams for roughly...</description>
      <guid isPermaLink="false">120@http://www.netalive.org/swsu/</guid>
      <content:encoded><![CDATA[<p><a href="http://plasmasturm.org/log/338/">Aristotle Pagaltzis rallies against pattern hype</a> in general, and <a href="http://martinfowler.com/articles/injection.html">Martin Fowler's dependency injection article</a> in particular:</p>

<blockquote>
<p>Where was the meat? I read and reread the definition, examined the flimsy code snippets carefully, stared at the nearly tautologic diagrams for roughly 10 minutes, trying to grasp the deeply profound idea but failing.</p>
</blockquote>

<p>Aside from having snorted coke through my nose over <citre>"nearly tautologic diagrams"</cite> I feel the need to defend <a href="http://martinfowler.com/articles/injection.html">Martin Fowler's article</a> because it had such a profound effect on me when it was published. Although I had been playing with "objects" and "classes" before, this article finally made me understand what OOP was all about. This is not true for many other articles and yes, I'm looking at you, shitty <code>Car extends Vehicle</code> OOP tutorial.</p>

<p> Aristotle is right when he says that the concept of dependency injection should be so ubiquitously understood that it shouldn't get its own brand name. But at the same time it represents the very essence of object-orientation <em>and most people are not using it</em>. How many times have you hacked around a library because it won't let you inject behavior? Once you've swallowed the pill, the world's ignorance of dependency injection is almost too much to bear.</p> 

<p>I also think the more important of Fowler's postulations is not to understand dependency injection, but to use it with a persistence that borders on the religious. Consequently employing DI everywhere is actually a new methodology. Anyone who ever tried dependency injection as their default way of doing business knows that it is plain impossible with vanilla language constructs. Without assistance from a DI container you're just going to die the death of the million parameter constructor.</p>]]></content:encoded>
      <dc:subject></dc:subject>
      <dc:date>2005-10-13T12:10:13+00:00</dc:date>
    </item>
    <item>
      <title>That time of the year, again</title>
      <link>http://www.netalive.org/swsu/archives/2005/10/that_time_of_the_year_again.html</link>
      <description> Apple announces a new piece of white hardware. Millions of Apple fanboy bloggers immediately claim bragging rights to having accurately predicted that the new gadget would, indeed, be white. Meanwhile, my number one newsreader request remains an unfulfilled dream....</description>
      <guid isPermaLink="false">119@http://www.netalive.org/swsu/</guid>
      <content:encoded><![CDATA[<p>
	Apple announces a new piece of white hardware. Millions of Apple fanboy bloggers immediately claim bragging rights to having accurately predicted that the new gadget would, indeed, be white.
</p>
<p>
	Meanwhile, my <a href="http://www.netalive.org/swsu/archives/2005/08/my_number_one_n.html">number one newsreader request</a> remains an unfulfilled dream.
</p>]]></content:encoded>
      <dc:subject></dc:subject>
      <dc:date>2005-10-13T01:49:17+00:00</dc:date>
    </item>
    <item>
      <title>Help me pick a software license!</title>
      <link>http://www.netalive.org/swsu/archives/2005/10/help_me_pick_a_software_license.html</link>
      <description>I have this one application for which I&apos;d like to find a suiting license and could use your help picking one. Because I don&apos;t know the first thing about licensing, here are some general questions first: Pretty much all software...</description>
      <guid isPermaLink="false">118@http://www.netalive.org/swsu/</guid>
      <content:encoded><![CDATA[<p>I have this one application for which I'd like to find a suiting license and could use your help picking one. Because I don't know the first thing about licensing, here are some general questions first:</p>

<ul>
<li>Pretty much all software licenses have the user waive any claims in case the software eats their data or blows up their machine. When the shit hits the fan, does the inclusion or absence of this clause really matter?</li>
<li>My application is installed by downloading and unzipping an archive and thus has no installation screen. Where do I need to put the license? Mention it above the download links? Display it on the about-screen? Just include it to the documentation? Or must I require my users to click an "Agree" button somewhere?</li>
<li>If I just expressed my intents in simple words, like "Don't sue me. Don't use for commercial purposes. Yo." What's the downside to that?</li>
</ul>

<p>About the actual application for which I need a license:</p>

<ul>
<li>The core part of the application will remain closed-source for now, but ships with a large number of public API classes for plugin development (these classes also ship in compiled form). I'd like to allow any non-commercial use of the application and the API classes. Which license would do that? I used to think <a href="http://creativecommons.org/">Creative Commons</a>, but <a href="http://creativecommons.org/faq#Can_I_use_a_Creative_Commons_license_for_software?">Creative Commons licenses are not intended to apply to software</a>.</li>
<li>The application also ships with a large number of plugins, including the sources of the plugin classes. Again I'd like to allow use for any non-commercial purpose. Do I need to treat the sources different from the binary part of the application?</li>
</ul>

<p>Any comment that detracts from my state of total cluelessness will be greatly appreciated!</p>]]></content:encoded>
      <dc:subject></dc:subject>
      <dc:date>2005-10-06T23:31:31+00:00</dc:date>
    </item>
    <item>
      <title>Upcoming C# goodness</title>
      <link>http://www.netalive.org/swsu/archives/2005/09/upcoming_c_good.html</link>
      <description>After Java 5 was released some people speculated it would take Javaland years to digest the new language features. Quite clearly this worry isn&apos;t shared by the C# development team. We already heard that C# 2.0 will have closures. This...</description>
      <guid isPermaLink="false">117@http://www.netalive.org/swsu/</guid>
      <content:encoded><![CDATA[<p>After Java 5 was released some people <a href="http://www.artima.com/forums/flat.jsp?forum=106&thread=117200">speculated</a> it would take Javaland years to digest the new language features. Quite clearly this worry isn't shared by the C# development team. We already heard that <a href="http://joe.truemesh.com/blog/000390.html">C# 2.0 will have closures</a>. This week the C# 3.0 specification surfaced (<a href="http://tinyurl.com/baoh8">Word document</a> only) and it's full of syntactic goodness:</p>

<ul>
<li>Open classes! Extend any existing class with additional methods!</li>
<li>Lambda expressions (OMG!)</li>
<li>Construct objects with named parameters!</li>
<li>Query collections with SQL-ish closure thingies!</li>
</ul>

<p>Want!</p>]]></content:encoded>
      <dc:subject></dc:subject>
      <dc:date>2005-09-16T00:17:11+00:00</dc:date>
    </item>
    <item>
      <title>Accessibility Bullshit</title>
      <link>http://www.netalive.org/swsu/archives/2005/09/accessibility_b.html</link>
      <description><![CDATA[If ranting about web development required a licence, Christian Heilmann's 10 Reasons Clients Don't Care About Accessibility should be taken and slapped into the faces of all applicants. When I try to sell The Right Thing&trade; to a client in...]]></description>
      <guid isPermaLink="false">116@http://www.netalive.org/swsu/</guid>
      <content:encoded><![CDATA[<p>If ranting about web development required a licence, <a href="http://www.wait-till-i.com/">Christian Heilmann</a>'s <a href="http://www.digital-web.com/articles/ten_reasons_clients_dont_care_about_accessibility">10 Reasons Clients Don't Care About Accessibility</a> should be taken and <em>slapped</em> into the faces of all applicants.</p>

<p>When I try to sell <cite>The Right Thing&trade;</cite> to a client in need of a website, the feeling of fighting the uphill battle is so overwhelming it's not funny. Whenever some not particularely web-savvy business owner thinks of his dream website, he thinks Flash, <strong>PERIOD</strong>. Of course there are a million reasons why your client is better off without Flash, but <strong>all</strong> of them pale compared to the <a href="http://www.digital-web.com/articles/ten_reasons_clients_dont_care_about_accessibility">450KB rotating logo splash page</a>.</p>

<p>This is the point where it gets nasty: Because "better user experience" makes for such a fuzzy and unsexy argument, we start throwing more easily digestable bullshit in order to sell <cite>The Right Thing&trade;</cite>. Here are some of my favourites:</p>

<dl>
	<dt>Bullshit: Clean markup looks good on mobile devices</dt>
	
	<dd>
		<p>I just finished a new site with clean, beautiful and semantic markup.
		It looks like shit on my very popular Nokia phone.</p>

		<p>The vision was that there is a style sheet for computer screens, and handhelds could 
		show unstyled HTML and optimally use styles for <code>media="handheld"</code>.
		This would be a terrific idea if a single hardware manufacturer went along with it. 
		What browsers on PDAs and cellphone do instead is interpret the CSS intended for
		<code>media="screen"</code>, which is lingo for "looks like crap on 128&times;128 pixels".
		</p>
	</dd>
	
	<dt>Bullshit: Google loves semantic markup</dt>
	
	<dd>
		<p>Is that so? I doubt you could even test that. From Google's point of view it doesn't make a lot of sense to trust the importance of <code>&lt;h1&gt;</code>, given half their index is search engine spam. I'd rather say Google loves <em>text</em>. It looks if, where and how often a word appears on a page, but probably doesn't give a flying fuck if it's marked up with <code>&lt;font size="+9" color="#f31242"&gt;</code>, buried in ten nested tables or anything else.
		</p>
		<p>By the way: Search engine spam totally works. Even if semantic markup got you a tiny bit of Google juice, paying $100 to a search engine <del>optimizer</del> spammer buys you ten times that. Sucks to hear, but that's how it is.</p>
	</dd>

	<dt>Bullshit: Accessibility = Usability = Semantic markup = Validation</dt>
	
	<dd>
		<p>Mark Pilgrim <a href="http://diveintomark.org/archives/2003/08/29/semantics">said it</a> so well:</p>
	
		<blockquote>
			<p>Anyone who tells you that validation buys you semantics is selling you snake oil. You can have an entire page full of DIV and SPAN tags and be perfectly valid, and it may look perfectly good to the human eye, but it doesn't mean anything, and any tool that relies on semantic markup won't be able to make heads or tails of it.
			</p>

			<p>Anyone who tells you that CSS guarantees you accessibility is selling you snake oil. Most accessibility techniques have nothing to do with CSS (...). And where accessibility and CSS do overlap, it's still easy to screw up if you don't know what you're doing, or simply go through a lot of pain for no real-world gain.</p>
		</blockquote>
	</dd>

	
	<dt>Bullshit: Tutorials can teach you accessibility</dt>
	
	<dd>
		<p>
			Earlier this year I wrote about the <a href="http://www.netalive.org/swsu/archives/2005/02/how_much_do_you.html">cargo cult that is web accessibility</a>. Basically every web designer on the planet thinks they can offer accessible sites because they read a tutorial and dig semantic markup (see above), but few have profound knowledge of the matter, not to mention <em>having worked with disabled people</em>.
		</p>
		<p>
			So after you read <cite>"Accessible websites in five minutes"</cite> and added <cite>Accessible web design</cite> to your resum&eacute;, head over to <a href="http://www.stcsig.org/usability/newsletter/0304-observing.html">Observing Users Who Listen to Web Sites</a> and cry:
		</p>

		<blockquote>
			<p>
				Some ranted to us about the problem of having to listen to the same "stuff" on each page. Some jumped to the bottom and scanned the pages backwards to avoid the navigation at the top. <strong>But only half knew what "Skip Navigation" means.</strong>
			</p>
			<p>
				Think about it. "Navigation" is web jargon. It's not common language. Some developers have used the phrase "Skip to Content" instead of "Skip Navigation." Good idea. But it does not work because "content" in English can be a noun or an adjective. JAWS reads it here as an adjective with the accent on the second syllable. So it does not make sense to users. 
			</p>
		</blockquote>
	<dd>
</dl>


<p>
	Bullshit aside, what does semanticesque markup and CSS really get you?
</p>

<ol>	
	<li>Consistent design without a CMS</li>
	<li>Easy design changes</li>
	<li>Pretty printing</li>
	<li>Very basic screen reader support</li>
</ol>

<p>That's it. I'm afraid these points alone won't always beat the <cite>450KB rotating logo splash page</cite> in the heads of my clients, but I can't continue to sling bullshit and still watch myself in the mirror every morning. I also wished the discussion would move away from <cite>"how to sell web standards"</cite> over to <cite>"how to make 'publishing lots of text' look sexy"</cite>, but I'll save that for another rant.
</p>]]></content:encoded>
      <dc:subject></dc:subject>
      <dc:date>2005-09-15T13:51:21+00:00</dc:date>
    </item>


  </channel>
</rss>
