<?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>The Devign Path&#187; Development</title>
	<atom:link href="http://thedevignpath.com/archives/category/development/feed" rel="self" type="application/rss+xml" />
	<link>http://thedevignpath.com</link>
	<description>design + development = devign</description>
	<lastBuildDate>Sat, 21 Jan 2012 14:29:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Test Driving TDD</title>
		<link>http://thedevignpath.com/archives/169</link>
		<comments>http://thedevignpath.com/archives/169#comments</comments>
		<pubDate>Wed, 27 Jul 2011 22:30:25 +0000</pubDate>
		<dc:creator>iampeterbanjo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[test driven]]></category>

		<guid isPermaLink="false">http://thedevignpath.com/archives/169</guid>
		<description><![CDATA[I have become inspired and convinced by the idea of test driven development. Kent Beck said it best when he said - We write code because that is our work and we write tests so that we know when we (&#8230;)</p><p><a href="http://thedevignpath.com/archives/169">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I have become inspired and convinced by the idea of test driven development. Kent Beck said it best when he said -</p>
<blockquote><p>We write code because that is our work and we write tests so that we know when we are done. </p>
<p>- Beck, K.&#160; <a href="http://www.amazon.co.uk/gp/product/0321278658/ref=as_li_ss_tl?ie=UTF8&amp;tag=thedevpat-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0321278658">Extreme Programming Explained: Embrace Change</a><img style="border-bottom-style: none !important; margin: 0px; border-left-style: none !important; border-top-style: none !important; border-right-style: none !important" border="0" alt="" src="http://www.assoc-amazon.co.uk/e/ir?t=&amp;l=as2&amp;o=2&amp;a=0321278658" width="1" height="1" /> </p>
</blockquote>
<p>Or something like that. </p>
<p>So I have started kicking the tires on the metaphorical test driven development car. I started reading this book on <a href="http://www.amazon.co.uk/gp/product/0321683919/ref=as_li_ss_tl?ie=UTF8&amp;tag=thedevpat-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0321683919">Test Driven JavaScript Development (Developer&#8217;s Library)</a>. You can read the first few chapters for free on <a href="http://goo.gl/GUlVP">Safari books online</a>. I think I’m going to get a subscription to Safari books for a while since it might be cheaper for me given my reading habits. I digress.</p>
<p>So I was sitting at my desk and I had to do some AJAX thingy with a form and an email address as the input for a client’s website. It looked pretty straight forward. But how do I give some email validation feedback to the user? I am thinking a regex expression would be nice. But I am not a regex ninja so I might need a few goes at this and how do I know if it works? The last thing I want is to prevent the user from entering valid email addresses – false positives are better than false negatives. Aha! How about I write some tests? </p>
<p>It took me a while and I had a lot of help from <a href="http://http://fightingforalostcause.net/misc/2006/compare-email-regex.php">this guy’s blog</a> but I came up with a regular expression that passed enough test cases for me to feel satisfied with it. Simply run it in your browser’s developer’s console to see it go.</p>
<p>&#160;</p>
<p> <script src="https://gist.github.com/1110460.js"> </script></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fthedevignpath.com%2Farchives%2F169&amp;title=Test%20Driving%20TDD"><img src="http://thedevignpath.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thedevignpath.com/archives/169/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wrangling with SQL regular expressions</title>
		<link>http://thedevignpath.com/archives/124</link>
		<comments>http://thedevignpath.com/archives/124#comments</comments>
		<pubDate>Wed, 02 Mar 2011 20:30:51 +0000</pubDate>
		<dc:creator>iampeterbanjo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://thedevignpath.com/?p=124</guid>
		<description><![CDATA[I have been doing some data wrangling recently. One problem I worked through was how to find all the instances of a new line character that had made it&#8217;s way into our database. After some researching the query looked like (&#8230;)</p><p><a href="http://thedevignpath.com/archives/124">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I have been doing some data wrangling recently. One problem I worked through was how to find all the instances of a new line character that had made it&#8217;s way into our database.</p>
<p>After some researching the query looked like this</p>
<p><script src="https://gist.github.com/851667.js?file=find-new-line-character.sql"></script></p>
<p>
Then I asked myself if I could strip out this character. Hmm.. So I came up with this &#8211;
</p>
<p><script src="https://gist.github.com/851678.js?file=strip-new-line-character.sql"></script> </p>
<p>I would have liked to use this in an update statement but I couldn&#8217;t crack that last piece of the puzzle. Can you?</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fthedevignpath.com%2Farchives%2F124&amp;title=Wrangling%20with%20SQL%20regular%20expressions"><img src="http://thedevignpath.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thedevignpath.com/archives/124/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AJAX cross-domain request using iframes</title>
		<link>http://thedevignpath.com/archives/118</link>
		<comments>http://thedevignpath.com/archives/118#comments</comments>
		<pubDate>Sun, 27 Feb 2011 23:06:13 +0000</pubDate>
		<dc:creator>iampeterbanjo</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://thedevignpath.com/?p=118</guid>
		<description><![CDATA[I had a situation where I had to send a form to a 3rd party email subscription management thingy. But every time I posted the form using jQuery the browser was killing it because of cross-domain restrictions. I asked around (&#8230;)</p><p><a href="http://thedevignpath.com/archives/118">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I had a situation where I had to send a form to a 3rd party email subscription management thingy. But every time I posted the form using jQuery the browser was killing it because of cross-domain restrictions. I asked around the web dev team and came up with this solution. Simply create a URL fragment from the form inputs, and use it as the source of an iframe. Of course, as long as you don&#8217;t care what happens to the data this is fine &#8211; it&#8217;s basically best-effort.</p>
<p>Caveats are that if the domain the client is on is HTTPS the URL fragment also has to be HTTPS but if the destination server doesn’t have a valid SSL certificate the submission fails. It fails silently in Chrome, Firefox and IE7. Sometimes it triggers a message in IE8 but it definitely triggers a security pop-up in IE6 (of course).</p>
<p>I found that Google chrome is the best browser for developing this because it actually tells you what is going on in the console and in the iframe – the rest just act like nothing happened.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fthedevignpath.com%2Farchives%2F118&amp;title=AJAX%20cross-domain%20request%20using%20iframes"><img src="http://thedevignpath.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thedevignpath.com/archives/118/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coupling &#8211; not the dating kind</title>
		<link>http://thedevignpath.com/archives/81</link>
		<comments>http://thedevignpath.com/archives/81#comments</comments>
		<pubDate>Sun, 15 Aug 2010 19:04:39 +0000</pubDate>
		<dc:creator>iampeterbanjo</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://thedevignpath.com/?p=81</guid>
		<description><![CDATA[I just watched Grand Unified Theory of Software Design by Jim Weirich on Vimeo and I found it quite insightful. The main aim of his talk as I understand is to come up with an object way of recognizing and (&#8230;)</p><p><a href="http://thedevignpath.com/archives/81">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I just watched <a href="http://vimeo.com/10837903">Grand Unified Theory of Software Design by Jim Weirich</a> on Vimeo and I found it quite insightful.</p>
<p>The main aim of his talk as I understand is to come up with an object way of recognizing and talking about good code design and more specifically code coupling. He referenced the idea of <a href="http://en.wikipedia.org/wiki/Connascence_(computer_science)">&#8216;connascence&#8217; </a> which basically means &#8220;things which change together&#8221;. There are different types of &#8216;connascence&#8217; (I wonder when I&#8217;ll get bored of using quotes on that word).</p>
<p><strong>Types of &#8216;connascence&#8217;</strong></p>
<ol>
<li>name &#8211; method name and method call. When the name of a method changes you have to change the corresponding method calls. This is the weakest type of coupling and we refactor code in this direction.</li>
<li>position &#8211; order specific process. Think of an array as opposed to a hash or collection of some sort &#8211; the latter is better. By using a collection/hash we reduce our coupling to &#8216;connascence of name&#8217;.</li>
<li>meaning &#8211; variables mean arbitrary things that need to be understood to use them properly. Use constants instead.</li>
<li>contranescene &#8211; namespace conflicts. Ever heard of <a href="http://api.jquery.com/jQuery.noConflict/">jQuery.noConflict</a>()? Make your variables play nice with each other by using namespaces.</li>
<li>algorithm &#8211; duplication of algorithm in more than one place. I usually spot this very quickly.</li>
<li>timing ie. race conditions. This happens when a function or process finishes sooner or later than it is expected to. In JavaScript callbacks are really useful.</li>
<li>execution &#8211; order of execution matters.</li>
<li>identity &#8211; objects have to be the same.</li>
</ol>
<p>Coupling drives me crazy and I need to get better at reducing it. It&#8217;s scary when I want to change some code and I keep wondering if some function far away is going to break. (Tip: keep related functions close together). I found this mnemonic  <a href="http://en.wikipedia.org/wiki/Solid_(object-oriented_design)">SOLID </a>helpful. Maybe I should write each letter on a finger. <img src='http://thedevignpath.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fthedevignpath.com%2Farchives%2F81&amp;title=Coupling%20%26%238211%3B%20not%20the%20dating%20kind"><img src="http://thedevignpath.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thedevignpath.com/archives/81/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tip of the Day: no SVN for Chrome extensions</title>
		<link>http://thedevignpath.com/archives/74</link>
		<comments>http://thedevignpath.com/archives/74#comments</comments>
		<pubDate>Tue, 01 Jun 2010 21:45:23 +0000</pubDate>
		<dc:creator>iampeterbanjo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[tip of the day]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://thedevignpath.com/archives/74</guid>
		<description><![CDATA[It is futile trying to get chrome samples via SVN. It&#8217;s not possible!!]]></description>
			<content:encoded><![CDATA[<p>It is futile trying to get chrome samples via <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/ ">SVN</a>. It&#8217;s <a href="http://code.google.com/chrome/extensions/samples.html#viewsource">not possible</a>!! </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fthedevignpath.com%2Farchives%2F74&amp;title=Tip%20of%20the%20Day%3A%20no%20SVN%20for%20Chrome%20extensions"><img src="http://thedevignpath.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thedevignpath.com/archives/74/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Development as a science</title>
		<link>http://thedevignpath.com/archives/65</link>
		<comments>http://thedevignpath.com/archives/65#comments</comments>
		<pubDate>Sun, 08 Nov 2009 14:07:33 +0000</pubDate>
		<dc:creator>iampeterbanjo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[mda]]></category>
		<category><![CDATA[opinion]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://thedevignpath.com/archives/65</guid>
		<description><![CDATA[I was talking with some co-workers this week and I commented that I think we are getting to that point in the web development industry where things need to start coming together as a science. And by science I mean (&#8230;)</p><p><a href="http://thedevignpath.com/archives/65">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I was talking with some co-workers this week and I commented that I think we are getting to that point in the web development industry where things need to start coming together as a science. And by science I mean a discipline that is able to give you a predictable outcome. At the moment web development borrows a lot of skills, from graphic design to programming, without forming a consistent body of knowledge. I like this <a href="http://googlewebtoolkit.blogspot.com/2009/11/new-insights-into-web-application.html">quote form Kelly Norton</a> on the <a href="http://googlewebtoolkit.blogspot.com/">Google web tool kit blog</a> -</p>
<blockquote><p>I&#8217;ve sometimes thought that optimizing web applications is as much a science as dowsing. (No offense intended, dowsers of the world — but you have to admit it&#8217;s a hard thing to explain even when it does work out.) Even when you are completely willing to invest time and energy into optimizing an application, how do you actually go about it?</p></blockquote>
<p>I think dowsing is an apt metaphor but what woud this body of knowledge look like?</p>
<h3>1. Design: A pattern for designing achievable websites.</h3>
<p>You can get a some Photoshop templates including some nice grid based designs. But seriously, don’t talk about pixel perfect development if you don’t have pixel perfect designs.</p>
<p><strong>Developer</strong>: Oh, I like that transparency (but really thinking, epic fail in IE6). Are we supporting IE6?</p>
<p><strong>Designer</strong>: Yes.</p>
<p><strong>Developer</strong>: (To project manager) How long is this supposed to take?</p>
<p>And don’t even start about using JavaScript to fix PNGs in IE6. Been there, done that and it can still be a huge time sink depending on the design. You know what happens when a developer comes across a huge time sink and an impending deadline? Bugs. Sorry, guys the secret was already out in <a href="http://www.amazon.co.uk/gp/product/0932633056?ie=UTF8&amp;tag=thedevpat-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0932633056">Peopleware</a><img style="margin: 0px; border-style: none !important;" src="http://www.assoc-amazon.co.uk/e/ir?t=thedevpat-21&amp;l=as2&amp;o=2&amp;a=0932633056" border="0" alt="" width="1" height="1" />.</p>
<h3>2. Develop: Guidelines for solving problems effeciently – this includes CSS, HTML and JavaScript.</h3>
<p>I think the best way forward for HTML is the Semantic web including Microformats because you can write the same mark-up and use it in many different ways. The Mozilla Development Community has this nice article about <a href="https://developer.mozilla.org/en/CSS/Writing_Efficient_CSS">writing effecient CSS</a> and there is a movement towards <a href="https://developer.mozilla.org/en/CSS/Writing_Efficient_CSS">Object Oriented CSS</a> which I like – probably because of my formal programming background. The less redundancy I have in my life the better. The rule of thumb for JavaScript seems to be “Find a framework and stick with it”. <a href="http://jquery.com/">jQuery</a> is what I use most.</p>
<h3>3. Test: A testing framework</h3>
<p>This is where it gets interesting because I think there is a big need for this. There’s <a href="http://www.nunit.org/index.php">NUnit</a> and <a href="http://www.junit.org/">JUnit</a> and all kinds of gangsta sounding testing frameworks for other languages but on the net all we have is <a href="http://www.jslint.com/lint.html">JS Lint</a>. No offense to JS Lint but can we have some regression testing with ketchup please? But what would you expect when we are still terrorised by the <a href="http://en.wikipedia.org/wiki/Trident_%28layout_engine%29">Internet Explorer Trident Engine</a> which is built on the mysteries of the Universe? Testing is important to ensure code quality and shorten lead times.</p>
<p>And then you say, “But Peter, you can use JUnit with the Google web toolkit”.</p>
<h3>Segregation vs. Integration</h3>
<p>I couldn’t really think of a better title so this will do for now. What I am trying to get at is two approaches to getting consistent results in a web development process – less time troubleshooting and more time having fun. On one hand I can see <a href="http://developer.yahoo.com/yui/">Yahoo!’s YUI</a> and on the other <a href="http://code.google.com/webtoolkit/">Google’s Web Toolkit</a> and now <a href="http://code.google.com/closure/">Closure Library</a>. Yahoo! and Adobe seem to be on the same page on this where it feels like a design led approach.</p>
<h4>Segregation</h4>
<blockquote><p>Bring me all your layouts, CSS and semantic HTML – plug it into my library and let me upgrade you.</p></blockquote>
<p>Which is great for existing web development teams that are broken along functional lines of designers and developers. So the product of each process remains segregated: they can live independently of each other. Your HTML can have a different life-cycle to your CSS or JavaScript. This is nice because many people with different skill sets can work on the same problem. Also nice if you already have site that you want to spice-up a bit.</p>
<h4>Integration</h4>
<p>Google seems to be saying,</p>
<blockquote><p>Come to me all who are object oriented and are strongly typed and I will give you HTML.</p></blockquote>
<p>If you’ve already worked out your sweet science in Java, Python et al. why re-invent the wheel? Just port it into whatever format you need &#8211; integration. Great for code monkeys . . maybe you can fit a designer or two into the workflow but I think there is less variety in this process.</p>
<h3>Hammers and nails</h3>
<p>The problem with only having a hammer in your toolbox is that every problem looks like a nail. I can see how for enterprise applications Google’s philosophy is a god-send. You might already have a Java code base and all you need is a new interface or two. Write a few facade classes and you are on your way to a new intranet site or whatever.</p>
<p>But I am biased to the idea that the web offers such a rich range of experiences and possibilities. Do you remember how boring the internet was without Flash? All that reading, reading, reading. Having a diverse group of people working on a platform, in cross-disciplinary manner, will create rich set of possibilities.</p>
<p>Ideally I would like to believe that the integrated development environment will generate the best code possible but what if I want to make changes to the generated code? Maybe put in some microformats? Some hacks for IE9 perhaps? It’s the same problem that <a href="http://en.wikipedia.org/wiki/Model_Driven_Architecture">Model Driven Architecture</a> has.</p>
<p>To be fair, this is an abstract thought experiment and time and experience will have their say. . and so can you.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fthedevignpath.com%2Farchives%2F65&amp;title=Web%20Development%20as%20a%20science"><img src="http://thedevignpath.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thedevignpath.com/archives/65/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

