<?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>rwec.co.uk &#187; coding</title>
	<atom:link href="http://rwec.co.uk/blog/tag/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://rwec.co.uk/blog</link>
	<description>Rowan&#039;s World, Et Cetera</description>
	<lastBuildDate>Wed, 25 Apr 2012 08:36:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Top 10 Things Not To Do with Links</title>
		<link>http://rwec.co.uk/blog/2011/06/top-10-bad-web-links/</link>
		<comments>http://rwec.co.uk/blog/2011/06/top-10-bad-web-links/#comments</comments>
		<pubDate>Sun, 12 Jun 2011 19:06:02 +0000</pubDate>
		<dc:creator>Rowan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[hyperlinks]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[pet hates]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[satire]]></category>
		<category><![CDATA[top 10]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://rwec.co.uk/blog/?p=185</guid>
		<description><![CDATA["Hyperlinks" are probably the single most important thing on the World Wide Web. They are, affter all, what the "web" is woven from; they are what makes it something more than the document retrieval systems that came before.

And yet, some people seem to do their utmost to make all the hyperlinks in their documents entirely useless. Here are my Top 10 Things Not To Do with Links...]]></description>
			<content:encoded><![CDATA[<p>"Hyperlinks" are probably the single most important thing on the World Wide Web. They are, affter all, what the "web" is woven from; they are what makes it something more than the document retrieval systems that came before.</p>
<p>And yet, some people seem to do their utmost to make all the hyperlinks in their documents entirely useless. Here are my Top 10 Things Not To Do with Links...<br />
<span id="more-185"></span></p>
<div id="bad_link_demo">
<ol>
<li>Don't have any. Refer to other websites by name, mention other blog posts, but leave your article entirely unlinked to the outside world, as though you've scanned it in from a typewriter.</li>
<li>Don't include any links or footnote markers in the main text, but at the end of the page have a long "useful links" section, sorted alphabetically by URL.</li>
<li>Only ever link to homepages of other sites, never the article you're talking about. It's also important not to mention the exact title of the article, or your readers would be able to find it too easily.</li>
<li class="invisible_links">Make your links <a href="http://www.thisamericanlife.org/radio-archives/episode/178/Superpowers">invisible</a> until hovered over, so that your article becomes a <a href="http://www.kingdomofloathing.com/">point-and-click adventure</a> where readers have to guess where links <em>might</em> be.</li>
<li class="fading_links">When hovered over, make your links <a href="http://www.flickr.com/photos/debbcollins/5021251012/">fade into the background</a>, to test your readers memory skills.</li>
<li>Automatically link random <a href="http://rwec.co.uk/blog/tag/language">words</a> in the middle of unrelated sentences <a href="http://rwec.co.uk/q/wherefore">because</a> it's good for <abbr title="Search Engine Optimisation">SEO</abbr>. Make these look identical to <a href="http://www.positioniseverything.net/explorer.html">genuinely useful links</a> so that readers learn to ignore all inline links on your site (see point 1).</li>
<li>Use advertising software that automatically <a class="irritating_advert" href="http://www.youtube.com/watch?v=5pidokakU4I">picks<span class="dodgy_popup_content"><img src="http://rwec.co.uk/media/blog/link-thumbs/picks.png" alt="" /></span></a> keywords out of your text to <a class="irritating_advert" href="http://www.travisperkins.co.uk/">turn<span class="dodgy_popup_content"><img src="http://rwec.co.uk/media/blog/link-thumbs/turn.jpeg" alt="" /></span></a> into fake links which pop up an advert on top of the whole page when hovered over.</li>
<li class="link_thumbs">Install code that pops up a "preview" of any link the reader hovers over. This should preferably be easy to activate <span class="dodgy_popup_trigger">by mistake, <a href="http://tlipsum.appspot.com/">incredibly slow to load</a><span class="dodgy_popup_loading"><img title="P L E A S E    W A I T" src="http://rwec.co.uk/media/blog/link-thumbs/loading.gif" alt="P L E A S E    W A I T" /></span><span class="dodgy_popup_content"><img src="http://rwec.co.uk/media/blog/link-thumbs/essay.png" alt="Sorry, what's alt text for? I'm told I have to have some!" /></span>, and too</span> small to be in any way useful.</li>
<li>In a sentence which refers to a particular article, put the link not around the article reference, but around other parts of the sentence, crossing between <a href="http://specgram.com/">clauses so that the link</a> text makes no grammatical sense.</li>
<li><a class="external text" rel="nofollow" href="http://en.wikipedia.org/w/wiki.phtml?title=Hyperlink&amp;oldid=8089525">Link</a> <a class="mw-redirect" title="Every" href="http://en.wikipedia.org//wiki/Every">every</a> <a title="Word" href="http://en.wikipedia.org/wiki/Word">word</a> <a class="mw-redirect" title="In" href="http://en.wikipedia.org/wiki/In">in</a> <a class="mw-redirect" title="The" href="http://en.wikipedia.org/wiki/The">the</a> <a title="Text" href="http://en.wikipedia.org/wiki/Text">text</a> <a class="mw-redirect" title="To" href="http://en.wikipedia.org/wiki/To">to</a> <a title="A" href="http://en.wikipedia.org/wiki/A">a</a> <a title="Different" href="http://en.wikipedia.org/wiki/Different">different</a> <a title="Page" href="http://en.wikipedia.org/wiki/Page">page</a>, <a class="mw-redirect" title="Making" href="http://en.wikipedia.org/wiki/Making">making</a> <a title="Sentences" href="http://en.wikipedia.org/wiki/Sentences">sentences</a> <a class="mw-redirect" title="Unreadable" href="http://en.wikipedia.org/wiki/Unreadable">unreadable</a>.</li>
</ol>
</div>
<p><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script> </p>
<p><script type="text/javascript">
jQuery(function(){
	jQuery('#bad_link_demo a.irritating_advert')
		.bind('mouseenter', function() {
			jQuery(this).find('.dodgy_popup_content').show();
		} )
		.bind('mouseleave', function() {
			jQuery(this).find('.dodgy_popup_content').hide();
		} );
	var dodgy_timeout;
	jQuery('#bad_link_demo .dodgy_popup_trigger')
		.bind('mouseenter', function() {
			jQuery(this).find('.dodgy_popup_loading').show();
			var $this = jQuery(this);
			dodgy_timeout = setTimeout( function()
			{
				$this.find('.dodgy_popup_loading').hide();
				$this.find('.dodgy_popup_content').show();
			}, Math.floor(Math.random()*25000) + 5000 );
		} )
		.bind('mouseleave', function() {
			clearTimeout(dodgy_timeout);
			$(this).find('.dodgy_popup_loading').hide();
			$(this).find('.dodgy_popup_content').hide();
		} );
});</script></p>
]]></content:encoded>
			<wfw:commentRss>http://rwec.co.uk/blog/2011/06/top-10-bad-web-links/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Case for a better Switch</title>
		<link>http://rwec.co.uk/blog/2009/08/the-case-for-a-better-switch/</link>
		<comments>http://rwec.co.uk/blog/2009/08/the-case-for-a-better-switch/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 17:29:34 +0000</pubDate>
		<dc:creator>Rowan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming languages]]></category>
		<category><![CDATA[switch]]></category>

		<guid isPermaLink="false">http://rwec.co.uk/blog/?p=26</guid>
		<description><![CDATA[The C-style switch-case construct - used in various programming languages, including PHP - is a curious beast. Most commonly used as a streamlined form of if-elseif-else, it actually has more in common with the oldest of control statements, the goto, since control jumps to the first match and carries on until you tell it to [...]]]></description>
			<content:encoded><![CDATA[<p>The C-style <code>switch-case</code> construct - used in various programming languages, including PHP - is a curious beast. Most commonly used as a streamlined form of <code>if-elseif-else</code>, it actually has more in common with the oldest of control statements, the <code>goto</code>, since control jumps to the first match <em>and carries on until you tell it to stop</em>.</p>
<p>Firstly, am I the only person in the world who thinks that the <code>break</code> should be indented to the same level as the <code>case</code>, not the level of the commands between? If you <strong>are</strong> using it as a series of separate <code>elseif</code> blocks, then surely the two form a matching pair, with the code block "enclosed" within them. Of course, you can generally <code>break</code> early inside the code, just like you can <code>return</code> early from a function, which is hard to make stand out - but that's just an argument not to do it too often!</p>
<p>And, of course, the fact that another <code>case</code> comes along <strong>does not</strong> mean that the code won't carry on. Which brings me neatly to my next thought: is there any language that insists you declare when you're falling through to the next case - and if not, why not? What if every time you put a <code>case</code>, you had to end it with either a <code>break</code> or a <code>continue</code>? It seems to me it would prevent a lot of bugs caused by cases <em>inadvertently</em> falling through and running completely the wrong code. And if overloading an existing term like <code>continue</code> is too confusing, lets just have a <code>fallthrough</code> - anyone got a case against? [No pun intended; probably...]</p>
]]></content:encoded>
			<wfw:commentRss>http://rwec.co.uk/blog/2009/08/the-case-for-a-better-switch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

