<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.1.3" -->
<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/"
	>

<channel>
	<title>Official AzroTech Blog</title>
	<link>http://www.azrotech.com/blog</link>
	<description>A glimpse into the world of AzroTech's development and technology</description>
	<pubDate>Wed, 20 Jun 2007 01:07:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.3</generator>
	<language>en</language>
			<item>
		<title>How to emulate namespaces in Javascript</title>
		<link>http://www.azrotech.com/blog/2007/06/19/how-to-emulate-namespaces-in-javascript/</link>
		<comments>http://www.azrotech.com/blog/2007/06/19/how-to-emulate-namespaces-in-javascript/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 23:34:12 +0000</pubDate>
		<dc:creator>rgillette</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.azrotech.com/blog/2007/06/19/how-to-emulate-namespaces-in-javascript/</guid>
		<description><![CDATA[A common problem when coding very large Javascript applications is that the global namespace gets polluted, which causes the programmer to name their functions and variables something they don&#8217;t want to name them (just for the sake of uniqueness).  If Javascript had namespacing and classes, we wouldn&#8217;t have this problem. Good news, there is [...]]]></description>
			<content:encoded><![CDATA[<p>A common problem when coding very large Javascript applications is that the global namespace gets polluted, which causes the programmer to name their functions and variables something they don&#8217;t want to name them (just for the sake of uniqueness).  If Javascript had namespacing and classes, we wouldn&#8217;t have this problem. Good news, there is a solution to allow for classes and namespacing it goes a little like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #003366; font-weight: bold;">var</span> az = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> variable1 = <span style="color: #3366CC;">&quot;test&quot;</span>;
    <span style="color: #003366; font-weight: bold;">var</span> variable2 = <span style="color: #3366CC;">&quot;test2&quot;</span>;
&nbsp;
    <span style="color: #003366; font-weight: bold;">function</span> testFunc<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#123;</span>
        <span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span>variable1<span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #66cc66;">&#123;</span>
        init : <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
            <span style="color: #66cc66;">&#123;</span>
            testFunc<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">testFunc2</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #66cc66;">&#125;</span>,
&nbsp;
        testFunc2 : <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
            <span style="color: #66cc66;">&#123;</span>
            <span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span>variable2<span style="color: #66cc66;">&#41;</span>;
            <span style="color: #66cc66;">&#125;</span>
        <span style="color: #66cc66;">&#125;</span>;
    <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
az.<span style="color: #006600;">init</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Let&#8217;s take a look at this in more detail!</p>
<p>You&#8217;ll notice that we have <code>variable1</code> and <code>variable2</code>. These variables can be thought of as <em>private</em> variables. Additionally, <code>testFunc</code> can be thought of as a private function.</p>
<p>Any of the code that lives within the <code>return</code> block can be thought of as public. These are the only functions that may be called externally. If you are calling a public function within the class, you must either put the full path to it (ex: <code>az.testFunc2()</code>) or prepend it with <code>this</code> (ex: <code>this.testFunc2()</code>).</p>
<p>So now you have a good example of how to represent a class in Javascript. But let&#8217;s take this a step further and emulate namespacing as well.</p>
<p>Let&#8217;s say we had the code above in addition to this code below:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #003366; font-weight: bold;">var</span> az.<span style="color: #006600;">util</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #66cc66;">&#123;</span>        
        gebi : <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>obj<span style="color: #66cc66;">&#41;</span>
            <span style="color: #66cc66;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">return</span> document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span>obj<span style="color: #66cc66;">&#41;</span>;
            <span style="color: #66cc66;">&#125;</span>
        <span style="color: #66cc66;">&#125;</span>;
    <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Now we can call <code>az.util.gebi('id_to_get_element_of')</code>. </p>
<p>You can keep adding level after level to the namespacing so that you might have something like <code>az.util.date.convert.toSql()</code>.</p>
<p>Using this technique is great because you do not junk up your global namespace and you can organize your code very well.  In fact, each different &#8220;class&#8221; can live in its own file and you can create a mechanism to import the files as you need them (dramatically improving load time).</p>
<p><strong style="color:red">An interesting note:</strong> You may notice on the examples that there is not a line break between <code>return</code> and the opening brace. Adding a line break will cause the code to break (who knows why?!). Therefore, you will have to keep the opening brace on the same line as the return.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.azrotech.com/blog/2007/06/19/how-to-emulate-namespaces-in-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dynamic Dojo Tooltips</title>
		<link>http://www.azrotech.com/blog/2007/06/19/dynamic-dojo-tooltips/</link>
		<comments>http://www.azrotech.com/blog/2007/06/19/dynamic-dojo-tooltips/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 23:02:13 +0000</pubDate>
		<dc:creator>rgillette</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[Dojo]]></category>

		<guid isPermaLink="false">http://www.azrotech.com/blog/2007/06/19/dynamic-dojo-tooltips/</guid>
		<description><![CDATA[While messing with the dojo tooltip widget in one of our applications, I had the need to dynamically create a widget.  Below is a sample statement of dynamically creating a tooltip widget.

dojo.widget.createWidget&#40;'tooltip', 
	&#123; 
	caption: 'what you want the tooltip to say', 
	connectId: 'target_id_to_attach_tooltip' 
	&#125;&#41;;

However, this is not complete because we need to attach it [...]]]></description>
			<content:encoded><![CDATA[<p>While messing with the dojo tooltip widget in one of our applications, I had the need to dynamically create a widget.  Below is a sample statement of dynamically creating a tooltip widget.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript">dojo.<span style="color: #006600;">widget</span>.<span style="color: #006600;">createWidget</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'tooltip'</span>, 
	<span style="color: #66cc66;">&#123;</span> 
	caption: <span style="color: #3366CC;">'what you want the tooltip to say'</span>, 
	connectId: <span style="color: #3366CC;">'target_id_to_attach_tooltip'</span> 
	<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>However, this is not complete because we need to attach it to the body of the document like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #003366; font-weight: bold;">var</span> new_tooltip = dojo.<span style="color: #006600;">widget</span>.<span style="color: #006600;">createWidget</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'tooltip'</span>,
	<span style="color: #66cc66;">&#123;</span> 
	caption: <span style="color: #3366CC;">'what you want the tooltip to say'</span>, 
	connectId: <span style="color: #3366CC;">'target_id_to_attach_tooltip'</span> 
	<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
document.<span style="color: #006600;">body</span>.<span style="color: #006600;">attachChild</span><span style="color: #66cc66;">&#40;</span>new_tooltip.<span style="color: #006600;">domNode</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>You&#8217;ll notice that the return value of <code>dojo.widget.createWidget</code> is an object and when we attach it to the body of the document, we use the <code>domNode</code> property of that object.</p>
<p>There is one more potential problem with dynamically creating these widgets. Let&#8217;s say that we have a dynamic table and each row of the table contains the target id for each tooltip. If the table gets reloaded with new data (rows have new ids), the old tooltips remain appended to the body. No big deal of you don&#8217;t mind a little trash left behind, but the problem comes into play when you load data back into that dynamic table that may have previously existed and generate a whole new set of tooltips to go along with it. Now you may have two or more of the same tooltip appended to the body that belong to the same target id. Some browsers might be fine with this and some might choke. To prevent these duplicates, we use the following code for each new tooltip widget that is created:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #003366; font-weight: bold;">function</span> createTooltip<span style="color: #66cc66;">&#40;</span>target_id, content<span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
	<span style="color: #009900; font-style: italic;">//prepending 'tt_' to distinguish between target and tooltip id's</span>
	<span style="color: #003366; font-weight: bold;">var</span> obj = document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'tt_'</span>+target_id<span style="color: #66cc66;">&#41;</span>; 
&nbsp;
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>obj != <span style="color: #003366; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>
		obj.<span style="color: #006600;">parentNode</span>.<span style="color: #006600;">removeChild</span><span style="color: #66cc66;">&#40;</span>obj<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> tooltip = dojo.<span style="color: #006600;">widget</span>.<span style="color: #006600;">createWidget</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'tooltip'</span>, 
		<span style="color: #66cc66;">&#123;</span> 
		caption: content, 
		connectId: target_id 
		<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	tooltip.<span style="color: #006600;">domNode</span>.<span style="color: #006600;">id</span> = <span style="color: #3366CC;">'tt_'</span>+target_id;
	document.<span style="color: #006600;">body</span>.<span style="color: #006600;">appendChild</span><span style="color: #66cc66;">&#40;</span>tooltip.<span style="color: #006600;">domNode</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>You might notice that we are actually adding an ID to the tooltip. This allows us to check in the future if that tooltip has already been created. If it has, the code above will destroy it and create a new tooltip in its place.  This should assist those searching for answers about dynamically creating dojo tooltip widgets.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.azrotech.com/blog/2007/06/19/dynamic-dojo-tooltips/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Apple, you beautiful company</title>
		<link>http://www.azrotech.com/blog/2007/06/12/apple-you-beautiful-company/</link>
		<comments>http://www.azrotech.com/blog/2007/06/12/apple-you-beautiful-company/#comments</comments>
		<pubDate>Tue, 12 Jun 2007 07:51:48 +0000</pubDate>
		<dc:creator>rgillette</dc:creator>
		
		<category><![CDATA[Web Standards]]></category>

		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.azrotech.com/blog/2007/06/12/apple-you-beautiful-company/</guid>
		<description><![CDATA[Apple has done it again. They seem to be on a non-stop war path to take over every aspect of computing and make it just a little bit cooler.  This time, they are diving straight into the browser war with the release Safari 3 for Windows.  I have been using it all day [...]]]></description>
			<content:encoded><![CDATA[<p>Apple has done it again. They seem to be on a non-stop war path to take over every aspect of computing and make it just a little bit cooler.  This time, they are diving straight into the browser war with the release <a href="http://www.apple.com/safari">Safari 3 for Windows</a>.  I have been using it all day and am wowed at the correctness of its rendering.  It even passed the <a href="http://www.webstandards.org/action/acid2/">Acid2 Test</a> with flying colors.</p>
<p>The Acid2 Test was developed by the <a href="http://www.webstandards.org/">Web Standards Project</a> as a means to help vendors test their browsers so that they are compliant with Web Standards.  For a good laugh, try the Acid2 test with IE6 or IE7 (either one, they both render it terribly).</p>
<p>Also, Steve Jobs showed off the upcoming <a href="http://www.apple.com/macosx/leopard/">Mac OS 10.5 (Leopard)</a> at the WWDC and it looks absolutely incredible.  I need not explain it here, just check out the link and prepare to be amazed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.azrotech.com/blog/2007/06/12/apple-you-beautiful-company/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Technological Brew</title>
		<link>http://www.azrotech.com/blog/2007/06/12/technological-brew/</link>
		<comments>http://www.azrotech.com/blog/2007/06/12/technological-brew/#comments</comments>
		<pubDate>Tue, 12 Jun 2007 07:37:52 +0000</pubDate>
		<dc:creator>rgillette</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[Misc]]></category>

		<category><![CDATA[Ruby on Rails]]></category>

		<category><![CDATA[Django]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.azrotech.com/blog/2007/06/12/technological-brew/</guid>
		<description><![CDATA[So it&#8217;s been awhile since the last post and you may or may not be curious as to what the tech-savvy folks at AzroTech have been up to.
One of the key focuses of our research has been making the switch from PHP to one of the cool new Web 2.0 frameworks/languages for all of our [...]]]></description>
			<content:encoded><![CDATA[<p>So it&#8217;s been awhile since the last post and you may or may not be curious as to what the tech-savvy folks at AzroTech have been up to.</p>
<p>One of the key focuses of our research has been making the switch from PHP to one of the cool new Web 2.0 frameworks/languages for all of our future (and top secret) web apps.  The two contenders are <a href="http://www.djangoproject.com">Django</a> (Python-based) and <a href="http://www.rubyonrails.org">Ruby on Rails</a> (Ruby-based {as you might have assumed&#8230;}).  We are still torn, but a decision will be reached quite soon.</p>
<p>Also, we have been hard at work developing a new Javascript framework to clean up many of the namespace polluting functions that we already have.  Yes, we are ashamed it took this long, but at least we are making the leap.</p>
<p>Aside from the all of the projects we are working on for our many happy and wonderful clients, we have begun strategizing a fresh new AzroTech Update.  It is going to be even more amazingly simple to use and will also allow for portability.  That means you can still enjoy the benefits of AZ Update even if you don&#8217;t host with us.</p>
<p>Finally, do yourself a favor and add the AzroTech blog to your RSS aggregator.  We are launching a new initiative to blog every day with updates and technical issues we run into while doing what we do.  We will include topics from database development, new technologies, C#, PHP, Ruby, Python, CSS, and web standards. Tune in and enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.azrotech.com/blog/2007/06/12/technological-brew/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The importance of properly formatted code</title>
		<link>http://www.azrotech.com/blog/2007/04/16/6/</link>
		<comments>http://www.azrotech.com/blog/2007/04/16/6/#comments</comments>
		<pubDate>Mon, 16 Apr 2007 18:33:12 +0000</pubDate>
		<dc:creator>rgillette</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.azrotech.com/blog/2007/04/16/6/</guid>
		<description><![CDATA[When I started programming well over a decade ago, my first language was BASIC.  It was a fun and cute little language where line numbers were not optional and formatting was never a concern (I&#8217;m not even sure how you could format it).
Eventually I found my home in a real language, C.  It [...]]]></description>
			<content:encoded><![CDATA[<p>When I started programming well over a decade ago, my first language was BASIC.  It was a fun and cute little language where line numbers were not optional and formatting was never a concern (I&#8217;m not even sure how you could format it).</p>
<p>Eventually I found my home in a real language, C.  It was then that I was first confronted with the issue of formatting.  My early code looked a little like this (and yes, I&#8217;m ashamed):</p>

<div class="wp_syntax"><div class="code"><pre class="c"><span style="color: #993333;">static</span> <span style="color: #993333;">void</span> testfunc<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
<span style="color: #993333;">int</span> j = <span style="color: #cc66cc;">0</span>;
&nbsp;
<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> i=<span style="color: #cc66cc;">0</span>; i&lt;<span style="color: #cc66cc;">50</span>; i++<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
j = i + j;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>My thought at the time was, &#8220;I&#8217;m smart enough to be able to read this code and decipher it later.&#8221;  My ignorance shined clearly a few months later when I went back in search of a previously written function and found it almost impossible to alter (because it was about a hundred lines worth of code formatted like the example above).</p>
<p>However, this post is not about my ignorance as a young programmer, but rather an attempt to pass on a type of code formatting that I, and all of the others at AzroTech, have found quite clean and the most readable over any other type of formatting we have played around with.  <strong>NOTE</strong>:  I do not maintain this is the BEST way of code formatting nor do I pretend to be the first or only person to do it this way, but rather I wish to share with others what works so well for us.</p>
<p>My college professor, a man named Dr. Eland was the first one to show the differences in code formatting and we were actually required to write our code his way (which is the way I want to show you).  He gave us three examples of code formatting, which I will show using the PHP language.</p>
<p>Example 1:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000000; font-weight: bold;">function</span> testfunc<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
   <span style="color: #0000ff;">$j</span> = <span style="color: #cc66cc;">0</span>;
&nbsp;
   <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$i</span>=<span style="color: #cc66cc;">0</span>; <span style="color: #0000ff;">$i</span>&lt;<span style="color: #cc66cc;">50</span>; <span style="color: #0000ff;">$i</span>++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0000ff;">$j</span> = <span style="color: #0000ff;">$i</span> + j;
      <span style="color: #000066;">echo</span> <span style="color: #0000ff;">$j</span>;
   <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Example 2:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000000; font-weight: bold;">function</span> testfunc<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
   <span style="color: #0000ff;">$j</span> = <span style="color: #cc66cc;">0</span>;
&nbsp;
   <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$i</span>=<span style="color: #cc66cc;">0</span>; <span style="color: #0000ff;">$i</span>&lt;<span style="color: #cc66cc;">50</span>; <span style="color: #0000ff;">$i</span>++<span style="color: #66cc66;">&#41;</span> 
   <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0000ff;">$j</span> = <span style="color: #0000ff;">$i</span> + j;
      <span style="color: #000066;">echo</span> <span style="color: #0000ff;">$j</span>;
   <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Example 3:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000000; font-weight: bold;">function</span> testfunc<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
   <span style="color: #66cc66;">&#123;</span>
   <span style="color: #0000ff;">$j</span> = <span style="color: #cc66cc;">0</span>;
&nbsp;
   <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$i</span>=<span style="color: #cc66cc;">0</span>; <span style="color: #0000ff;">$i</span>&lt;<span style="color: #cc66cc;">50</span>; <span style="color: #0000ff;">$i</span>++<span style="color: #66cc66;">&#41;</span> 
      <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0000ff;">$j</span> = <span style="color: #0000ff;">$i</span> + j;
      <span style="color: #000066;">echo</span> <span style="color: #0000ff;">$j</span>;
      <span style="color: #66cc66;">&#125;</span>
   <span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>From a majority of the source code that I have read from other programmers, <em>Example 1</em> is by far the most commonly used formatting out there (and in my opinion the WORST). The problem with this type of code formatting is that the curly braces are not even and it becomes very difficult to match up braces (at least until you train yourself to read code like an alien). Our professor explained to us that code formatted like this was born back when keeping file sizes down was a concern. I would say that it’s worth to take the extra space to avoid this type of formatting!</p>
<p><em>Example 2</em> bring us closer to better formatting, but it too has a drawback.  It does address the issue of matching up braces but fails to truly express the logical hierarchy of the code.  For example, what I mean by this statement is that the code within a function, called a code block, should be thought of as a child of that function.  When your eyes are scanning through thousands of lines of code, you are generally searching by a function&#8217;s identifier and not it&#8217;s underlying code.  When you are searching, the braces directly under the function declaration header will make it difficult to differentiate between the header and the code block.</p>
<p>Out of all of these methods, <em>Example 3 </em>is the way we prefer to do it at AzroTech.  It provides the best of both of the previous examples:  matched braces and differentiation between the header and the code.  Programming can be difficult enough at times and by formatting our code this way, we have never struggled trying to determine which code blocks belong where.  Like my professor years ago, I require our programmers to use this method of code formatting.</p>
<p>Properly formatted code can make you a better programmer!  It would be nice if the whole world could just trust us an try programming this way for at least 30 days, but I know that probably isn&#8217;t going to happen.  This whole post is not intended to be a rant but rather a glimpse into the development techniques of AzroTech.  Hope you enjoyed it!  <img src='http://www.azrotech.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.azrotech.com/blog/2007/04/16/6/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
