<?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>Ghostmonk Journal &#187; process</title>
	<atom:link href="http://journal.ghostmonk.com/tag/process/feed/" rel="self" type="application/rss+xml" />
	<link>http://journal.ghostmonk.com</link>
	<description>Pontificate, Obfuscate, Simplify and Reveal</description>
	<lastBuildDate>Mon, 18 Jan 2010 02:15:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>To bracket or not to bracket, making sense of single line conditionals</title>
		<link>http://journal.ghostmonk.com/ether/no-single-line-conditionals/</link>
		<comments>http://journal.ghostmonk.com/ether/no-single-line-conditionals/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 10:47:41 +0000</pubDate>
		<dc:creator>ghostmonk</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Code Guidlines]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[Lost in the Ether]]></category>
		<category><![CDATA[Writing Code]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[syntax]]></category>

		<guid isPermaLink="false">http://journal.ghostmonk.com/?p=134</guid>
		<description><![CDATA[It&#8217;s taking me about 3 months to finally come up with a strong opinion about single line conditionals, but I now have a firm position: &#8220;In the long run, it&#8217;s a bad idea to drop the brackets and put a conditional or iterator on a single line.&#8221; Essentially sort of thing: public function testResults(score:Number):void { [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s taking me about 3 months to finally come up with a strong opinion about single line conditionals, but I now have a firm position:</p>
<p>&#8220;In the long run, it&#8217;s a bad idea to drop the brackets and put a conditional or iterator on a single line.&#8221;</p>
<p>Essentially sort of thing:</p>
<pre>public function testResults(score:Number):void
{
    if(score &lt; MIN_PASS) sendNotification(YOU_FAIL)
    else sendNotification(YOU_PASS)
}</pre>
<p>Should always be this:</p>
<pre>public function testResults(score:Number):void
{
    if(value &lt; MIN_PASS)
    {
        sendNotification(YOU_FAIL)
    }
    else
    {
        sendNotification(YOU_PASS)
    }
}</pre>
<p>Even when writing in a language that doesn&#8217;t use brackets, i.e. so called pure block languages like Python and Visual Basic, proper formatting should be used rather than single lines. If a language does use brackets, there is no excuse not to use them.</p>
<p>My argument follows this logic:</p>
<blockquote><p>&#8220;Since debugging code is 20 times harder than writing it, by that definition you won&#8217;t be smart enough to find errors in clever code.&#8221;</p></blockquote>
<p><span id="more-134"></span>Single line conditionals are essentially clever ways to save line space and avoid using brackets. As such, they cause an extra level of structured complexity that can be unfamiliar and confusing in a fully realized code based.</p>
<p>There are a lot of coders who might disagree with this, but I have good reason for taking this approach. First of all, one line statements are dense, hard to read and uncommon enough to be awkward.</p>
<p>That&#8217;s not to say they don&#8217;t look great, because they do. But they are a guilty pleasure to write because they belie the complexity of the code. And as a number of seasoned professionals might tell you, readable code always super cedes pretty layout.</p>
<p>Certainly the instance above is a modest example, but think of what happens when these are spread freely in classes or routines a couple hundred lines long. The logic is literally packed into dense statements whose size hides the real length of the program.</p>
<p>The reader tricks themselves into believing that because line-for-line the statement is smaller that it is easier to read. However, in reality the layout removes all visual cues that tell a programmer they are dealing with a control structure.</p>
<p>To state it firmly, the number one objective of any coder should be to reduce complexity, and this does the exact opposite.</p>
<p>I was attracted originally attracted to the single line approach because the extra lines and brackets can be annoying. I even started using it for looping statements*. But I noticed what was happening to my code, and even my own behaviour.</p>
<p>Brackets in this instance act as a natural defense to the proliferation of ugly, unplanned, haphazard code. Single line statements, because the mistakenly feel concise actually encourage bad coding practices.</p>
<p>Conditionals are twisting logic that arrest the normal intellectual flow of a program in the writer&#8217;s mind. They are necessary to be sure, but should be used as sparingly as possible to help simply the code base.</p>
<p>Because single line conditionals are so easy to write, they create an easy road that is often all to tempting when the logic gets tough, and you begin to realize you&#8217;ve been writing too many conditional control structures.</p>
<p>My new favourite quote is Anonymous:</p>
<blockquote><p>Code as if whoever maintains your program is a violent psychopath who knows where you live.</p></blockquote>
<p>*Side Note: Interestingly enough, Flex or Eclipse will not provide code completion for lopping variables not included in brackets.</p>
]]></content:encoded>
			<wfw:commentRss>http://journal.ghostmonk.com/ether/no-single-line-conditionals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Technophile Chatter</title>
		<link>http://journal.ghostmonk.com/ether/technophile_chatter/</link>
		<comments>http://journal.ghostmonk.com/ether/technophile_chatter/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 00:47:39 +0000</pubDate>
		<dc:creator>ghostmonk</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Lost in the Ether]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[clients]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[content management systems]]></category>
		<category><![CDATA[ghostmonk]]></category>
		<category><![CDATA[ideas]]></category>
		<category><![CDATA[oculart]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://journal.ghostmonk.com/?p=136</guid>
		<description><![CDATA[Here&#8217;s an online conversation with a good friend of mine on IM! oculart:      hows it going with you these days ghostmonk:  good man ghostmonk: busy oculart:     that&#8217;s the word on the streets isn&#8217;t it ghostmonk: Myron and I are making this crazy ass site oculart:     sweet, for who ghostmonk: same one we&#8217;ve been working on [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Here&#8217;s an online conversation with a good friend of mine on IM!</p>
<p style="text-align: justify;"><span style="color: #00ff00;">oculart</span>:        hows it going with you these days<br />
<span style="color: #00ccff;">ghostmonk</span>:  good man<br />
<span style="color: #00ccff;">ghostmonk</span>: busy<br />
<span style="color: #00ff00;">oculart</span>:     that&#8217;s the word on the streets isn&#8217;t it<br />
<span style="color: #00ccff;">ghostmonk</span>: Myron and I are making this crazy ass site<br />
<span style="color: #00ff00;">oculart</span>:     sweet, for who<br />
<span style="color: #00ccff;">ghostmonk</span>: same one we&#8217;ve been working on for the last 8 months<br />
<span style="color: #00ccff;">ghostmonk</span>: for this at risk women&#8217;s group in Winnipeg<br />
<span style="color: #00ccff;">ghostmonk</span>: funded by ***<br />
<span style="color: #00ff00;">oculart</span>:      ah cool, is an interactive story?<br />
<span style="color: #00ccff;">ghostmonk</span>: no<br />
<span style="color: #00ccff;">ghostmonk</span>: it&#8217;s a content site<br />
<span style="color: #00ccff;">ghostmonk</span>: interactive story would be awesome<br />
<span style="color: #00ccff;">ghostmonk</span>: nice idea<br />
<span style="color: #00ccff;">ghostmonk</span>: I can show you<br />
<span style="color: #00ccff;">ghostmonk</span>: beta.**********.com<br />
<span style="color: #00ccff;">ghostmonk</span>: runs completely off a cms<br />
<span style="color: #00ccff;">ghostmonk</span>: that&#8217;s why there is dummy content in there right now<br />
<span style="color: #00ccff;">ghostmonk</span>: there is still a ton of work left to do<br />
<span style="color: #00ff00;">oculart</span>:     alright let me check it out<br />
<span style="color: #00ff00;">oculart</span>:      i like the resizing browser animation snap thing<br />
<span style="color: #00ccff;">ghostmonk</span>: There&#8217;s more there than meets the eye<br />
<span style="color: #00ccff;">ghostmonk</span>: the content is completely managed<br />
<span style="color: #00ccff;">ghostmonk</span>: there is a back end<br />
<span style="color: #00ff00;">oculart</span>:     do they have a lot of content they are going to be adding<br />
<span style="color: #00ccff;">ghostmonk</span>: I guess so<br />
<span style="color: #00ff00;">oculart</span>:     i don&#8217;t really believe in having cms for a lot of sites<br />
<span style="color: #00ff00;">oculart</span>:     seems like a waste of programming time unless content is updated hourly<br />
<span style="color: #00ff00;">oculart</span>:      I think it&#8217;s foolish when more resources are used on building a back end application when its just as easy to republish updated content unless it needs to be dynamic content<span id="more-136"></span><span style="color: #00ccff;"><br />
ghostmonk</span>: well&#8230; depends on how long the thing will live<br />
<span style="color: #00ccff;">ghostmonk</span>: you want to extract as much of the changing data that is possible<br />
<span style="color: #00ccff;">ghostmonk</span>: that&#8217;s just good sense<br />
<span style="color: #00ccff;">ghostmonk</span>: If I make more than one of these sites<br />
<span style="color: #00ccff;">ghostmonk</span>: I don&#8217;t want to constantly republish every time content changes<br />
<span style="color: #00ccff;">ghostmonk</span>: and as the thing moves forward, there is opportunity to add new modules, and the possibility of abstracting more business related rules<span style="color: #00ff00;"><br />
oculart</span>:     yeah buts its also taking 8 months to make it<br />
<span style="color: #00ccff;">ghostmonk</span>: well it is and it isn&#8217;t, the whole project is taking 8 months, not 8 months of coding time<br />
<span style="color: #00ff00;">oculart</span>:      but will there be money for them to add extra features?<br />
<span style="color: #00ccff;">ghostmonk</span>: let&#8217;s just say that I&#8217;m working extra hard to have a code base I can resuse<br />
<span style="color: #00ccff;">ghostmonk</span>: so they get more functionality, but we own the code<br />
<span style="color: #00ccff;">ghostmonk</span>: when you program sites that hard code business related rules<br />
<span style="color: #00ccff;">ghostmonk</span>: like content<br />
<span style="color: #00ccff;">ghostmonk</span>: you basically create throw away code<br />
<span style="color: #00ccff;">ghostmonk</span>: or rather<br />
<span style="color: #00ccff;">ghostmonk</span>: encourage throwaway code<br />
<span style="color: #00ccff;">ghostmonk</span>: that&#8217;s fine for current clients<br />
<span style="color: #00ccff;">ghostmonk</span>: may even speed up things on a client by client basis<br />
<span style="color: #00ccff;">ghostmonk</span>: but in the long run<br />
<span style="color: #00ccff;">ghostmonk</span>: you shoot yourself in the foot<br />
<span style="color: #00ff00;">oculart</span>:      that&#8217;s a fair argument, but i think clients waste too much on cms work<br />
<span style="color: #00ccff;">ghostmonk</span>: well&#8230; that&#8217;s a different argument<br />
<span style="color: #00ccff;">ghostmonk</span>: does a client need a cms?<br />
<span style="color: #00ccff;">ghostmonk</span>: that depends if they are publishing regularly<br />
<span style="color: #00ccff;">ghostmonk</span>: weekly is probably a good measure<br />
<span style="color: #00ccff;">ghostmonk</span>: If over my career I deploy 100 sites with clients that want to update even on a monthly basis<br />
<span style="color: #00ccff;">ghostmonk</span>: I might drive myself crazy trying to maintain sites that could otherwise maintain themselves<br />
<span style="color: #00ccff;">ghostmonk</span>: in this case&#8230; honestly<br />
<span style="color: #00ccff;">ghostmonk</span>: I&#8217;m thinking about the code base when it&#8217;s all done<br />
<span style="color: #00ccff;">ghostmonk</span>: and the lessons learned<br />
<span style="color: #00ff00;">oculart</span>:     but how is building a cms like that going to be useful for future clients going more mobile<br />
<span style="color: #00ccff;">ghostmonk</span>: well, unless flash blows up, I have a code base that is easily deploy-able in a variety of online environments<br />
<span style="color: #00ccff;">ghostmonk</span>: I think the idea is more about the experience<br />
<span style="color: #00ccff;">ghostmonk</span>: certainly the argument that flash sites are redundant can be made<br />
<span style="color: #00ccff;">ghostmonk</span>: but people still want them<br />
<span style="color: #00ff00;">oculart</span>:      i think reactive content management systems are the future<br />
<span style="color: #00ff00;">oculart</span>:      content that reacts emotionally to people&#8217;s behavior<br />
<span style="color: #00ccff;">ghostmonk</span>: that doesn&#8217;t even make sense<br />
<span style="color: #00ff00;">oculart</span>:     emotional intelligence<br />
<span style="color: #00ccff;">ghostmonk</span>: what in the hell are you talking about<br />
<span style="color: #00ccff;">ghostmonk</span>: that&#8217;s fine when speaking about technology that is stil 50 years from common use<br />
<span style="color: #00ccff;">ghostmonk</span>: but that&#8217;s a future beyond ours<br />
<span style="color: #00ccff;">ghostmonk</span>: touch screens are still not main stream<br />
<span style="color: #00ccff;">ghostmonk</span>: unless you talk about iPhones<br />
<span style="color: #00ff00;">oculart</span>:      i think instead of managing content, we need to manage how to absorb content<br />
<span style="color: #00ccff;">ghostmonk</span>: ok that makes a little more sense<br />
<span style="color: #00ccff;">ghostmonk</span>: but what you are talking about is still a decade away from being mainstream<br />
<span style="color: #00ccff;">ghostmonk</span>: no client in their right mind would budget a project that only has the potential to reach the most technically savvy of the population<br />
<span style="color: #00ccff;">ghostmonk</span>: tech savvy and rich<br />
<span style="color: #00ccff;">ghostmonk</span>: iPhones are a sort of exception<br />
<span style="color: #00ccff;">ghostmonk</span>: but they are still drastically limited<br />
<span style="color: #00ccff;">ghostmonk</span>: you are basically banking on the mainstream peripherals to be different<br />
<span style="color: #00ccff;">ghostmonk</span>: in our generation, and probably the next<br />
<span style="color: #00ccff;">ghostmonk</span>: you are looking at touch screens, keyboards and the mouse<br />
<span style="color: #00ccff;">ghostmonk</span>: there are tons of other theoretical ideas and prototypes out there that are awesome<br />
<span style="color: #00ccff;">ghostmonk</span>: but right now they are more suited to museums and installations (maybe special scenarios)<br />
<span style="color: #00ccff;">ghostmonk</span>: not feasible to the mainstream<br />
<span style="color: #00ccff;">ghostmonk</span>: .. the only mainstream touch screen right now is the iPhone<br />
<span style="color: #00ccff;">ghostmonk</span>: and that doesn&#8217;t capture too much real data<br />
<span style="color: #00ccff;">ghostmonk</span>: it certainly doesn&#8217;t replace the keyboard and mouse&#8230;. yet of course<br />
<span style="color: #00ccff;">ghostmonk</span>: and I still can&#8217;t see how a touch screen will grab too much in the way of emotional content<br />
<span style="color: #00ccff;">ghostmonk</span>: gestures are cool<br />
<span style="color: #00ccff;">ghostmonk</span>: but they don&#8217;t say a hell of a lot about the emotional state of a human being<br />
<span style="color: #00ccff;">ghostmonk</span>: unless you are adding a really representative GUI<br />
<span style="color: #00ccff;">ghostmonk</span>: which is cool<br />
<span style="color: #00ccff;">ghostmonk</span>: but still not mainstream<br />
<span style="color: #00ccff;">ghostmonk</span>: anyway&#8230; I&#8217;m just trying to make software that is as flexible as possible<br />
<span style="color: #00ccff;">ghostmonk</span>: if i have to rewrite this one day for a mobile application&#8230; at least I will have done it once&#8230; so I can do it again<br />
<span style="color: #00ccff;">ghostmonk</span>: and i can start gathering those gestures, and building data bases that can begin to infer their meaning<br />
<span style="color: #00ccff;">ghostmonk</span>: you still with me?<br />
<span style="color: #00ff00;">oculart</span>:      jesus you talk a lot when i turn my head<br />
<span style="color: #00ff00;">oculart</span>:      haha<br />
<span style="color: #00ccff;">ghostmonk</span>: I think what i said makes sense<br />
<span style="color: #00ff00;">oculart</span>:      man, let me read this, im multi tasking, arguing with you and working  at the same time<br />
<span style="color: #00ff00;">oculart</span>:      hold on a sec<br />
<span style="color: #00ff00;">oculart</span>:      feel like god damn batman<br />
<span style="color: #00ff00;">oculart</span>:      but i love arguing with you more than anything so i will for sure get too it</p>
]]></content:encoded>
			<wfw:commentRss>http://journal.ghostmonk.com/ether/technophile_chatter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
