<?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>www.hackification.com &#187; Links</title>
	<atom:link href="http://www.hackification.com/category/links/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hackification.com</link>
	<description></description>
	<lastBuildDate>Sat, 05 Jun 2010 11:16:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Occasional Links &#8211; Programming Mistakes, Fixing Them, C, Pointers, and more</title>
		<link>http://www.hackification.com/2010/05/08/occasional-links-programming-mistakes-fixing-them-c-pointers-and-more/</link>
		<comments>http://www.hackification.com/2010/05/08/occasional-links-programming-mistakes-fixing-them-c-pointers-and-more/#comments</comments>
		<pubDate>Sat, 08 May 2010 19:44:53 +0000</pubDate>
		<dc:creator>Stu Smith</dc:creator>
				<category><![CDATA[Links]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[humour]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.hackification.com/?p=460</guid>
		<description><![CDATA[The gaps between these link articles get longer and longer. I&#8217;ve just renewed the hosting for this site, so hopefully that will encourage me to write a proper article soon. In the meantime, another collection of the best coding articles from the past month. Top 25 Most Dangerous Programming Mistakes http://www.codinghorror.com/blog/2009/01/top-25-most-dangerous-programming-mistakes.html Summary article listing the [...]]]></description>
			<content:encoded><![CDATA[<p>The gaps between these link articles get longer and longer. I&#8217;ve just renewed the hosting for this site, so hopefully that will encourage me to write a proper article soon. In the meantime, another collection of the best coding articles from the past month.</p>
<p><span id="more-460"></span></p>
<h3>Top 25 Most Dangerous Programming Mistakes</h3>
<p><a href="http://www.codinghorror.com/blog/2009/01/top-25-most-dangerous-programming-mistakes.html" target="_blank">http://www.codinghorror.com/blog/2009/01/top-25-most-dangerous-programming-mistakes.html</a></p>
<p>Summary article listing the 25 most dangerous (in terms of security impact) programming mistakes. Even if you&#8217;re aware of all of these, it&#8217;s worth re-familiarizing yourself (and your co-workers) with them.</p>
<h3>Microsoft runs fuzzing botnet, finds 1,800 Office bugs</h3>
<p><a href="http://www.computerworld.com/s/article/9174539/Microsoft_runs_fuzzing_botnet_finds_1_800_Office_bugs" target="_blank">http://www.computerworld.com/s/article/9174539/Microsoft_runs_fuzzing_botnet_finds_1_800_Office_bugs</a></p>
<p>No, not that sort of botnet. Microsoft are using a distributed computer system to generate random changes to Office files, in an attempt to discover buffer overruns and other vulnerabilities in the file format parser.</p>
<h3>Much ado about NULL: An introduction to virtual memory</h3>
<p><a href="http://blog.ksplice.com/2010/03/null-pointers-part-i/" target="_blank">http://blog.ksplice.com/2010/03/null-pointers-part-i/</a></p>
<p>Down-to-the-metal article explaining pointers, memory mapping, and virtual memory. Worth reading as it covers the basics that we rarely think about.</p>
<h3>Amazing feats of Clang Error Recovery</h3>
<p><a href="http://blog.llvm.org/2010/04/amazing-feats-of-clang-error-recovery.html" target="_blank">http://blog.llvm.org/2010/04/amazing-feats-of-clang-error-recovery.html</a></p>
<p>Clang is the new up-and-coming C/C++ open-source compiler. If you&#8217;ve ever worked with C++, you&#8217;ll know how cryptic and downright useless the error messages emitted by most compilers are. Clang is attempting to address that weakness.</p>
<h3>Good Math, Bad Pointer Math / C Is Not Assembly</h3>
<p><a href="http://james-iry.blogspot.com/2010/04/good-math-bad-pointer-math.html" target="_blank">http://james-iry.blogspot.com/2010/04/good-math-bad-pointer-math.html</a><br />
<a href="http://james-iry.blogspot.com/2010/04/c-is-not-assembly.html" target="_blank">http://james-iry.blogspot.com/2010/04/c-is-not-assembly.html</a></p>
<p>A deep-dive into the intricacies of C pointers, and how they relate to the C standard. If you&#8217;re interested in writing portable and correct C code, this is worth a read.</p>
<h3>Underscore.js</h3>
<p><a href="http://documentcloud.github.com/underscore/" target="_blank">http://documentcloud.github.com/underscore/</a></p>
<p>Not so much an article as a useful download &#8211; Underscore.js (named after the identifier used to access the functions) provides a suite of functional programming constructs for JavaScript.</p>
<h3>What’s wrong with extending the DOM</h3>
<p><a href="http://perfectionkills.com/whats-wrong-with-extending-the-dom/" target="_blank">http://perfectionkills.com/whats-wrong-with-extending-the-dom/</a></p>
<p>JavaScript allows any objects to be extended, either on a per-object or per-type basis. The popular Prototype library used this mechanism &#8211; and subsequently found it to be a bad idea. Prototype 2.0 is moving away from  this technique &#8211; read this article for a clear explanation why.</p>
<h3>The ASP.NET Web Development Horror</h3>
<p><a href="http://www.codingthewheel.com/archives/asp-net-web-development-horror" target="_blank">http://www.codingthewheel.com/archives/asp-net-web-development-horror</a></p>
<p>I&#8217;ve recently started (belatedly) playing with ASP.NET MVC 2, and it&#8217;s a breath of fresh air compared to &#8220;classic&#8221; ASP.NET. (Presumably &#8220;classic&#8221; ASP is now &#8220;classic classic ASP&#8221;). If you&#8217;ve not been able to articulate why ASP.NET wasn&#8217;t up to scratch, this well-written and funny article will help. How can you not read an article containing the phrase &#8220;tricksy little hobbits doing obscene things in the cupboards&#8221;?</p>
<h3>Use C# dynamic typing to conveniently access internals of an object</h3>
<p><a href="http://igoro.com/archive/use-c-dynamic-typing-to-conveniently-access-internals-of-an-object/" target="_blank">http://igoro.com/archive/use-c-dynamic-typing-to-conveniently-access-internals-of-an-object/</a></p>
<p>I&#8217;ve linked to Igor&#8217;s blog before &#8211; the articles are clear, well-written, and well-laid-out. This article suggests a new use for one of .NET 4.0&#8242;s new features, dynamic types.</p>
<h3>A Brief, Incomplete, and Mostly Wrong History of Programming Languages</h3>
<p><a href="http://www.cvaieee.org/html/humor/programming_history.html" target="_blank">http://www.cvaieee.org/html/humor/programming_history.html</a></p>
<p>I like to end on a light note, so here&#8217;s a couple of funnies. If you&#8217;ve ever wondered about this history of various programming languages, this article is completely incorrect.</p>
<h3>First among SQLs</h3>
<p><a href="http://www.theregister.co.uk/2010/04/20/verity_stob_sql/" target="_blank">http://www.theregister.co.uk/2010/04/20/verity_stob_sql/</a></p>
<p>If you&#8217;re ever bored at work, you can do far worse that read Verity Stob&#8217;s collection of articles. They&#8217;re tongue-in-cheek, deadpan, and scarily accurate.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackification.com/2010/05/08/occasional-links-programming-mistakes-fixing-them-c-pointers-and-more/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Weekly Links &#8211; Microsoft, Windows Phone 7, General Coding, and a bit of humour</title>
		<link>http://www.hackification.com/2010/03/29/weekly-links-microsoft-windows-phone-7-general-coding-and-a-bit-of-humour/</link>
		<comments>http://www.hackification.com/2010/03/29/weekly-links-microsoft-windows-phone-7-general-coding-and-a-bit-of-humour/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 20:23:38 +0000</pubDate>
		<dc:creator>Stu Smith</dc:creator>
				<category><![CDATA[Links]]></category>
		<category><![CDATA[humour]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[windows phone 7]]></category>

		<guid isPermaLink="false">http://www.hackification.com/?p=444</guid>
		<description><![CDATA[Well, technically it&#8217;s been two weeks since the last collection of links &#8211; but hey, who&#8217;s counting? Microsoft turns 35: Best, worst and most notable moments http://www.computerworld.com/s/article/print/9173238/Microsoft_turns_35_Best_worst_and_most_notable_moments An interesting look back at Microsoft&#8217;s history. Love &#8216;em or hate &#8216;em, you have to acknowledge the mark they&#8217;ve made on the IT industry. You&#8217;ll almost certainly know [...]]]></description>
			<content:encoded><![CDATA[<p>Well, technically it&#8217;s been two weeks since the last collection of links &#8211; but hey, who&#8217;s counting?</p>
<p><span id="more-444"></span></p>
<h3>Microsoft turns 35: Best, worst and most notable moments</h3>
<p><a href="http://www.computerworld.com/s/article/print/9173238/Microsoft_turns_35_Best_worst_and_most_notable_moments" target="_blank">http://www.computerworld.com/s/article/print/9173238/Microsoft_turns_35_Best_worst_and_most_notable_moments</a></p>
<p>An interesting look back at Microsoft&#8217;s history. Love &#8216;em or hate &#8216;em, you have to acknowledge the mark they&#8217;ve made on the IT industry. You&#8217;ll almost certainly know everything in this article, but it&#8217;s a nice summary all the same.</p>
<h3>Windows Phone 7 Series: the complete guide</h3>
<p><a href="http://www.engadget.com/2010/03/18/windows-phone-7-series-the-complete-guide/" target="_blank">http://www.engadget.com/2010/03/18/windows-phone-7-series-the-complete-guide/</a></p>
<p>The details of Microsoft&#8217;s upcoming mobile OS were released recently, and this is a nice summary article. The graphical appearance of the OS looks very fresh and modern &#8211; could Microsoft have turned a corner, design-wise?</p>
<h3>Building a Windows Phone 7 Twitter Application using Silverlight</h3>
<p><a href="http://weblogs.asp.net/scottgu/archive/2010/03/18/building-a-windows-phone-7-twitter-application-using-silverlight.aspx" target="_blank">http://weblogs.asp.net/scottgu/archive/2010/03/18/building-a-windows-phone-7-twitter-application-using-silverlight.aspx</a></p>
<p>Given the familiarity of the coding environment for Windows Phone 7, I could be tempted to wish for one, instead of wishing for an iPhone.</p>
<h3>Programming Windows Phone 7 Series</h3>
<p><a href="http://www.charlespetzold.com/phone/" target="_blank">http://www.charlespetzold.com/phone/</a></p>
<p>If like me you like to read an old-fashioned book in the bath instead of reading articles on-line, Charles Petzold is preparing one. Here&#8217;s a sneaky preview in PDF format.</p>
<h3>New, But Not So Obvious, Features in .NET 4.0</h3>
<p><a href="http://galilyou.blogspot.com/2010/03/new-but-not-so-obvious-features-in-net.html" target="_blank">http://galilyou.blogspot.com/2010/03/new-but-not-so-obvious-features-in-net.html</a></p>
<p>.NET 4 is with us, and there are plenty of new, headline features. Here&#8217;s a few that barely get a footnote &#8211; but which are interesting nonetheless.</p>
<h3>Hello from a libc-free world! (Part 1)</h3>
<p><a href="http://blog.ksplice.com/2010/03/libc-free-world/" target="_blank">http://blog.ksplice.com/2010/03/libc-free-world/</a></p>
<p>Why would a single-line program produce a larger-than-expected executable? Where does that excess baggage come from? And if you wanted to ditch the standard core libraries, how would you go about it?</p>
<h3>Visualizing Usage of the Firefox Menu Bar</h3>
<p><a href="http://blog.mozilla.com/faaborg/2010/03/23/visualizing-usage-of-the-firefox-menu-bar/" target="_blank">http://blog.mozilla.com/faaborg/2010/03/23/visualizing-usage-of-the-firefox-menu-bar/</a></p>
<h3>Interviews with Average Programmers</h3>
<p><a href="http://blogs.citytechinc.com/sanderson/?p=290" target="_blank">http://blogs.citytechinc.com/sanderson/?p=290</a></p>
<p>I&#8217;ve been reading &#8220;Coders at Work&#8221; recently, a collection of interviews with great programmers. What would an interview with a coder like you or me be like?</p>
<h3>5 Stages of Programmer Incompetence</h3>
<p><a href="http://coderoom.wordpress.com/2010/03/19/5-stages-of-programmer-incompetence/" target="_blank">http://coderoom.wordpress.com/2010/03/19/5-stages-of-programmer-incompetence/</a></p>
<p>Tongue-in-cheek article (mostly) about how we progress in the craft of coding. I can recognise aspects of myself in all of these.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackification.com/2010/03/29/weekly-links-microsoft-windows-phone-7-general-coding-and-a-bit-of-humour/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weekly Links &#8211; Static analysis, Hacking, Graphics, and Concurrency</title>
		<link>http://www.hackification.com/2010/03/15/weekly-links-static-analysis-hacking-graphics-and-concurrency/</link>
		<comments>http://www.hackification.com/2010/03/15/weekly-links-static-analysis-hacking-graphics-and-concurrency/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 19:55:38 +0000</pubDate>
		<dc:creator>Stu Smith</dc:creator>
				<category><![CDATA[Links]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[mecurial]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[sql injection]]></category>
		<category><![CDATA[static analysis]]></category>

		<guid isPermaLink="false">http://www.hackification.com/?p=428</guid>
		<description><![CDATA[My plan of posting links weekly hasn&#8217;t quite worked out recently &#8211; my wife gave birth to a little baby boy, Adam, a month ago, so I&#8217;ve been pretty busy. Since he&#8217;s sleeping now I figured I might be able to get a quick article in. A Few Billion Lines of Code Later: Using Static [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.hackification.com/wp-content/uploads/2010/03/adam.jpg"><img class="alignleft size-full wp-image-435" style="margin-right: 10px;" title="Adam" src="http://www.hackification.com/wp-content/uploads/2010/03/adam.jpg" alt="" width="100" height="89" /></a>My plan of posting links weekly hasn&#8217;t quite worked out recently &#8211; my wife gave birth to a little baby boy, Adam, a month ago, so I&#8217;ve been pretty busy. Since he&#8217;s sleeping now I figured I might be able to get a quick article in.</p>
<p><span id="more-428"></span></p>
<h3>A Few Billion Lines of Code Later: Using Static Analysis to Find Bugs in the Real World</h3>
<p><a href="http://cacm.acm.org/magazines/2010/2/69354-a-few-billion-lines-of-code-later/fulltext" target="_blank">http://cacm.acm.org/magazines/2010/2/69354-a-few-billion-lines-of-code-later/fulltext</a></p>
<p>This article is kind of an advert for Coverity, but it&#8217;s interesting all the same. It&#8217;s partly about their static code-analysis tool, but mainly about the social aspects of selling the software.</p>
<h3>A Big Case of &#8230;OOPS&#8230;</h3>
<p><a href="http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/2010/02/25/a-big-case-of-oops.aspx" target="_blank">http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/2010/02/25/a-big-case-of-oops.aspx</a></p>
<p>Is defense against SQL injection attacks important? Absolutely, but for a middle manager it&#8217;s probably an academic issue&#8230; until you see your site has been hacked, right in front of your eyes.</p>
<h3>Hg Init: a Mercurial tutorial</h3>
<p><a href="http://hginit.com/" target="_blank">http://hginit.com/</a></p>
<p>Joel Spolsky might have stopped blogging, but he&#8217;s still writing other kinds of articles. This is an excellent introduction to Mercurial, a distributed version-tracking system. OK, so you might be stuck using Visual SourceSafe at work, but a coder can dream.</p>
<h3>Processing.js</h3>
<p><a href="http://processingjs.org/" target="_blank">http://processingjs.org/</a></p>
<p>I&#8217;ve always fancied playing with Processing, the Java-based graphical environment, but the Java aspect always put me off. This is a JavaScript version, so anyone can view your creations.</p>
<h3>Home-baked graphics</h3>
<p><a href="http://bit-player.org/2010/home-baked-graphics" target="_blank">http://bit-player.org/2010/home-baked-graphics</a></p>
<p>In these days of pre-packaged charting libraries, it&#8217;s refreshing to see someone getting down to the metal (LISP and PostScript, in this case) to generate custom graphs. Why does the author bother? And where to go from there? Read for a discussion.</p>
<h3>Prefer Futures to Baked-In &#8220;Async APIs&#8221;</h3>
<p><a href="http://www.drdobbs.com/go-parallel/article/showArticle.jhtml?articleID=222301165" target="_blank">http://www.drdobbs.com/go-parallel/article/showArticle.jhtml?articleID=222301165</a></p>
<p>Very useful, very specific, and practical article about a better technique for writing APIs that expose concurrency. Recommended reading despite Dr Dobb&#8217;s in-your-face adverts and pagination.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackification.com/2010/03/15/weekly-links-static-analysis-hacking-graphics-and-concurrency/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weekly Links &#8211; node.js, Processors, Microsoft, and more</title>
		<link>http://www.hackification.com/2010/02/07/weekly-links/</link>
		<comments>http://www.hackification.com/2010/02/07/weekly-links/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 12:24:33 +0000</pubDate>
		<dc:creator>Stu Smith</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[node.js]]></category>

		<guid isPermaLink="false">http://www.hackification.com/?p=422</guid>
		<description><![CDATA[Since I&#8217;m having trouble producing full-length articles at the moment, I thought I&#8217;d try a different track to at least get some value out of my blog hosting costs. I&#8217;ll try to post a handful of links that have caught my attention each week. Comet with node.js and V8 http://amix.dk/blog/post/19484 A presentation (slideshow, no audio [...]]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;m having trouble producing full-length articles at the moment, I thought I&#8217;d try a different track to at least get <em>some </em>value out of my blog hosting costs. I&#8217;ll try to post a handful of links that have caught my attention each week.</p>
<p><span id="more-424"></span></p>
<h3>Comet with node.js and V8</h3>
<p><a href="http://amix.dk/blog/post/19484" target="_blank">http://amix.dk/blog/post/19484</a></p>
<p>A presentation (slideshow, no audio or video) on node.js, a JavaScript web-server running on Google&#8217;s V8 engine. Very interesting concept &#8211; using an event-based system vastly simplifies the code needed to serve data. There&#8217;s plenty of discussion about node.js on the interwebs at the moment &#8211; hopefully it will grow and become more than just a curiosity.</p>
<h3>Gallery  of Processor Cache Effects</h3>
<p><a href="http://igoro.com/archive/gallery-of-processor-cache-effects/" target="_blank">http://igoro.com/archive/gallery-of-processor-cache-effects/</a></p>
<p>Interesting blog post about the effects that processor caches may have on performance. Examples are in C#, but really apply to any language.</p>
<h3>Microsoft’s Creative Destruction</h3>
<p><a href="http://www.nytimes.com/2010/02/04/opinion/04brass.html?pagewanted=1&amp;ref=opinion" target="_blank">http://www.nytimes.com/2010/02/04/opinion/04brass.html?pagewanted=1&amp;ref=opinion</a></p>
<p>Opinion piece from the NYTimes regarding Microsoft&#8217;s recent lack of innovation (at least, in the area of shiny gadgets). Written by an ex-vice-president of Microsoft.</p>
<h3>How Many Passes?</h3>
<p><a href="http://blogs.msdn.com/ericlippert/archive/2010/02/04/how-many-passes.aspx" target="_blank">http://blogs.msdn.com/ericlippert/archive/2010/02/04/how-many-passes.aspx</a></p>
<p>Summary article from Eric Lippert describing the differences between the C# compiler and a &#8220;traditional&#8221; compiler, and listing the various passes made over the symbol tree.</p>
<h3>A Deadlock Holiday</h3>
<p><a href="http://www.theregister.co.uk/2009/12/10/verity_stob/" target="_blank">http://www.theregister.co.uk/2009/12/10/verity_stob/</a></p>
<p>Very funny tongue-in-cheek article about the current state of parallel / multicore coding techniques, from Verity Stob of The Register.</p>
<h3>A Maturity Model for Source Control</h3>
<p><a href="http://lucas-ward.blogspot.com/2010/02/maturity-model-for-source-control-scmm.html" target="_blank">http://lucas-ward.blogspot.com/2010/02/maturity-model-for-source-control-scmm.html</a></p>
<p>Semi-opinion piece assigning levels to types of source-control systems &#8211; from &#8220;No SCM&#8221; through &#8220;Clunky&#8221; to &#8220;Speedy,  Invisible, and Highly Capable&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackification.com/2010/02/07/weekly-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.less &#8211; Dot Less Dynamic CSS Processor for .NET</title>
		<link>http://www.hackification.com/2010/01/17/less-dot-less-dynamic-css-processor-for-net/</link>
		<comments>http://www.hackification.com/2010/01/17/less-dot-less-dynamic-css-processor-for-net/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 18:49:26 +0000</pubDate>
		<dc:creator>Stu Smith</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[less]]></category>
		<category><![CDATA[stylesheets]]></category>

		<guid isPermaLink="false">http://www.hackification.com/?p=377</guid>
		<description><![CDATA[Of the three textual formats that make up the main pillars of web development (HTML, CSS, and JavaScript), CSS has had the least attention in terms of server-side processing. HTML is obviously well covered, with frameworks such as ASP.NET. JavaScript is starting to be covered with compilers such as Google&#8217;s Closure Tools. Until now however [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-379" style="margin-right: 10px;" title=".less" src="http://www.hackification.com/wp-content/uploads/2010/01/dotless.jpg" alt=".less logo" width="131" height="69" />Of the three textual formats that make up the main pillars of web development (HTML, CSS, and JavaScript), CSS has had the least attention in terms of server-side processing. HTML is obviously well covered, with frameworks such as ASP.NET. JavaScript is starting to be covered with compilers such as <a title="Closure Tools - Google Code" href="http://code.google.com/closure/" target="_blank">Google&#8217;s Closure Tools</a>. Until now however (in the .NET world at least), there haven&#8217;t really been any CSS processors.</p>
<p><span id="more-377"></span>Luckily, that is now changing with the recent release of <a title="Less Css for .NET" href="http://www.dotlesscss.com/" target="_blank">.less (Dot Less)</a>. This is a port of the Ruby LESS library to .NET. It&#8217;s still in beta, so be warned that the API is still in a certain amount of flux. (That&#8217;s a good thing however &#8211; I&#8217;d rather have a bit of pain in the beta stage, in return for a well-thought-out API later on). The authors are very responsive &#8211; there&#8217;s a friendly <a title="DotLess (Less Css for .NET) | Google Groups" href="http://groups.google.com/group/dotless" target="_blank">discussion group</a> &#8211; and the couple of bugs I&#8217;ve reported have been fixed within a very short time frame. This project seems to be in very active development, and I&#8217;m extremely impressed with it. It&#8217;s so simple to use, and gives CSS development a much-needed shot in the arm, that using this library seems a no-brainer decision to me.</p>
<p>So what benefits does this library give you? (Examples are taken from the .less homepage).</p>
<h3>1. Minification</h3>
<p>The final output from .less is a compacted (or minified) version. This means you can write your CSS with as many comments and whitespace as you like, without worrying that the client-side download will be huge. This might seem like a &#8220;meh&#8221; feature, but it&#8217;s free and will have immediate beneficial effects on your bandwidth.</p>
<h3>2. Variables</h3>
<p>CSS doesn&#8217;t support any form of variables or macros, so constants (the worst culprit being colours) get copied around the CSS file. That&#8217;s fine until you decide that the pink-on-orange colour scheme isn&#8217;t working, and you need to make a change. .less allows you to define variables using the syntax &#8220;@name: value&#8221;, and then reference them anywhere a value would otherwise be used.</p>
<p>Example:</p>
<pre>@brand_color: #4D926F;

#header {
  color: @brand_color;
}

h2 {
  color: @brand_color;
}</pre>
<h3>3. Mixins</h3>
<p>We&#8217;re now in a second round of &#8220;browser wars&#8221;, with modern browsers providing useful features such as border-radius via non-standard extensions. We also have to cope with Internet Explorer still making use of odd syntax for features such as opacity (via filter). The upshot of this is that to define certain CSS effects, we have to provide three or four CSS style properties, to cover various browsers. Mixins allow this bloat to be ameliorated by defining a class with the desired properties, and then &#8220;mixing&#8221; them into another class.</p>
<p>Example:</p>
<pre>.rounded_corners {
  -moz-border-radius: 8px;
  -webkit-border-radius: 8px;
  border-radius: 8px;
}

#header {
  .rounded_corners;
}

#footer {
  .rounded_corners;
}</pre>
<h3>4. Nested Rules</h3>
<p>This feature is probably of least interest to me, since I favour single-line rule formatting, however if you write multi-line rules, then this could be a very useful feature. Nested rules allow &#8220;inheritance&#8221; of CSS rules, such that more specific rules may be nested within a less-specific parent rule.</p>
<p>Example:</p>
<pre>#header {
  color: red;
  a {
       font-weight: bold;
       text-decoration: none;
    }
}</pre>
<p>I could possibly see myself using it for :hover rules and the like.</p>
<h3>5. Operations</h3>
<p>Since I&#8217;m merging .less into an existing codebase, I haven&#8217;t yet refactored my CSS to make use of this feature. Operations allow arithmetic to be performed on expressions involving variables. For example, instead of defining variables for a colour and its lighter equivalent, you can instead just define a variable for the colour, and then computer the lighter colour.</p>
<p>Example:</p>
<pre>@the-border: 1px;
@base-color: #111;

#header {
  color: @base-color * 3;
  border-left: @the-border;
  border-right: @the-border * 2;
}

#footer {
  color: (@base-color + #111) * 1.5;
}</pre>
<h3>Alternative Usage</h3>
<p>The homepage gives instructions for a quick-up-and-running scenario, however I already had code to handle caching and combining of stylesheets, so I wanted to hook into that. It&#8217;s easily possible to process CSS as strings if desired:</p>
<pre>// .less format CSS as string in 'input'.
var dotLessEngine = new dotless.Core.engine.ExtensibleEngineImpl( input );

// Transformed CSS now in 'css'.
var css = dotLessEngine.Css;

// Now minify...
var dotlessMinifier = new dotless.Core.minifier.Processor( css );

// Output CSS suitable for sending to client in 'output'.
var output = new string( dotlessMinifier.Output );</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.hackification.com/2010/01/17/less-dot-less-dynamic-css-processor-for-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#039;Smart and Gets Things Done&#039; vs &#039;Done and Gets Things Smart&#039;</title>
		<link>http://www.hackification.com/2010/01/10/smart-and-gets-things-done-vs-done-and-gets-things-smart/</link>
		<comments>http://www.hackification.com/2010/01/10/smart-and-gets-things-done-vs-done-and-gets-things-smart/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 19:10:47 +0000</pubDate>
		<dc:creator>Stu Smith</dc:creator>
				<category><![CDATA[Links]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[articles]]></category>
		<category><![CDATA[hiring]]></category>
		<category><![CDATA[recruitment]]></category>

		<guid isPermaLink="false">http://www.hackification.com/?p=351</guid>
		<description><![CDATA[In this article I link to two excellent articles on the subject of hiring coders. They&#8217;re not new by any means, but if you haven&#8217;t read one or both of them, I thoroughly recommend them. (If you&#8217;re familiar with both these writers, then skip this article.) Smart, and Gets Things Done Joel Spolsky&#8217;s 2006 article [...]]]></description>
			<content:encoded><![CDATA[<p>In this article I link to two excellent articles on the subject of hiring coders. They&#8217;re not new by any means, but if you haven&#8217;t read one or both of them, I thoroughly recommend them. (If you&#8217;re familiar with both these writers, then skip this article.)</p>
<p><span id="more-351"></span></p>
<h3>Smart, and Gets Things Done</h3>
<p><a href="http://www.hackification.com/wp-content/uploads/2010/01/spolsky.jpg"><img class="alignleft size-full wp-image-363" style="margin-right: 10px;" title="Joel Spolsky" src="http://www.hackification.com/wp-content/uploads/2010/01/spolsky.jpg" alt="" width="130" height="87" /></a>Joel Spolsky&#8217;s 2006 article &#8220;The Guerrilla Guide to Interviewing&#8221; is a real classic that&#8217;s since been made into a book. He argues that there are two things to look for when interviewing, and that a candidate needs to have both attributes &#8211; having just one is as bad as having neither.</p>
<blockquote><p>&#8220;Everybody gives lip service to the idea that people are the most important part of a software project, but nobody is quite sure what you can <em>do</em> about it. The very first thing you have to do right if you want to have good programmers is to <em>hire</em> the right programmers, and that means you have to be able to figure out who the right programmers <em>are</em>, and this is usually done in the interview process.&#8221;</p></blockquote>
<p>Read Joel&#8217;s Article: <strong><a title="The Guerrilla Guide to Interviewing (version 3.0)" href="http://www.joelonsoftware.com/articles/GuerrillaInterviewing3.html" target="_blank">The Guerrilla Guide to Interviewing (version 3.0)</a></strong></p>
<h3>Done, and Gets Things Smart</h3>
<p><a href="http://www.hackification.com/wp-content/uploads/2010/01/yegge.jpg"><img class="alignleft size-full wp-image-364" style="margin-right: 10px;" title="Steve Yegge" src="http://www.hackification.com/wp-content/uploads/2010/01/yegge.jpg" alt="" width="130" height="87" /></a>Steve Yegge&#8217;s 2008 response article reminds us that recognising smarts (in ourselves and others) isn&#8217;t even necessarily possible. He suggests that the best approach to hiring is finding &#8220;seed&#8221; employees (although obviously being able to identify them is a Catch-22 situation). To find them you either need to be lucky, or perhaps home in on them via word of mouth.</p>
<blockquote><p>&#8220;How do you hire someone who&#8217;s smarter than you?  How do you <em>tell</em> if someone&#8217;s smarter than you? This is a problem I&#8217;ve thought about, over nearly twenty years of interviewing, and it appears that the answer is: you can&#8217;t. You just have to get lucky.&#8221;</p></blockquote>
<p>Read Steve&#8217;s Article: <strong><a title="Done, and Gets Things Smart" href="http://steve-yegge.blogspot.com/2008/06/done-and-gets-things-smart.html" target="_blank">Done, and Gets Things Smart</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackification.com/2010/01/10/smart-and-gets-things-done-vs-done-and-gets-things-smart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debug.Assert Considered Pointless</title>
		<link>http://www.hackification.com/2009/06/10/debug-assert-considered-pointless/</link>
		<comments>http://www.hackification.com/2009/06/10/debug-assert-considered-pointless/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 20:26:24 +0000</pubDate>
		<dc:creator>Stu Smith</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Experiments]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[assert]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.hackification.com/?p=214</guid>
		<description><![CDATA[One thing I was told as a young programmer was to make good use of assertions for checking code. As time goes by however, I can see less and less use for assertions. I&#8217;m starting to think they&#8217;re pretty useless. (I&#8217;m going to use C# in my examples here: some of these points might not [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-225" style="margin-left: 10px; margin-right: 10px;" title="Debug Assert Stop" src="http://www.hackification.com/wp-content/uploads/2009/06/stop.png" alt="Debug Assert Stop" width="96" height="96" />One thing I was told as a young programmer was to make good use of assertions for checking code. As time goes by however, I can see less and less use for assertions. I&#8217;m starting to think they&#8217;re pretty useless.</p>
<p><span id="more-214"></span></p>
<p>(I&#8217;m going to use C# in my examples here: some of these points might not apply to all languages. By default, an assertion will not fire in a C# release build, and furthermore, the code inside will not even be executed).</p>
<p><em>Update 2009-06-11: I probably haven&#8217;t been clear enough, but luckily various commenters have picked up on this: I&#8217;m not advocating removing assertions and replacing them with nothing! In general, I think assertions should be replaced with a stronger check that also runs (or can run) in a release build.</em></p>
<p><strong>1. Pointless Guard Checking</strong></p>
<p>Unfortunately in my coding travels I see quite a bit of code like this:</p>
<pre>void Foo(Bar bar)
{
  Debug.Assert(bar != null);

  bar.DoSomething();
}</pre>
<p>What&#8217;s the point? If bar is null, then using it will throw an exception anyway. Why add unnecessary lines of code that make reading harder?</p>
<p><strong>2. Bad Argument Checking</strong></p>
<p>But, you&#8217;re thinking, what if the usage is separated from the assignment?</p>
<pre>class Foo
{
  public Foo(Bar bar)
  {
    Debug.Assert(bar != null);

    _bar = bar;
  }

  public void Method()
  {
    _bar.DoSomething();
  }

  private Bar _bar;
}</pre>
<p>True, you want to catch the error as it happens, not later on in the method. But shouldn&#8217;t you be throwing an ArgumentNullException instead?</p>
<p><strong>3. Difficult Detective Work</strong></p>
<p>So now you&#8217;re telling me that you&#8217;re not writing component code, and the only client of this class will be the application it&#8217;s embedded in. Why not save some effort and skimp on the checking code, and make it debug-only?</p>
<p>Fine idea&#8230; until you get a crash report from one of your users, and the stacktrace points to a NullReferenceException in Method(). Now you have to figure out where the null value got passed to the constructor&#8230; a potentially much more difficult task.</p>
<p><strong>4. Differences Between Debug and Release</strong></p>
<p>If you&#8217;re like me, you generally run the applications in debug. Your customers however, run in release. Why make the differences between these two versions any bigger? Even if you don&#8217;t intend your debug statements to change program state, it&#8217;s all too easy to accidentally do so:</p>
<ul>
<li>Running lazy-initializers or singleton constructors;</li>
<li>Loading data from the database via an ORM;</li>
<li>Moving data in or out of a cache;</li>
<li>Running static constructors.</li>
</ul>
<p><strong>5. Too-Shy Sanity-Checking</strong></p>
<p>Sometimes, despite the above warning, you really do have sanity-checking code that you&#8217;d like to run in a development or test environment to catch regressions, but which is too slow to give to general users. (I read somewhere that Excel has two computation engines: a simple, slow, reference one, and a fast, parallel, release one. Testers can run the two in parallel, and any differences are automatically flagged as errors).</p>
<p>So you might be tempted to do something like:</p>
<pre>Debug.Assert( SlowlyAndCarefullyVerifyInternalState() );</pre>
<p>The problem I have with this is that the debug/release division is way too blunt.</p>
<ul>
<li>Suppose a tester wants to test a release build, but also perform the sanity-checking?</li>
<li>Suppose a customer finds a bug in a complex calculation, and you want them to run the checks?</li>
<li>Suppose a developer wants to debug performance issues in the non-checked code?</li>
</ul>
<p>I would suggest you move the conditionals for code like this to a (possibly hidden) configuration setting. Someone wants to run in slow-and-safe mode? No problem, just tell them the registry setting (or whatever). By all means, change the splash screen or title bar or whatever so it says &#8220;test mode&#8221;.</p>
<p>The advantages of this method are:</p>
<ul>
<li>Anyone can turn it on and off;</li>
<li>Sanity-checking can be controlled at a much finer granularity than all-on / all-off.</li>
</ul>
<p><strong>6. Is It Recoverable, Or Not?</strong></p>
<p>The final argument against debug assertions concerns just exactly what an assertion means.</p>
<p>To my mind, an assertion is different to a simple flow-control test (&#8220;did the user enter a valid number?&#8221;), which is something the program can (should) handle. By definition, an assertion is checking for a disallowed state. An assertion doesn&#8217;t check for incorrect data; it checks for an incorrect program. Continuing after an assertion leads to undefined behaviour.</p>
<p>So how can you continue? More to the point, why should a user even be allowed to continue? If the state really is unrecoverable, then fail. Fail fast, log the error, and bail (possibly trying to allow the user to save work, or whatever). Having a release-build application continue after what would have been an assertion is just plain wrong.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackification.com/2009/06/10/debug-assert-considered-pointless/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>HOWTO: Repair Your Vista 64-bit System After Internet Explorer 8</title>
		<link>http://www.hackification.com/2009/04/01/howto-repair-your-vista-64-bit-system-after-internet-explorer-8/</link>
		<comments>http://www.hackification.com/2009/04/01/howto-repair-your-vista-64-bit-system-after-internet-explorer-8/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 18:28:47 +0000</pubDate>
		<dc:creator>Stu Smith</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[EasyAs123Web.com]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ie8]]></category>

		<guid isPermaLink="false">http://www.hackification.com/?p=86</guid>
		<description><![CDATA[Internet Explorer 8 (IE8) has now been released to the public, and while it&#8217;s not enough to shift me from Firefox, I&#8217;m happy that it offers standards-compliant rendering and a useful &#8220;compatibility view&#8221;, meaning that web developers can essentially test on IE7 and IE8 without needing virtual machines. Unfortunately, when installed on 64-bit Vista (x64), [...]]]></description>
			<content:encoded><![CDATA[<p>Internet Explorer 8 (IE8) has now been released to the public, and while it&#8217;s not enough to shift me from Firefox, I&#8217;m happy that it offers standards-compliant rendering and a useful &#8220;compatibility view&#8221;, meaning that web developers can essentially test on IE7 and IE8 without needing virtual machines. Unfortunately, when installed on 64-bit Vista (x64), it seems to have some adverse affects on other applications. Here&#8217;s how to fix this.</p>
<p><span id="more-86"></span></p>
<p>The problems we&#8217;ve experienced following installation of IE8 have been:</p>
<ul>
<li>Windows Explorer opens folders in new windows, even if you have &#8220;Open each window in the same folder&#8221; checked;</li>
<li>&#8220;Open in new tab&#8221; doesn&#8217;t work in IE8;</li>
<li>Can&#8217;t connect to databases using SQL Management Studio Express 2008 (&#8220;Unable to cast COM object of type &#8216;System.__ComObject&#8217; to interface type &#8216;Microsoft.VisualStudio.OLE.Interop.IServiceProvider&#8217;. Exception from HRESULT: 0&#215;80004002 (E_NOINTERFACE)&#8221;).</li>
</ul>
<p>The solution is pretty simple:</p>
<ol>
<li>Go to Start -&gt; All Programs -&gt; Accessories, right-click &#8220;Command Prompt&#8221;, and choose &#8220;Run as Administrator&#8221;.</li>
<li>OK the user access warning dialogs.</li>
<li>Enter &#8220;regsvr32 actxprxy.dll&#8221;.</li>
<li>Reboot.</li>
</ol>
<p>Sorted! No more tearing my hair out.<a href="http://msmvps.com/blogs/martinpoon/archive/2009/03.aspx" target="_blank"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackification.com/2009/04/01/howto-repair-your-vista-64-bit-system-after-internet-explorer-8/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Ten Web Development Tips I Wish I&#039;d Known Two Years Ago</title>
		<link>http://www.hackification.com/2008/11/06/ten-web-development-tips-i-wish-id-known-two-years-ago/</link>
		<comments>http://www.hackification.com/2008/11/06/ten-web-development-tips-i-wish-id-known-two-years-ago/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 20:38:01 +0000</pubDate>
		<dc:creator>Stu Smith</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.hackification.com/?p=54</guid>
		<description><![CDATA[A couple of years ago I started doing more and more web development and web design, and less and less desktop development. Here&#8217;s a few things I wish I&#8217;d known then: 1. Use a Reset Stylesheet Different browsers are free to set default styles for font sizes, margins, and so forth. It&#8217;s a silly part [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of years ago I started doing more and more web development and web design, and less and less desktop development. Here&#8217;s a few things I wish I&#8217;d known then:</p>
<p><strong>1. Use a Reset Stylesheet</strong></p>
<p>Different browsers are free to set default styles for font sizes, margins, and so forth. It&#8217;s a silly part of the specification but there you go. Rather than trying to eliminate these differences on a case-by-case basis, many web developers now make use of a reset stylesheet to set all margins to zero, remove all borders, standardize all font sizes, and so forth.</p>
<p>There&#8217;s dispute over which particular features need to be reset; but to be honest having any one of them is going to be better than none. Here&#8217;s a few examples:</p>
<ul>
<li><a title="CSS Tools: Reset CSS" href="http://meyerweb.com/eric/tools/css/reset/" target="_blank">Eric Meyer</a></li>
<li><a title="Yahoo! UI Library: Reset CSS" href="http://developer.yahoo.com/yui/reset/" target="_blank">Yahoo!</a></li>
<li><a title="Master Stylesheet: The Most Useful CSS Technique" href="http://www.crucialwebhost.com/blog/master-stylesheet-the-most-useful-css-technique/" target="_blank">Crucial</a></li>
</ul>
<p><strong>2. Use a Browser Development Plug-In</strong></p>
<p>When you&#8217;re learning it&#8217;s useful to be able to visualise &#8220;invisible&#8221; parts of your web-page &#8211; margins, padding, parent positions, and so forth. Unless you fancy setting debugging background and border styles, or guessing why your functions stop half-way through, I&#8217;d recommend getting a web development plug-in for your browser.</p>
<p>Most plug-ins will let you dig trough your DOM, debug JavaScript functions, and provide statistics about document load times.</p>
<ul>
<li><a title="Firebug - Web Development Evolved" href="http://getfirebug.com/" target="_blank">Firebug</a> &#8211; plug-in for Firefox. This is an absolutely fantastic and invaluable tool for web development.</li>
<li>Yahoo!&#8217;s <a title="YSlow for Firebug" href="http://developer.yahoo.com/yslow/" target="_blank">YSlow</a> &#8211; plug-in for the Firebug plug-in. Analyzes web pages and tells you why they&#8217;re slow.</li>
<li><a title="Internet Explorer Developer Toolbar" href="http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038&amp;displaylang=en" target="_blank">Internet Explorer Developer Toolbar</a> &#8211; plug-in for Internet Explorer. It feels like it was written in an afternoon by someone who had no idea what web development involves, but there isn&#8217;t really any alternative for IE.</li>
</ul>
<p><strong>3. Learn JavaScript</strong></p>
<p>Learning JavaScript is still a work-in-progress for me. When I started web design I assumed (please note that word &#8220;assumed&#8221;!) that JavaScript was a toy language, suitable only for pointless browser effects. Boy was I wrong!</p>
<p>JavaScript, especially with the rise of AJAX, is becoming less an optional add-on, and more and more a vital part of modern web applications. It&#8217;s an elegant language, possibly let down by poor IDE support, and used correctly, will let you jump your browser through hoops. Imaging <a title="Google Maps" href="http://maps.google.com/" target="_blank">Google Maps</a> or <a title="Yahoo! Pipes" href="http://pipes.yahoo.com/" target="_blank">Yahoo! Pipes</a> without it.</p>
<p><strong>4. Pick a JavaScript Framework, and Learn It</strong></p>
<p>Learning JavaScript is all well and good, but once you start trying to use it in anger you soon learn that each browser has a subtly different DOM API (or not so subtly different in the case of Internet Explorer).</p>
<p>You could re-invent the wheel and spend ages handling these different edge cases, or, I&#8217;d suggest, you could learn a framework and let it do all the heavy lifting.</p>
<p>Not convinced? How about this jQuery code to stripe table rows (details omitted for clarity):</p>
<pre>$(function() {
  $('.stripe tr:even').addClass('alt');
});</pre>
<p>(Yes I know in theory you should be able to do that in CSS. As always, Internet Explorer raises its middle finger to CSS theory).</p>
<p>Here&#8217;s a few links to some major frameworks:</p>
<ul>
<li><a title="jQuery: The Write Less, Do More, JavaScript Library" href="http://jquery.com/" target="_blank">jQuery</a></li>
<li><a title="MooTools - a compact javascript framework" href="http://mootools.net/" target="_blank">MooTools</a></li>
<li><a title="Prototype JavaScript framework: Easy Ajax and DOM manipulation for dynamic web applications" href="http://www.prototypejs.org/" target="_blank">Prototype</a></li>
<li><a title="The Yahoo! User Interface Library (YUI)" href="http://developer.yahoo.com/yui/" target="_blank">YUI</a></li>
<li><a title="script.aculo.us - web 2.0 javascript" href="http://script.aculo.us/" target="_blank">script.aculo.us</a></li>
</ul>
<p><strong>5. Learn Photoshop</strong></p>
<p>Ahhh, Photoshop. If you&#8217;ve only used simple paint programs before, using Photoshop is like emerging from a cave into the sunlight. (OK, that&#8217;s a bit of an exageration).</p>
<p>Traditional paint applications work on the basis that you want to change the color of pixels. Photoshop (at least for web design) works on the basis that you define regions, which are then styled. Pixels are assigned colors as a side-effect. The rules are:</p>
<ul>
<li>Layers are king;</li>
<li>Selections are queen;</li>
<li>Nothing should ever be destroyed or lost.</li>
</ul>
<p>So as a little example, if something needs a drop-shadow, you <em>don&#8217;t</em> start trying to draw one. (That would destroy or change the original thing). You simply make sure the thing is in its own layer, and apply a drop-shadow style.</p>
<p><strong>6. Use Semantic HTML &#8211; And No Cutting Corners</strong></p>
<p>Web design usually starts with graphic design, but really it should start with the content and proceed from there. If you start with the visuals, it&#8217;s all too easy to fixate on why things don&#8217;t look right, and from there it&#8217;s slippery slope to using non-semantic elements and inline styles.</p>
<p>Start with the content; use appropriate elements without regard for style; and only once you&#8217;ve done that should you move on to writing an appropriate stylesheet. (Of course, you may sometimes need to add stylistic divs&#8230; although you&#8217;d be better off using JavaScript to modify the DOM, rather than modifying the source itself).</p>
<p>A corollary of this point is that tables should only be used for tabular data &#8211; there&#8217;s no usual need to use them for layout.</p>
<p><strong>7. Find Out Why It Doesn&#8217;t Work &#8211; Don&#8217;t Shotgun-Debug</strong></p>
<p>The HTML/CSS visual model is pretty complex: inline vs block elements; different position modes; and so forth. What makes matters worse is that there&#8217;s no definitive reference HTML renderer implementation: you can never be sure whether your page doesn&#8217;t look right because you&#8217;ve made a mistake, or whether it&#8217;s some browser bug.</p>
<p>This state of affairs can lead to shotgun-debugging: tweaking a value to see if it fixes the problem; tweaking another value and checking again; and so on and so on&#8230;</p>
<p>Obviously this way of learning isn&#8217;t ideal. If you ever want to learn, I&#8217;ve found that you need to be predicting the effects of your changes. Before you make a change, you should have an idea in your head of the expected effect. If the actual effect isn&#8217;t the intended effect, you need to find out <em>why</em>. Is your understanding of HTML/CSS wrong, or is it a browser bug? Test on more browsers, and if your understanding is wrong, correct it. (Of course, if it&#8217;s a browser bug, then you&#8217;ve learnt something afterall).</p>
<p><strong>8. Test on Internet Explorer Earlier</strong></p>
<p>You might have noticed from my snide comments about Internet Explorer that it&#8217;s not exactly my favorite browser. If I&#8217;m going to be fair, IE7 isn&#8217;t too bad, and IE8 promises to actually be <em>standards compliant (gasp!)</em>. What bugs me is that (at the time of writing) about 30% of the world is still using an eight-year-old browser that doesn&#8217;t even get the basics of the HTML box model correct, and we web developers are expected to support it.</p>
<p>Anyway&#8230; I didn&#8217;t intend this paragraph to be a rant, so deep breath&#8230; and&#8230; we have to live with the situation as it is. Firefox has great standards compliance and great developer tools, so it&#8217;s tempting to use it as your primary development platform until right at the end, when you do cross-browser testing.</p>
<p>Don&#8217;t do this. I&#8217;ve learnt the hard way: you need to test your work at each stage, on all browsers. Even as recently as six months ago I was caught out by this: I spent a lot of time coding some web code that relied on z-indexing, only to discover that IE7 doesn&#8217;t support this feature fully. In the end I was able to bludgeon Internet Explorer into working properly with some JavaScript, but it wasn&#8217;t fun. Lesson learned: check each feature is going to work properly on IE before coding it completely.</p>
<p><strong>9. Don&#8217;t Be Afraid of AJAX</strong></p>
<p>Normal web-pages are pretty easy to understand. The browser makes a request; the web server sends back some HTML. AJAX is a little more difficult to understand, so I steered clear of it for two years.</p>
<p>I finally got stuck in when we started writing <a title="EasyAs123Web.com" href="http://www.easyas123web.com" target="_blank">EasyAs123Web.com</a>. I wanted the user to be able to edit the website in-place, so that forced the issue.</p>
<p>When you get down to it, AJAX is pretty simple.</p>
<ol>
<li>User does something (eg clicks) in the browser;</li>
<li>JavaScript makes request to server (in a thread);</li>
<li>Server replies with an XML document describing what to do;</li>
<li>JavaScript received the reply and modifies the DOM based on that XML.</li>
</ol>
<p>Of course, the devil is in the details, but a decent AJAX library hides most of that for you.</p>
<p><strong>10. Charge For Old Browser Support</strong></p>
<p>Asking a client if they need Internet Explorer 6 (or earlier) support is a recipe for extra work. They&#8217;re hardly going to say no when you phrase it like that. You then sit down and make a working website, and test it in IE6. Argh! Scrambled website! Eventually, you get it working, and you find that you&#8217;ve spent twice as long on the actual HTML/CSS as you planned to. Bad times.</p>
<p>Here&#8217;s my suggestion: treat older browser support the same as any other feature: as a chargeable item. Explain to the client that since older browsers work in a different way to modern ones (which they do), that&#8217;s extra work and hence extra cost. (I&#8217;d suggest approximately 10% on top). Explain that IE6 has approximately 25-30% market share, and let them make the cost/benefit call. Money has an amazing focusing effect: it forces people to really think about what they want and need.</p>
<p><strong>Your Thoughts?</strong></p>
<p>Got your own web development tips? Feel free to share them below!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackification.com/2008/11/06/ten-web-development-tips-i-wish-id-known-two-years-ago/feed/</wfw:commentRss>
		<slash:comments>99</slash:comments>
		</item>
		<item>
		<title>Cargo Cult Coding and Abject-Oriented Programming</title>
		<link>http://www.hackification.com/2008/07/17/cargo-cult-coding-and-abject-oriented-programming/</link>
		<comments>http://www.hackification.com/2008/07/17/cargo-cult-coding-and-abject-oriented-programming/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 19:34:03 +0000</pubDate>
		<dc:creator>Stu Smith</dc:creator>
				<category><![CDATA[Links]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[abject]]></category>
		<category><![CDATA[cargo cult]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.hackification.com/?p=12</guid>
		<description><![CDATA[I stumbled across a really nice article the other day: Introduction to Abject-Oriented Programming Judging by the comments posted, only about 50% of people even realize it&#8217;s a joke &#8211; it&#8217;s worth reading through them for a second laugh. Some notable quotes: &#8220;Programs that use inheritance are characterized by similar blocks of code with small [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.hackification.com/wp-content/uploads/2008/07/dumb.jpg"><img class="size-full wp-image-14 alignleft" style="margin-left: 5px; margin-right: 5px; float: left;" title="I see dumb people" src="http://www.hackification.com/wp-content/uploads/2008/07/dumb.jpg" alt="" width="160" height="138" /></a>I stumbled across a really nice article the other day:</p>
<blockquote><p><a href="http://typicalprogrammer.com/?p=8" target="_blank">Introduction to Abject-Oriented Programming</a></p></blockquote>
<p>Judging by the comments posted, only about 50% of people even realize it&#8217;s a joke &#8211; it&#8217;s worth reading through them for a second laugh.</p>
<p>Some notable quotes:</p>
<blockquote><p>&#8220;Programs that use inheritance are characterized by similar blocks of code with small differences appearing throughout the source.&#8221;</p>
<p>&#8220;Abject-oriented programming lends itself to using plug-in components — bits of code found in books or on the Internet.&#8221;</p>
<p>&#8220;A virtual class or function is code that the application will eventually need, but it isn’t written yet.&#8221;</p></blockquote>
<p><a href="http://www.hackification.com/wp-content/uploads/2008/07/cargo_cult_2.jpg"><img class="size-full wp-image-13 alignright" style="margin-left: 5px; margin-right: 5px; float: right;" title="Cargo Cult Plane" src="http://www.hackification.com/wp-content/uploads/2008/07/cargo_cult_2.jpg" alt="" width="200" height="155" /></a>Which brings me onto <strong>cargo-cult programming</strong>. If you haven&#8217;t heard that term before, it usually refers to pacific islands, visited during the second war by much more technologically-advanced societies (e.g., the US), generally to establish military bases. Of course, after the war, the ships of the more advanced civilization stopped visiting the islands. A cargo-cult religion, not understanding the wider picture, tries to bring back the visitors by the use of rituals and making replicas of the technologial artifacts the covet. (More info on <a href="http://en.wikipedia.org/wiki/Cargo_cult" target="_blank">Wikipedia</a>).</p>
<p>Anyway. Enough sounding like a lecturer. Cargo-cult programming is a similar sort of thing, where the &#8220;programmer&#8221; wants to achieve a particular effect, but can&#8217;t or won&#8217;t work out the details for themselves. Unfortunately the rise of the search-engine has exacerbated this problem &#8211; it&#8217;s just too easy to type in a few keywords, find a snippet of code, and paste it into the project you&#8217;re working on.</p>
<p>It&#8217;s an easy trap to fall into &#8211; as an example, my JavaScript skills are pretty weak at the moment, but the project I&#8217;m working on at the moment needs a fair amount off client-side coding. It&#8217;s so tempting just to paste in functions that seem to work. Given that I&#8217;ve been using JavaScript for less than a couple of months, learning it (and the DOM) sometimes feels like an insurmountable hill.</p>
<p>In the end of course, if you want to be able to call yourself a programmer, you have to understand what you&#8217;re doing, even if that means the project takes longer. It pays dividends in the end of course, but it takes discipline and an amount of short-term pain.</p>
<p>If you&#8217;re still pasting in code and not understanding it, well, you&#8217;re not a programmer in my book.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackification.com/2008/07/17/cargo-cult-coding-and-abject-oriented-programming/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
