<?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>domi.co.uk - technology, music, photography, news &#187; interweb</title>
	<atom:link href="http://domi.co.uk/category/tech/interweb/feed/" rel="self" type="application/rss+xml" />
	<link>http://domi.co.uk</link>
	<description></description>
	<lastBuildDate>Sun, 18 Oct 2009 20:19:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IE6 CSS &#8211; let them eat cake?</title>
		<link>http://domi.co.uk/2009/05/22/ie6-css-let-them-eat-cake/</link>
		<comments>http://domi.co.uk/2009/05/22/ie6-css-let-them-eat-cake/#comments</comments>
		<pubDate>Fri, 22 May 2009 18:08:31 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://domi.co.uk/?p=386</guid>
		<description><![CDATA[An interesting idea is presented on &#8220;for a beautiful web&#8221; regarding how best to deal with IE6 and its many failings. Universal Internet Explorer 6 CSS proposes that IE6 always gets sent a standard look and feel, so that the experience for its users is not bad &#8211; just not the full shebang. It&#8217;s clear [...]]]></description>
			<content:encoded><![CDATA[<p>An interesting idea is presented on &#8220;for a beautiful web&#8221; regarding how best to deal with IE6 and its many failings. <a href="http://forabeautifulweb.com/blog/about/universal_internet_explorer_6_css/">Universal Internet Explorer 6 CSS</a> proposes that IE6 always gets sent a standard look and feel, so that the experience for its users is not bad &#8211; just not the full shebang. It&#8217;s clear it has been designed, rather than sending plain CSS-less HTML, but it&#8217;s very sparse.</p>

<p>Personally, I like the idea. I have done something similar on more than one occasion. I haven&#8217;t taken it to the same level, possibly, but I&#8217;ve treated IE6 in a similar way to how I treat screen readers for example: make sure all the content is available, and is usable. What follows are a couple of screen shots of redamc.com, first from Safari 4, then from IE6. (The Safari 4 shot is representative of all modern browsers, though.) The design basically revolves around having all the content on one page, in nicely scrollable boxes. In IE6, this was not well supported, and the decision was taken to make the layout more &#8220;blog-like&#8221;. All the content is the same, however.</p>

<p>First, Safari 4:</p>

<p><a href="http://domi.co.uk/wp-content/uploads/2009/05/safari4screenshot.jpg"><img src="http://domi.co.uk/wp-content/uploads/2009/05/safari4screenshot.jpg" alt="safari4screenshot.jpg"/></a></p>

<p>And IE6:</p>

<p><a href="http://domi.co.uk/wp-content/uploads/2009/05/ie6screenshot.jpg"><img src="http://domi.co.uk/wp-content/uploads/2009/05/ie6screenshot.jpg" alt="ie6screenshot.jpg"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2009/05/22/ie6-css-let-them-eat-cake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protected: Development Standards: HTML</title>
		<link>http://domi.co.uk/2009/04/15/development-standards-html/</link>
		<comments>http://domi.co.uk/2009/04/15/development-standards-html/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 13:59:50 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://domi.co.uk/?p=354</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://domi.co.uk/wp-pass.php" method="post">
    <p>This post is password protected. To view it please enter your password below:</p>
    <p><label for="pwbox-354">Password: <input name="post_password" id="pwbox-354" type="password" size="20" /></label> <input type="submit" name="Submit" value="Submit" /></p>
    </form>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2009/04/15/development-standards-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Development Standards: PHP</title>
		<link>http://domi.co.uk/2009/04/15/development-standards-php/</link>
		<comments>http://domi.co.uk/2009/04/15/development-standards-php/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 23:23:41 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://domi.co.uk/?p=327</guid>
		<description><![CDATA[We might as well start this series off at the bottom and work our way up. So, let&#8217;s start with PHP &#8211; it&#8217;s not the base of our stack, but it&#8217;s the first element that heavily requires some coding standards in place.

As I said in the intro, this series will be about how I do [...]]]></description>
			<content:encoded><![CDATA[<p>We might as well start this series off at the bottom and work our way up. So, let&#8217;s start with PHP &#8211; it&#8217;s not the base of our stack, but it&#8217;s the first element that heavily requires some coding standards in place.</p>

<p>As I said in the intro, this series will be about how <em>I</em> do things, although of course it&#8217;s all heavily based on what I&#8217;ve seen and used elsewhere, and what I&#8217;ve known to work. Given this, I&#8217;ll also talk about the toolkits and frameworks I use: Code Igniter on the server side and jQuery on the client side. I also use YUI Reset and Fonts at the top of most or all CSS.</p>

<p>Although it&#8217;s just as important I won&#8217;t talk about sticking to some semblance of good MVC practice when using Code Igniter. There&#8217;s plenty of that out there.</p>

<h3>Why have development standards?</h3>

<p>Possibly the main reason is that one person working on the code can understand what another has done. If I look at anyone else&#8217;s code and it&#8217;s formatted in a way that obfuscates its meaning, I&#8217;m possibly going to miss something key.</p>

<p>Looking forward, if something isn&#8217;t correctly formatted, fixing a bug is going to be that much easier if it&#8217;s easily readable. This applies whether it was written by a different person or not.</p>

<h3>PHP tags</h3>

<p>In view files, the short opening tag <code>&lt;?</code> as opposed to <code>&lt;?php</code> is encouraged, as is its logical next step <code>&lt;?=$var?&gt;</code>. Reducing clutter in view files, where front-end developers or even designers may work, is worthwhile.</p>

<h3>Indentation</h3>

<p>All code &#8211; HTML, CSS, Javascript, PHP &#8211; should be indented correctly. All indents should be 1 single tab. I prefer to view that in my editor &#8211; whether it&#8217;s TextMate or Vim &#8211; as four columns. How you view it in your editor is a personal preference, as long as the file itself uses 1 tab.</p>

<h3>Line endings</h3>

<p>All line endings should be a single <code>\n</code> &#8211; i.e. Unix-style. In addition, add no trailing spaces to lines, and remove any that sneak in due to slack editing.</p>

<h3>Control Structures</h3>

<p>Including <code>if</code>, <code>for</code>, <code>while</code>, <code>switch</code>, etc:</p>

<p><strong>INCORRECT</strong> <em>in various ways</em></p>

<pre><code>if(condition1){
    //action1
}
elseif(condition2){
    //action2
}else{
    //action3
}
</code></pre>

<p><strong>CORRECT</strong></p>

<pre><code>if (condition1) {
    //action1
} elseif (condition2) {
    //action2
} else {
    //action3
}
</code></pre>

<h4>Another example:</h4>

<pre><code>for ($i = 0; $i &lt; 10; $i++) {
    ...
}
</code></pre>

<p>Control statements should have <em>one space</em> between the control keyword and opening parenthesis, to distinguish them from function calls.</p>

<p>You are strongly encouraged to always use curly braces even in situations where they are technically optional. Having them increases readability and decreases the likelihood of logic errors being introduced when new lines are added.</p>

<h4>A switch block:</h4>

<pre><code>switch (condition) {
    case 'one':
    action1;
    break;

    case 'two':
    action2;
    break;

    default:
    action3;
    break;
}
</code></pre>

<h3>Function Calls</h3>

<p>Functions should be called with no spaces between the function name, the opening parenthesis, and the first parameter; spaces between commas and each parameter, and no space between the last parameter, the closing parenthesis, and the semicolon. Here&#8217;s an example:</p>

<p><strong>INCORRECT</strong></p>

<pre><code>$var=foo($bar,$baz,$quux);
</code></pre>

<p><strong>CORRECT</strong></p>

<pre><code>$var = foo($bar, $baz, $quux);
</code></pre>

<p>As displayed above, there should be <em>one space</em> on either side of an equals sign used to assign the return value of a function to a variable.</p>

<h3>Function Declarations</h3>

<p>We usually try to put the arguments with default values at the end of the list:</p>

<pre><code>function fooBar($var1, $var2 = '') {
    if (condition) {
        statement;
    }
    return $value;
}
</code></pre>

<h3>Arrays</h3>

<p>Always use spaces:</p>

<pre><code>$array = array('val1', 'val2', 'val3');
</code></pre>

<p>If the array is even remotely large, break it into separate lines:</p>

<pre><code>$array = array(
    'key1' =&gt; 123,
    'key2' =&gt; 'foo',
    'key3' =&gt; getValue('bar'),
);
</code></pre>

<p>Notice the extra comma after the last element &#8211; this means we can rearrange the elements or add a new element with worrying about commas between elements. (This only works with PHP.)</p>

<h3>Comments</h3>

<p>Single line comments go like this:</p>

<pre><code>// Check the value of foo.
$bar = isset($foo) ? $foo : '';
</code></pre>

<p>Multi-line, &#8220;C-style&#8221; comments:</p>

<pre><code>/*
Check the value of foo.
This is to prevent errors.
*/
$bar = isset($foo) ? $foo : '';
</code></pre>

<p>Notice that the comment characters are on their own lines.</p>

<h3>Includes</h3>

<p>For unconditional inclusion, use <code>require_once 'includefile.php';</code></p>

<p>For conditional inclusion, use <code>include_once 'includefile.php';</code></p>

<p><em>Note: <code>require_once</code> and <code>include_once</code> are statements (or language constructs) <strong>not</strong> functions, so no parenthesis is required, or desired.</em></p>

<h3>Metadata</h3>

<p>Every applicable file should use an Id keyword:</p>

<pre><code>&lt;?php
// $Id$
</code></pre>

<p>which gets expanded by Subversion to</p>

<pre><code>&lt;?php
// $Id: codingstandards 758 2008-05-15 01:35:58Z dom $
</code></pre>

<h3>Naming conventions</h3>

<h4>Functions and Methods</h4>

<p>All names should start lowercase and use <a href="http://en.wikipedia.org/wiki/CamelCase">interCaps/camelCase</a></p>

<pre><code>function getFooBar() {
    ...
}
</code></pre>

<p>No underscores in the middle of function names, please:</p>

<p><strong>INCORRECT</strong></p>

<pre><code>function get_foo_bar() {
    ...
}
</code></pre>

<p>Private methods should start with an underscore:</p>

<pre><code>function _getFooBar() {
    ...
}
</code></pre>

<h4>Classes</h4>

<p>Classes follow the same method as methods ;) except start with uppercase.</p>

<pre><code>class FooBar {
    function FooBar() {
        ...
    }
}
</code></pre>

<h4>Constants</h4>

<p>Constants should be all UPPERCASE, except internally-provided ones like <code>true</code>, <code>false</code>, <code>null</code>;</p>

<h3>File Format</h3>

<p><strong>All</strong> files should be unix format &#8211; I <em>do not</em> want to see any \r\n&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2009/04/15/development-standards-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Development Standards: Intro</title>
		<link>http://domi.co.uk/2009/04/14/development-standards-intro/</link>
		<comments>http://domi.co.uk/2009/04/14/development-standards-intro/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 22:18:33 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://domi.co.uk/?p=325</guid>
		<description><![CDATA[I&#8217;ve decided to write an occasional series of articles on coding and development standards. It will be how I see them &#8211; the standards I myself follow &#8211; so it might not be for everyone. What it will be is a guide to what to expect if I&#8217;m working for you, and what to expect [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve decided to write an occasional series of articles on coding and development standards. It will be how <em>I</em> see them &#8211; the standards <em>I</em> myself follow &#8211; so it might not be for everyone. What it will be is a guide to what to expect if I&#8217;m working for you, and what to expect if you&#8217;re working for me.</p>

<p>I&#8217;ll write separate pieces for CSS, HTML, PHP and possibly for server administration-type stuff too &#8211; Apache configuration, and so on.</p>

<p>Expect the first instalment in the near future&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2009/04/14/development-standards-intro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Screencast as development tool</title>
		<link>http://domi.co.uk/2009/02/26/screencast-as-development-tool/</link>
		<comments>http://domi.co.uk/2009/02/26/screencast-as-development-tool/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 16:39:18 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://domi.co.uk/?p=315</guid>
		<description><![CDATA[I&#8217;m in the middle of the first phase of building a new webapp and like most web developers (I would bet) when I show someone what I&#8217;ve done, it&#8217;s not apparent what marvels of engineering I&#8217;ve pulled off! So, in order to actually give a quick run-down of where we&#8217;re at with the application, I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the middle of the first phase of building a new webapp and like most web developers (I would bet) when I show someone what I&#8217;ve done, it&#8217;s not apparent what marvels of engineering I&#8217;ve pulled off! So, in order to actually give a quick run-down of where we&#8217;re at with the application, I thought about making a screencast of the login, profile creation, module, video upl&#8211; well, I&#8217;ve said too much already ;)</p>

<p>After thinking about that for a bit, I wondered if any methodologies, agile or otherwise, use screencasts specifically as a tool. I could <a href="http://www.justfuckinggoogleit.com/">just Google it</a>, I know. In any case I think it&#8217;s a nice way of showing progress on the development &#8211; or bugs in the app.</p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2009/02/26/screencast-as-development-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Webshop launched</title>
		<link>http://domi.co.uk/2009/01/22/webshop-launched/</link>
		<comments>http://domi.co.uk/2009/01/22/webshop-launched/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 21:10:37 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[interweb]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[sport]]></category>
		<category><![CDATA[web biz]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://domi.co.uk/?p=291</guid>
		<description><![CDATA[As the first example of my Tienda.co.uk project, we&#8217;ve just launched slant1996.com which sells slightly mad t-shirt designs!
]]></description>
			<content:encoded><![CDATA[<p>As the first example of my <a href="http://tienda.co.uk/">Tienda.co.uk</a> project, we&#8217;ve just launched <a href="http://www.slant1996.com">slant1996.com</a> which sells slightly mad t-shirt designs!</p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2009/01/22/webshop-launched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nunoya: Japanese clothing in Barcelona</title>
		<link>http://domi.co.uk/2008/11/29/nunoya-japanese-clothing-in-barcelona/</link>
		<comments>http://domi.co.uk/2008/11/29/nunoya-japanese-clothing-in-barcelona/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 09:53:34 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[Barcelona]]></category>
		<category><![CDATA[misc]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[web biz]]></category>

		<guid isPermaLink="false">http://domi.co.uk/2008/11/29/nunoya-japanese-clothing-in-barcelona/</guid>
		<description><![CDATA[

I recently helped out updating a friend&#8217;s online shop: Nunoya in Barcelona. As well as the obvious stock of kimono and other clothing items, they have some cool accessories. But my favourites are the Kokeshi, which I don&#8217;t remember having seen before &#8211; slightly mad (in a good way) dolls that look a bit like [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nunoya.com/"><img class="insert" src="http://www.nunoya.com/images/medium/Kokeshi_Moe_MED.jpg" alt=""/></a></p>

<p>I recently helped out updating a friend&#8217;s online shop: <a href="http://www.nunoya.com/">Nunoya</a> in Barcelona. As well as the obvious stock of kimono and other clothing items, they have some cool accessories. But my favourites are the Kokeshi, which I don&#8217;t remember having seen before &#8211; slightly mad (in a good way) dolls that look a bit like Russian dolls, but Japanese. And they don&#8217;t contain smaller versions of themselves, so actually, they&#8217;re nothing like Russian dolls!</p>

<p>[update: forgot to mention I did some photos of <a href="http://www.nunoya.com/index.php?main_page=indexcPath=68">Sofia in kimonos</a> for the site...]</p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2008/11/29/nunoya-japanese-clothing-in-barcelona/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ACCEPT LANGUAGE, DAMMIT!</title>
		<link>http://domi.co.uk/2008/11/24/accept-language-dammit/</link>
		<comments>http://domi.co.uk/2008/11/24/accept-language-dammit/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 16:30:54 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[interweb]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://domi.co.uk/2008/11/24/accept-language-dammit/</guid>
		<description><![CDATA[This is probably an oldie-but-goodie to a lot of web devs, but as search indexing bots don&#8217;t always send HTTP_ACCEPT_LANGUAGE to the server with the request, it will cause an error if you depend on its presence, which can and will be reflected in the search results, even though not in &#8220;any&#8221; browser.
]]></description>
			<content:encoded><![CDATA[<p>This is probably an oldie-but-goodie to a lot of web devs, but as search indexing bots don&#8217;t always send <code>HTTP_ACCEPT_LANGUAGE</code> to the server with the request, it will cause an error if you depend on its presence, which can and will be reflected in the search results, even though not in &#8220;any&#8221; browser.</p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2008/11/24/accept-language-dammit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oh! The humanity!</title>
		<link>http://domi.co.uk/2008/08/29/oh-the-humanity/</link>
		<comments>http://domi.co.uk/2008/08/29/oh-the-humanity/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 22:41:24 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[interweb]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://domi.co.uk/2008/08/29/oh-the-humanity/</guid>
		<description><![CDATA[Lovely redesign of jquery.com.
]]></description>
			<content:encoded><![CDATA[<p>Lovely redesign of <a href="http://jquery.com/">jquery.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2008/08/29/oh-the-humanity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tracking my time</title>
		<link>http://domi.co.uk/2008/04/03/tracking-my-time/</link>
		<comments>http://domi.co.uk/2008/04/03/tracking-my-time/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 13:29:13 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[web biz]]></category>

		<guid isPermaLink="false">http://domi.co.uk/2008/04/03/tracking-my-time/</guid>
		<description><![CDATA[
Photo by Csaba_Bajko

I&#8217;m not too bad with timetracking these days. I use Billable for invoicing and as long as I keep a vague eye on the time, and add the hours into Billable as they&#8217;re spent it&#8217;s not too much of a bind.

Recently, though, I&#8217;ve started using a solution that seems obvious, but I&#8217;ve never [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://domi.co.uk/wp-content/uploads/2008/04/e1a07ede-f3eb-464b-b2ec-6361acb8b43d.jpg" alt="by Csaba_Bajko" /><br />
<em><small>Photo by <a href="http://www.flickr.com/photos/csaba_bajko/">Csaba_Bajko</a></small></em></p>

<p>I&#8217;m not too bad with timetracking these days. I use <a href="http://clickablebliss.com/billable">Billable</a> for invoicing and as long as I keep a vague eye on the time, and add the hours into Billable as they&#8217;re spent it&#8217;s not too much of a bind.</p>

<p>Recently, though, I&#8217;ve started using a solution that seems obvious, but I&#8217;ve never heard of it used (I haven&#8217;t Googled it, either, so I can very easily be proved wrong!) I&#8217;ve set up a screengrabbing utility to take a shot every 10 minutes, then if I have any doubts about what time I started on something &#8211; or more usually, until what time in the middle of the night I worked until &#8211; I can have a quick look back at the screengrabs and it&#8217;s all there.</p>

<p>The side benefit is that while I&#8217;m looking at the screengrabs as thumbs I can see the ratio of Google Reader to TextMate (for example) is quite obviously not balanced how it should be ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2008/04/03/tracking-my-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
