<?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>Dereleased &#187; Uncategorized</title>
	<atom:link href="http://www.dereleased.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dereleased.com</link>
	<description>Information Saturation</description>
	<lastBuildDate>Sat, 10 Sep 2011 20:41:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Pour Some Syntactic Sugar On Me: &#8216;Unless&#8217; Keyword</title>
		<link>http://www.dereleased.com/2010/01/27/pour-some-syntactic-sugar-on-me-unless-keyword/</link>
		<comments>http://www.dereleased.com/2010/01/27/pour-some-syntactic-sugar-on-me-unless-keyword/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 19:49:06 +0000</pubDate>
		<dc:creator>Clark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[control structure]]></category>
		<category><![CDATA[if block]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[syntactic sugar]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[unless]]></category>

		<guid isPermaLink="false">http://www.dereleased.com/?p=145</guid>
		<description><![CDATA[Let&#8217;s face it, syntactic sugar can be a very attractive feature for a language (I consider Perl to be an extremely powerful language composed almost entirely of syntactic sugar), and I think it&#8217;s about time we all started demanding the &#8220;Unless&#8221; Keyword as a counterpart to the &#8220;If&#8221; Keyword. Let me give you a pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s face it, syntactic sugar can be a very attractive feature for a language (I consider Perl to be an extremely powerful language composed almost entirely of syntactic sugar), and I think it&#8217;s about time we all started demanding the &#8220;Unless&#8221; Keyword as a counterpart to the &#8220;If&#8221; Keyword.  Let me give you a pretty common example:</p>
<div class="wp_syntax">
<div class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">(</span>    <span style="color: #339933;">!</span><span style="color: #990000;">ctype_digit</span><span style="color: #009900;">(</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">[</span><span style="color: #0000ff;">'quantity'</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span>
    <span style="color: #339933;">||</span>  <span style="color: #339933;">!</span><span style="color: #990000;">preg_match</span><span style="color: #009900;">(</span><span style="color: #0000ff;">'/one of the billions of email address validators/'</span><span style="color: #339933;">,</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">[</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span>
    <span style="color: #339933;">||</span>  <span style="color: #000088;">$_POST</span><span style="color: #009900;">[</span><span style="color: #0000ff;">'password1'</span><span style="color: #009900;">]</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">[</span><span style="color: #0000ff;">'password2'</span><span style="color: #009900;">]</span>
    <span style="color: #339933;">||</span>  <span style="color: #339933;">!</span>my_validation_routine<span style="color: #009900;">(</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">[</span><span style="color: #0000ff;">'Im_Running_Out_Of_Examples'</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span>
<span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
    <span style="color: #990000;">die</span><span style="color: #009900;">(</span><span style="color: #0000ff;">'Bad Data'</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<span style="color: #009900;">}</span></pre>
</div>
</div>
<p>Quick-And-Dirty form validation.  Of course, one would normally want to check these separately so that meaningful error messages could be dumped, but let&#8217;s assume for a moment that this isn&#8217;t the case for this project.  I&#8217;m not saying this is a life or death matter.  I&#8217;m not saying the above code doesn&#8217;t work or anything like that.  What I am saying is that, from a readability/logical perspective, it would make sense to have an unless keyword to transform the above sequence from a bunch of or-not ideas into and-must-be ideas.  Example!</p>
<div class="wp_syntax">
<div class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">unless</span> <span style="color: #009900;">(</span>    <span style="color: #990000;">ctype_digit</span><span style="color: #009900;">(</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">[</span><span style="color: #0000ff;">'quantity'</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span>
        <span style="color: #339933;">&amp;&amp;</span>  <span style="color: #990000;">preg_match</span><span style="color: #009900;">(</span><span style="color: #0000ff;">'/one of the billions of email address validators/'</span><span style="color: #339933;">,</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">[</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span>
        <span style="color: #339933;">&amp;&amp;</span>  <span style="color: #000088;">$_POST</span><span style="color: #009900;">[</span><span style="color: #0000ff;">'password1'</span><span style="color: #009900;">]</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">[</span><span style="color: #0000ff;">'password2'</span><span style="color: #009900;">]</span>
        <span style="color: #339933;">&amp;&amp;</span>  my_validation_routine<span style="color: #009900;">(</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">[</span><span style="color: #0000ff;">'Im_Running_Out_Of_Examples'</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span>
<span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
    <span style="color: #990000;">die</span><span style="color: #009900;">(</span><span style="color: #0000ff;">'Bad Data'</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<span style="color: #009900;">}</span></pre>
</div>
</div>
<p>I realize some people don&#8217;t or won&#8217;t care about this, and that&#8217;s fine.  It&#8217;s not for them.  I like to think in code, and it would make code-thought to normal-though a bit more one-to-one if I could think in terms of &#8220;Unless a is valid and b is valid and c is valid return false&#8221; instead of &#8220;If a is not valid or b is not valid or c is not valid return false&#8221;.  C++ Programmers are lucky in this regard, as they are 1 macro away from having this keyword:</p>
<div class="wp_syntax">
<div class="code">
<pre class="c" style="font-family:monospace;"><span style="color: #339933;">#define unless(cond) if(!(cond))</span></pre>
</div>
</div>
<p>In conclusion, I know it doesn&#8217;t really change any thing, I know some people don&#8217;t care, but I want it.  I guess it&#8217;s time to start maintaining my own PHP distro&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dereleased.com/2010/01/27/pour-some-syntactic-sugar-on-me-unless-keyword/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blankets &#8211; Nature&#8217;s Simple Truths</title>
		<link>http://www.dereleased.com/2009/10/09/blankets-natures-simple-truths/</link>
		<comments>http://www.dereleased.com/2009/10/09/blankets-natures-simple-truths/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 21:16:56 +0000</pubDate>
		<dc:creator>Clark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.dereleased.com/2009/10/09/blankets-natures-simple-truths/</guid>
		<description><![CDATA[Just as a quick FYI, it has come to my attention that all programming languages suck. Prolog, PL/1, Perl, C, C++, ASM, Haskell, PHP, Python, Ruby, Tcl, Java, Delphi, COBOL, FORTRAN, Pascal, Visual Basic, ASP.NET, Ocaml, C# and so on&#8230; all worthless. This comes as a huge relief. According to further reading I&#8217;ve done, all [...]]]></description>
			<content:encoded><![CDATA[<p>Just as a quick FYI, it has come to my attention that all programming languages suck.  Prolog, PL/1, Perl, C, C++, ASM, Haskell, PHP, Python, Ruby, Tcl, Java, Delphi, COBOL, FORTRAN, Pascal, Visual Basic, ASP.NET, Ocaml, C# and so on&#8230; all worthless.  This comes as a huge relief.</p>
<p>According to further reading I&#8217;ve done, all programming languages are awesome and supreme.  There&#8217;s no language as good as, apparently, every single language out there.  </p>
<p>Except BASIC.  BASIC sucks. I think we can all agree on that one.  BASIC, QBASIC, whatever-BASIC &#8212; all sucks.</p>
<p>Oh, and I think we can also agree that the next time we hear someone refer to themselves as an HTML Programmer, we&#8217;re going to laugh heartily, right before kicking their head in.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dereleased.com/2009/10/09/blankets-natures-simple-truths/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programming Nuances, PHP and JavaScript</title>
		<link>http://www.dereleased.com/2009/09/23/programming-nuances-php-and-javascript/</link>
		<comments>http://www.dereleased.com/2009/09/23/programming-nuances-php-and-javascript/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 20:29:45 +0000</pubDate>
		<dc:creator>Clark</dc:creator>
				<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[Programs And Tools]]></category>
		<category><![CDATA[The Internet]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[for-loop]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[loops]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[while-loop]]></category>

		<guid isPermaLink="false">http://www.dereleased.com/?p=97</guid>
		<description><![CDATA[Two little snippets, some simple things that seem to be forgotten when writing code.  First, a general example using PHP; have you ever found yourself writing a loop that looks something like this? $i = 0; while ($row = mysql_fetch_assoc($result) { // ... // maybe something about $i % 2 to determine even-from-odd rows ++$i; [...]]]></description>
			<content:encoded><![CDATA[<p>Two little snippets, some simple things that seem to be forgotten when writing code.  First, a general example using PHP; have you ever found yourself writing a loop that looks something like this?</p>
<div class="wp_syntax">
<div class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">(</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_assoc</span><span style="color: #009900;">(</span><span style="color: #000088;">$result</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
	<span style="color: #666666; font-style: italic;">// ...</span>
	<span style="color: #666666; font-style: italic;">// maybe something about $i % 2 to determine even-from-odd rows</span>
	<span style="color: #339933;">++</span><span style="color: #000088;">$i</span><span style="color: #339933;">;</span>
<span style="color: #009900;">}</span></pre>
</div>
</div>
<p>If so, remember this: you are (effectively) building a complicated, difficult to read and easy-to-break for-loop.  There is no magic law that says that all three arguments of a for-loop must be related to the same variable (heck, you may have even used a few of them with no arguments in one or more positions).  Consider the following:</p>
<div class="wp_syntax">
<div class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">for</span> <span style="color: #009900;">(</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_assoc</span><span style="color: #009900;">(</span><span style="color: #000088;">$result</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #339933;">++</span><span style="color: #000088;">$i</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
	<span style="color: #666666; font-style: italic;">// ...</span>
	<span style="color: #666666; font-style: italic;">// the same code can go here</span>
<span style="color: #009900;">}</span></pre>
</div>
</div>
<p>While the differences may seem semantic-bordering-on-syntactic-sugar at first (there is no real execution difference between for-loops and while-loops, of course), consider what differences they offer to you as a developer:</p>
<ol>
<li>When looking at the for loop, you know immediately what is involved, instead of hunting for the declaration and incrementation of <span style="font-family:'Courier New',Courier,Monospace;color:#CCC;">$i</span>, or whatever your preferred increment-variable flavor is.</li>
<li>It saves code real-estate</li>
<li>You can easily edit the contents of the loop, as well as what contains the loop, and not worry about destroying an important variable declaration, iteration, etc.</li>
</ol>
<p>Of course, this isn&#8217;t a serious gripe, just a nudge towards thinking outside of &#8220;traditional&#8221; declarations and using something that will be easily maintainable.</p>
<p>Second, remember that everything in JavaScript can be treated like an object-reference.  Of course, you&#8217;ve probably been told this before, but I want to bring up one instance in particular: functions.  If something returns a function reference, you can execute it directly, without cluttering the parser/code with unnecessary calls to things like <span style="font-family:'Courier New',Courier,Monospace;color:#CCC;">setTimeout()</span>.  Consider the following code I have been running into a lot recently (using Prototype 1.6):</p>
<div class="wp_syntax">
<div class="code">
<pre class="javascript" style="font-family:monospace;">setTimeout<span style="color: #009900;">(</span>someFunction.<span style="color: #660066;">bind</span><span style="color: #009900;">(</span>window<span style="color: #009900;">)</span><span style="color: #339933;">,</span><span style="color: #CC0000;">10</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span></pre>
</div>
</div>
<p>While this will certainly do what you want, the call to <span style="font-family:'Courier New',Courier,Monospace;color:#CCC;">setTimeout()</span> is superfluous, and serves only to confound the matter.  Since it is an object reference, you may use function notation to execute it like any other function object, such as:</p>
<div class="wp_syntax">
<div class="code">
<pre class="javascript" style="font-family:monospace;">someFunction.<span style="color: #660066;">bind</span><span style="color: #009900;">(</span>window<span style="color: #009900;">)</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span></pre>
</div>
</div>
<p>Not only is it more concise, but when you look at it you know exactly what you&#8217;re doing with it.</p>
<p>Remember, while avoiding cleverness for cleverness&#8217; sake, it is important to use your brain while programming.  Strive for elegance and keep on truckin&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dereleased.com/2009/09/23/programming-nuances-php-and-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nerdisms: Destroying America</title>
		<link>http://www.dereleased.com/2009/09/14/nerdisms-destroying-america/</link>
		<comments>http://www.dereleased.com/2009/09/14/nerdisms-destroying-america/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 15:37:41 +0000</pubDate>
		<dc:creator>Clark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.dereleased.com/?p=91</guid>
		<description><![CDATA[Hey there kids! Put your walk-mans down and listen up! Let&#8217;s &#8220;rap&#8221; for a second about nerds. Nerds, the social stragglers that make your stuff go just so you won&#8217;t beat them. Nerds, the&#8230; Actually, I&#8217;m sick of this already. I was browsing Graphjam today, and I ran across this: I, like many, thought it [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="Nerd Love" src="http://dereleased.com/cimages/nerd.jpg" alt="i3u" width="217" height="190" /></p>
<p>Hey there kids!  Put your walk-mans down and listen up!  Let&#8217;s &#8220;rap&#8221; for a second about nerds.  Nerds, the social stragglers that make your stuff go just so you won&#8217;t beat them.  Nerds, the&#8230; Actually, I&#8217;m sick of this already.  I was browsing <a title="Graphjam!" href="http://graphjam.com" target="_blank">Graphjam</a> today, and I ran across this:</p>
<p>I, like many, thought it was cute.  I even posted it on a certain social networking site that sounds like &#8220;Chase Crook.&#8221;  Then, I made the mistake of reading the <a title="Nerd Love Comments" href="http://graphjam.com/2009/09/11/song-chart-memes-nerd-love/" target="_blank">comments</a>, causing me to run across <a title="There's No Such Thing As Nerds" href="http://graphjam.com/2009/09/11/song-chart-memes-nerd-love/#comment-75150" target="_blank">this gem</a>:</p>
<blockquote><p><q>“Nerds do not exist. Nerdisms are a threat to the success of society, and perpetuated by popular culture. Because of nerdisms, people subconsciously associate science, math and engineering with being ‘socially inept’ thus avoiding such unpopular fields. We are running out of scientists in the US and soon China, because of their immense quantity of engineers and scientists will become the world superpower.”</q></p></blockquote>
<p>Now, without addressing the inherent Jingoism this quote, the rest of it is pretty spot-on.  Maybe it&#8217;s the that&#8217;s-for-nerds factor, or maybe it&#8217;s the waah-it&#8217;s-hard factor (maybe even both), but I do tend to hear more kids my age talking about majoring in communications, business or English (to name a few) than I do in science-related fields (considering Math as the purest science, for the sake of grouping).</p>
<p>Of course, college major isn&#8217;t everything.  In fact, attacking a major would, by and large, be completely the wrong avenue, since there&#8217;s no accounting for (a) what you will actually do with your degree and (b) quite honestly, science isn&#8217;t for everyone.  Business, Politics, Education, and others can all be worthwhile pursuits &#8212; even entertainment is necessary to the vast bulk of society, nerd or otherwise.  This isn&#8217;t an attack on these fields, so much as question: why is it that science is almost treated with disdain?</p>
<p>I, for one, have no college degree, and I know there are <strong>plenty</strong> of us doing just fine without a fancy degree from a major institution saying that we can be, well, nerds.  Those of us who bear that title generally do so with pride; many of us took up the nerd banner at a young age, suffered social ostracism as children, and tinkered, and played, and stayed in figuring out just that one last problem (which of course led to the next thousand-or-so) that prepared us to move on, as adults, to bigger and better things.</p>
<p>I know that I can&#8217;t change society&#8217;s mind; it&#8217;s just not hip to be smart.  At this point, it&#8217;s almost a vicious cycle &#8211; in a society that engenders a distrust, or downright hatred, of smarter people when they&#8217;re children, doesn&#8217;t it stand to reason that the same children will lose out on the formation of critical social skills at a young age?  Oh, there are exceptions to this (and every) social rule, but popular culture makes sure that it stays firmly rooted as a mainstay of growing up: there&#8217;s cool kids, average kids, slime moulds, and nerds – in that order.</p>
<p>What&#8217;s the solution?  wish I knew.  How do you take a society like ours, with values and culture in the state they are in, and try to get it to really believe that maybe they don&#8217;t need to hate everything they don&#8217;t understand?  Well, now I <strong>am</strong> reaching too far…</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dereleased.com/2009/09/14/nerdisms-destroying-america/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

