<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>David Louis Edelman &#187; web programming</title>
	<atom:link href="http://www.davidlouisedelman.com/tag/web-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davidlouisedelman.com</link>
	<description>Science Fiction Novelist, Blogger, Web Programmer</description>
	<lastBuildDate>Thu, 07 Jul 2011 14:17:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Keeping Up with the Kludges</title>
		<link>http://www.davidlouisedelman.com/technology/kludges/</link>
		<comments>http://www.davidlouisedelman.com/technology/kludges/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 15:31:25 +0000</pubDate>
		<dc:creator>David Louis Edelman</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[backwards compatibility]]></category>
		<category><![CDATA[English language first movement]]></category>
		<category><![CDATA[kludges]]></category>
		<category><![CDATA[Looney Laws]]></category>
		<category><![CDATA[middleware]]></category>
		<category><![CDATA[standardization]]></category>
		<category><![CDATA[web programming]]></category>
		<category><![CDATA[WebTV]]></category>

		<guid isPermaLink="false">http://www.davidlouisedelman.com/?p=238</guid>
		<description><![CDATA[The world is shrinking. Products and laws and programs that were once created with tens of thousands of relatively homogeneous white people in Middle America are now being exported all around the world. How are we going to be able to keep up with all the kludges necessary to make things work?]]></description>
			<content:encoded><![CDATA[<p id="top" />There&#8217;s a very useful word in the techie sphere of influence that remains largely unknown in the wider world. It&#8217;s called <strong>kludge</strong>. According to Wikipedia, a kludge is <strong>&#8220;a clumsy or inelegant solution to a problem or difficulty.&#8221;</strong></p>
<p>Kludges usually come about in programming when you either don&#8217;t have the time or the budget to deal with a certain problem. A basic example: you build a website that works just fine in all the modern versions of Mozilla Firefox, Internet Explorer, Opera, Flock, Safari, Netscape, Konqueror, etc. And then you get a call from an account rep in a different department asking in a strident tone of voice why the website is causing sparks to fly out of his client&#8217;s ancient WebTV box.</p>
<p><img style="margin: 0px 0px 10px 10px; float: right" title="Jesus Christ, Webmaster" src="http://www.davidlouisedelman.com/wp-content/uploads/jesus-christ-webmaster.jpg" alt="Jesus Christ, Webmaster" width="244" height="313" />If Jesus Christ were your webmaster, he would clap his hands and come up with an elegant and elaborate piece of code that accounts for every browser on the market. This piece of programming legerdemain would not only deal with every WebTV and Mosaic 1.0 and Lynx browser still out there, but it would do so in a systematic way that would ensure compatibility with future unknown browsers and web services too. But you&#8217;re not Jesus Christ. Not only that, but you&#8217;ve got a million other pressing issues on your plate that are much more important than this.</p>
<p>On the other hand, this particular WebTV user happens to be the sister of the uncle of the CEO, and it&#8217;s worth spending ten or fifteen minutes to keep the CEO happy. So you grumble a little bit, fire up your text editor, and insert code that looks something like this:</p>
<blockquote><p><code>&lt;For all normal users...&gt;<br />
&lt;Do this.&gt;<br />
&lt;If the user is on a WebTV browser AND it's a Tuesday AND there's a full moon...&gt;<br />
&lt;Do that.&gt;<br />
&lt;Unless it's a Thursday and "Heroes" is still winning its timeslot, in which case...&gt;<br />
&lt;Do something else entirely.&gt;<br />
&lt;Now back to the normal code.&gt;<br />
</code></p></blockquote>
<p>Voila! You&#8217;ve created a kludge. It&#8217;s of no use to 99.9% of the world and it will slow down your application for everyone by some small fraction of a second &#8212; but on the other hand, it&#8217;s only taken you two minutes to write and the client&#8217;s happy.</p>
<p>Here&#8217;s a dirty little secret that the programmers don&#8217;t always tell you: <strong>all computer programs are full of kludges. </strong>Nobody ever intends to use them. Everyone&#8217;s application starts with the best of intentions and the cleanest of architectures. This is going to be the slickest widget ever! People will still be using it every day in 2035! Then life and the marketplace intervene, and the application wanders off track. You start to add kludges.</p>
<p>If Microsoft let you dig in to the source code for their operating systems, you&#8217;d see bazillions of kludges. Microsoft in particular is notorious for preserving backwards compatibility at all costs. Which means that in 20 years, when the only person left in the world using Lotus 1-2-3 is an old man with Alzheimer&#8217;s in Patagonia, the Windows Vista 20-Year Anniversary Edition (Now with Sherlock!) will still be able to run it.</p>
<p>But it&#8217;s not just computer programs that are full of kludges. <strong>Our lawbooks are full of kludges.</strong> I see from a page called <a href="http://www.totallyuselessknowledge.com/laws.php">Looney Laws</a> that, in Michigan, a woman&#8217;s hair legally belongs to her husband; in Newport, Rhode Island, it&#8217;s illegal to smoke a pipe after sunset; and in Logan County, Colorado, it&#8217;s illegal for a man to kiss a woman while asleep. (Whether the same holds true if a woman kisses a sleeping man, the page does not say. In fact, it would be nice if the page would cite some references somewhere, but I won&#8217;t hold my breath.)</p>
<p><span id="more-238"></span></p>
<p><img style="margin: 0px 10px 10px 0px; float: left" title="Braille ATM" src="http://www.davidlouisedelman.com/wp-content/uploads/braille-atm.jpg" alt="Braille ATM" width="300" height="190" />Every time you drive up to an ATM and wonder why the hell there&#8217;s Braille on the keypad, you&#8217;re experiencing a kludge of sorts. If you ever find yourself locked in the trunk of your car, you can thank the Patron Saint of Kludges for that lever that lets you open it from the inside. Whenever you tear open your kid&#8217;s LEGO set and find a 15-page booklet telling you that LEGO is not liable if your child chooses to set the blocks on fire and wedge them down his sister&#8217;s throat, you&#8217;re seeing the results of a kludge.</p>
<p>But here&#8217;s the problem: the world is shrinking.<strong> Products and laws and programs that were once created with tens of thousands of relatively homogeneous white people in Middle America are now being exported all around the world.</strong></p>
<p>It&#8217;s all well and good to translate your web application into Spanish and French. But are you going to translate it into Dutch, Farsi, Cantonese, Hawaiian, and Shoshone? What happens when you get an influx of web traffic from Pakistan? Are you going to rush out and create a kludge for every linguistic, cultural, geographic, religious, and political special circumstance out there? Of course not. You don&#8217;t have the time, and you don&#8217;t have the money.</p>
<p><strong>The problem with kludges is that they get progressively more expensive as they pile up.</strong> It seemed like a simple thing to write a few lines of code to deal with that one WebTV user. But when it comes time to redo the website, you&#8217;re going to see a big mess of kludges for these one-off circumstances. Some of them will conflict with one another. What happens when you&#8217;ve got a WebTV user who&#8217;s <em>also</em> a Spanish speaker <em>and</em> color blind? You need to make more contingencies. You have to test each of those contingencies. You have to hire experts, put together beta user groups, deal with all the exceptions that entails.</p>
<p>And make no mistake about it, <strong>kludges cost money</strong>. LEGO needs to hire lawyers to vet every word of that 15-page booklet, they need to hire desktop publishers to lay it out, and they need to pay printing costs to actually <em>make</em> the damn thing. Then there&#8217;s the extra penny or so it&#8217;s going to add to the shipping cost, and the extra hard drive they&#8217;re going to need in their office to store all four hundred customized versions of these legal booklets included with every different LEGO set.</p>
<p>Microsoft Windows is on close to a billion PCs, and you can bet that there are plenty of colorblind Spanish-speaking WebTV users whose children like to set things on fire and jam them down their sister&#8217;s throat. Their new Vista operating system has somewhere north of 50 million SLOC (source lines of code). That&#8217;s a lot of kludges to sort through.</p>
<p>This can&#8217;t keep going on. We&#8217;re going to have to find ways to deal with the kludge problem.</p>
<p>It&#8217;s pretty clear to me that <strong>pushing people towards standardization will only go so far.</strong> There&#8217;s a large &#8220;English-only&#8221; movement in the United States that&#8217;s trying to force governments to stop catering to speakers of other languages, Spanish in particular. But you can only force 28 million American Spanish speakers to do so much. Besides which, what happens when English is no longer the <em>lingua franca</em> of business throughout the world? All it takes is a couple of economic shifts, and your kids might be learning Hindi in school and desperately trying to sound like Delhi natives on the phone, instead of the other way around.</p>
<p>No, I think in the long run <strong>we&#8217;re going to have to start carrying our kludges with us.</strong></p>
<p>What does that mean in practical terms? It means that <strong>the burden of adapting to the world is going to shift from large corporations and governments to the individual.</strong> It means that rather than the content providers being responsible for translating text into <em>your</em> language, <em>you&#8217;re</em> going to take content from abroad and (Babel) fish the language <em>you</em> understand out of it.</p>
<p>Speaking futuristically, it means you&#8217;re going to need to find special glasses to compensate for your colorblindness. The city&#8217;s going to disclaim responsibility if you can&#8217;t tell the difference between the red light and the green one. So you&#8217;ll need a device that can continuously broadcast to the world around you that you&#8217;re colorblind. It&#8217;s probably not going to make the traffic light change colors, but it could certainly cause the ATM display to automatically switch to colorblind mode.</p>
<p>And along with that device, <strong>you&#8217;re going to be using a ton of middleware to constantly tweak the world to your hardware</strong> (whether that hardware be computer, phone, or neural implant). You&#8217;ll be translating content on the fly to fit your own time or place or idiom. It means you&#8217;ll be <a href="http://www.davidlouisedelman.com/technology/greasemonkeying-reality/">Greasemonkeying reality</a>.</p>
<p>Luckily, technology is on the side of the individual. As processing power skyrockets and processor size diminishes, it&#8217;ll become easier to carry your personal solutions with you. (Although with the growth in cheap wireless networking, you might not necessarily be <em>carrying</em> anything.)</p>
<p><strong>And this will be a good thing for everyone in the long run.</strong> Small businesses won&#8217;t have to worry so much about complying with crushing, confusing, and contradictory regulations. Software licensing agreements will shrink so that you don&#8217;t have to worry about clicking &#8220;Yes&#8221; to the fact that this software may be inappropriate for young children, despite the fact that you&#8217;re 85 and living in a retirement community. If you&#8217;re not allergic to peanuts, you won&#8217;t have to read a goddamn warning label about peanut allergies on every single product you buy.</p>
<p>And the sister of the uncle of the CEO will have to fend for herself. Imagine that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidlouisedelman.com/technology/kludges/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Joy of Strict XHTML</title>
		<link>http://www.davidlouisedelman.com/technology/joy-of-xhtml/</link>
		<comments>http://www.davidlouisedelman.com/technology/joy-of-xhtml/#comments</comments>
		<pubDate>Fri, 28 Apr 2006 02:55:17 +0000</pubDate>
		<dc:creator>David Louis Edelman</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[World Wide Web]]></category>
		<category><![CDATA[application/xhtml+xml]]></category>
		<category><![CDATA[DTDs]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[web browsers]]></category>
		<category><![CDATA[web programming]]></category>
		<category><![CDATA[web standards]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[XHTML Strict]]></category>

		<guid isPermaLink="false">http://www.davidlouisedelman.com/?p=106</guid>
		<description><![CDATA[I've recently discovered something else the Mozilla Firefox browser can do that Microsoft's Internet Explorer can't: Firefox can accept documents using the "application/xhtml+xml" header. This just might change the world.]]></description>
			<content:encoded><![CDATA[<p id="top" />I&#8217;ve recently discovered something else the Mozilla Firefox browser can do that Microsoft&#8217;s Internet Explorer can&#8217;t: <strong>Firefox can accept documents using the &#8220;application/xhtml+xml&#8221; header.</strong></p>
<p><em>Who gives a shit?</em> you might be thinking to yourself. Wait, I&#8217;ll explain. This might actually change your life someday.</p>
<p>For years, people have been writing web pages using the dated and somewhat arbitrary HTML 4 specification. If you don&#8217;t know what HTML looks like, take a look at the source code on any web page (by going to the &#8220;View&#8221; menu and selecting &#8220;Page Source&#8221; in Firefox or &#8220;View Source&#8221; in IE).</p>
<p>The problem is that during the web browser wars of the &#8217;90s, <strong>Microsoft and Netscape both decided that they wanted their browsers to be as inclusive as possible.</strong> You could be a sloppy or an amateur coder, make all kinds of errors in your HTML, and the browser would silently compensate for you. For instance, the proper way to create a bulleted list is by using this code:</p>
<p>&lt;ul&gt;<br />
&lt;li&gt;apples&lt;/li&gt;<br />
&lt;li&gt;oranges&lt;/li&gt;<br />
&lt;li&gt;bananas&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p>But you could just as easily get away with typing this instead:</p>
<p>&lt;UL&gt;<br />
&lt;Li&gt;apples<br />
&lt;li&gt;oranges&lt;lI&gt;<br />
&lt;li&gt;bananas<br />
&lt;/ul&gt;&lt;/Ul&gt;</p>
<p><span id="more-106"></span></p>
<p><strong>Now this sort of expansiveness worked really well when the Web was new and getting people to buy the entire concept was the name of the game.</strong> You didn&#8217;t need to be a programming geek to get your chicken tortilla soup recipe before the masses; all you needed was a half-hour tutorial in HTML and you were on your way.</p>
<p>But we&#8217;ve entered a new phase in the development of the Internet. <strong>Web 2.0 has arrived,</strong> to use the popular catchphrase. And though you&#8217;ll hear a lot about how social networking and sharing apps are what Web 2.0 is all about, the truth is that <strong>Web 2.0 is about machines talking to machines</strong>. I write this blog entry in WordPress blogging software, which talks to the MySQL database holding all the information; talks to Ping-o-Matic and tells it to alert various search engines; and talks to your feedreading client and tells it that I&#8217;ve written a new entry. Ta-da! Machines talking to machines.</p>
<p><strong>So what&#8217;s the problem with sloppy HTML? Machines can&#8217;t understand it.</strong> Which means that Google (to take one example) has to use elaborate parsing algorithms in order to turn your website into something it can understand. And while it&#8217;s all very well and good for a mega-corporation like Google to build these fuzzy linguistic interpreters, the next guy who wants to market a simple web service in his basement doesn&#8217;t have that kind of luxury.</p>
<p><strong>It also means that different browsers interpret your web pages differently</strong>, and therefore display things differently. If you use Internet Explorer and you come across an improperly coded XHTML page, the browser goes into &#8220;Quirks mode&#8221; (I swear I&#8217;m not making that up) and tries to figure out what the hell you&#8217;re trying to do. Many web programmers simply code for what looks good in Internet Explorer 6 on Windows &#8212; even if it&#8217;s &#8220;wrong&#8221; or &#8220;broken&#8221; code &#8212; and to hell with all the Safari, Firefox, Mozilla, Netscape, Opera, Konqueror, Lynx and Flock users.</p>
<p>Enter XHTML.</p>
<p>XHTML is basically the HTML language, cleaned up. It&#8217;s HTML after six weeks of boot camp under a hard-ass drill sergeant. <strong>You have strict rules, and those rules must be obeyed.</strong> Take the bulleted list code above. In proper XHTML, you cannot capitalize any of the tags. You must close each tag so that for every opening &lt;ul&gt; there is a closing &lt;/ul&gt;. You can&#8217;t put an &lt;li&gt; tag outside of a &lt;ul&gt; tag floating around on its own.</p>
<p>You can debate the merits of sending unruly teenagers to military school all you want, but for web pages there&#8217;s no debate. <strong>Strictly followed XHTML makes things easier for the machines that read your code.</strong> If we all followed the rules to the letter, Google would have a much easier time categorizing websites and it would save us all a lot of time.</p>
<p>Now here&#8217;s the problem: <strong>most web browsers process XHTML like normal HTML.</strong> They applaud your good manners and give you a gold star for coding correctly, but they&#8217;ll still slide right into Quirks mode when you make a mistake.</p>
<p>Until Mozilla Firefox. All you need to do to turn Firefox into an A-1 hard-ass drill sergeant is to (1) assign your web page the XHTML Strict DTD and (2) have your web server send the page to the browser as application/xhtml+xml instead of text/html. (You can look up how to do this elsewhere if you care. It&#8217;s basically just two lines of code.) <strong>Once you do this, Firefox will stop the display of your website cold if you&#8217;ve made any coding errors.</strong> Missed a closing &lt;p&gt; tag? Added an extra space? Accidentally capitalized a tag? Tough shit. Your page does not display, and you see a yellow XHTML Parsing Error instead.</p>
<p>(It&#8217;s important to understand that Firefox will only do this on a page-by-page basis, when that page and web server tell it to. If you don&#8217;t give Firefox these instructions, it will &#8220;fail gracefully&#8221; and display sloppily coded pages just like any other browser.)</p>
<p><strong>This just might change the world.</strong></p>
<p>Here&#8217;s how it might work: (1) Web programmers start migrating towards Strict XHTML. (2) Web services begin to interpret properly coded websites better than sloppily coded sites. (3) Web programmers flock to Strict XHTML in droves so their sites aren&#8217;t penalized. (4) The creators of these web services eventually decide to stop processing pages that are incorrectly coded altogether because it&#8217;s too much of a hassle. (5) The overhead for creating a useful web service goes down drastically. (6) Useful web services multiply exponentially. (7) You can search Google for &#8220;Northern Virginia Mexican restaurants,&#8221; and Google will no longer suggest that the &#8220;Pamela Andersen Britney Spears Katie Holmes Nude Sex Tits!!!&#8221; website might be the one you&#8217;re looking for.</p>
<p>And the world will be a better place.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidlouisedelman.com/technology/joy-of-xhtml/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

