<?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>devexp &#187; code</title>
	<atom:link href="http://www.devexp.eu/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.devexp.eu</link>
	<description>DEVelopment EXPerience, shared with the world!</description>
	<lastBuildDate>Fri, 28 Oct 2011 12:07:45 +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>Comments to the max</title>
		<link>http://www.devexp.eu/2009/04/22/comments-to-the-max/</link>
		<comments>http://www.devexp.eu/2009/04/22/comments-to-the-max/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 14:32:25 +0000</pubDate>
		<dc:creator>van Rumste Kenneth</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[javadoc]]></category>
		<category><![CDATA[phpdoc]]></category>

		<guid isPermaLink="false">http://www.devexp.eu/?p=671</guid>
		<description><![CDATA[I was wondering around on the big wide scary web and saw a lot of badly written comment for code so I thought it shouldn&#8217;t be bad to give a little overview on how comment should be written, at least &#8230; <a href="http://www.devexp.eu/2009/04/22/comments-to-the-max/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>I was wondering around on the big wide scary web and saw a lot of badly written comment for code so I thought it shouldn&#8217;t be bad to give a little overview on how comment should be written, at least how I think it should be written.</p>
<p>Not all comments can be written in the same way and not all comments can be read by other programs but I personally think the Java comment is the most readable one, and (huge advantage) can be read by the Javadoc processor. When writing in PHP this is done in the same way as PHPDoc is an adaptation of Javadoc.</p>
<p>So write your comment like this:</p>
<pre class="brush: php; title: ; notranslate">

/**
 * This is a basic description of your method,
 * write down here what the function does in general
 *
 *@param integer $id
 *@return array Array of objects
 *@author Kenneth van Rumste
 */
</pre>
<p><span id="more-671"></span></p>
<p>As you can see we have the general description of a method first, written in a few words. Only write more if this is really necessary. Comments are there to help when the developer doesn&#8217;t understand the code and everybody should keep in mind that the name of a method should contain the basic information about what&#8217;s happing inside. For example don&#8217;t use methodName1 for a method, but retrieveDailyUsers to select the daily users. So you don&#8217;t need a lot of extra comment to explain what is happening, Jeff Atwood (Coding Horror) wrote a great post last year on the<a href="http://www.codinghorror.com/blog/archives/001150.html" target="_blank"> usage of comments</a>.</p>
<p>In the second part you can see a bunch of tags added into the comment, these are very handy when writing code as they inform parsers how to display documentation and allow IDE to define variable types.</p>
<p>I added only the basic data to the comment and a lot more tags can be added but as I m a lazy guy you can check them all out <a href="http://en.wikipedia.org/wiki/PHPDoc" target="_blank">here</a><a href="http://en.wikipedia.org/wiki/PHPDoc"></a>.</p>
<p>To finish this post let us take a look at some of my all time favorite, comment jokes</p>
<pre class="brush: php; title: ; notranslate">

stop(); // Hammertime!

Catch (Exception e) {  
//who cares?
}   

Exception up = new Exception(&quot;Something is really wrong.&quot;);

throw up;  //ha ha   

doRun.run();  // ... &quot;a doo run run&quot;.   

long long ago; /* in a galaxy far far away */   

/////////////////////////////////////// this is a well commented line

//Abandon all hope yea who enter beyond this point   

//Woulda
if(x) {}
//Shoulda
else if(y) {}
//Coulda
else {}   

/* This isn't the right way to deal with this,
but today is my last day, Ron just spilled coffee on my desk,
and I'm hungry, so this will have to do... */
return 12; // 12 is my lucky number   

#define TRUE FALSE //Happy debugging suckers   

// TODO - Comment this function
</pre>
<div class="shr-publisher-671"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.devexp.eu/2009/04/22/comments-to-the-max/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Complexity in webdesign</title>
		<link>http://www.devexp.eu/2009/03/18/complexity-in-webdesign/</link>
		<comments>http://www.devexp.eu/2009/03/18/complexity-in-webdesign/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 16:31:00 +0000</pubDate>
		<dc:creator>van Rumste Kenneth</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Layout]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[less]]></category>
		<category><![CDATA[more]]></category>
		<category><![CDATA[toilet]]></category>

		<guid isPermaLink="false">http://www.devexp.eu/?p=449</guid>
		<description><![CDATA[Ever heard of &#8216;less is more&#8217;? This is, more than ever, a standard that every developer should follow while designing his new website. Why the f* would I start talking about that, you can ask yourself. Well, the answer is &#8230; <a href="http://www.devexp.eu/2009/03/18/complexity-in-webdesign/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img class="alignright size-full wp-image-460" style="margin: 5px;" title="office-toilet" src="http://www.devexp.eu/wp-content/uploads/2009/03/office-toilet.jpg" alt="office-toilet" width="300" />Ever heard of &#8216;less is more&#8217;? This is, more than ever, a standard that every developer should follow while designing his new website. Why the f* would I start talking about that, you can ask yourself. Well, the answer is quite simple, as I was going to the toilet earlier this day and was in deep thoughts with the question: why isn&#8217;t everything designed and created as simple as a toilet room?</p>
<p>This is one of the only rooms and spaces in the world where you only find exactly what you need for the job and nothing else. No rubbish, no extra stupid information, just 3 simple things: a toilet, toilet paper and a little sink to wash your hands. These 3 things can easily be compared to 3 actions: brew, act, finish.</p>
<p><span id="more-449"></span></p>
<p>The same structure should be kept in mind when creating a website. Each page should contain only the information exactly needed without mixing up different parts together to one big pile of sh*t. Users don&#8217;t find the good or simplest way to the data they need. You would think that this is a very simple rule, but a lot of designers and organizations seem to forget this, so please, take your time while designing.</p>
<p>How can you do that?</p>
<p>A good idea doesn&#8217;t mean that your site will be a great success; you have to think it trough. You can start by taking your time to do a good analysis of the idea, work out the big lines before thinking of the details. Write down the major goals of the site and use them along the way to stay on the correct path. Split your site up into 5-6 major pieces as they will be the menu of your site, and be sure that this is a good structure. There is nothing more annoying for a developer then changing of big parts as they are in code named the same way.</p>
<p>For example, if one part of your site is called &#8216;Contact&#8217;, and after 3 months of development you decide to call this part of the site &#8216;About&#8217;, all code that the viewer doesn&#8217;t see will still be referred to as Contact.<br />
2 options for a developer in this case, you can stop bothering yourself and don&#8217;t do any changes or change all contact to about, spend a lot of time doing this, but get a better result. I guess you see the picture why this is important.</p>
<p>In the frontend (for designers) this is actually the same story. Try to create a view (without design) where you should place every part, and be sure about the positioning, as this is very frustrating for a designer if this changes after designing the layout. A template and/or layout is often created for or in function of specific parts on each page, so if they are replaced, your page could easily get another layout and impression.</p>
<p>Try to put only the necessary content on each page, the only thing that can be put in a page besides the data are links to other parts of the site. Don&#8217;t put products on about pages; don&#8217;t put contact information on a product page. If I wanted the contact information, I would&#8217;ve clicked the contact button.</p>
<p>Try to keep these things in mind as they will ease up the path to a simple, clean website and only correct data will be displayed because: less is more!!!</p>
<div class="shr-publisher-449"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.devexp.eu/2009/03/18/complexity-in-webdesign/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

