<?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>cakebaker &#187; code</title>
	<atom:link href="http://cakebaker.42dh.com/tags/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Tue, 20 Dec 2011 15:29:40 +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>What code and presents have in common</title>
		<link>http://cakebaker.42dh.com/2008/12/24/what-code-and-presents-have-in-common/</link>
		<comments>http://cakebaker.42dh.com/2008/12/24/what-code-and-presents-have-in-common/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 16:25:00 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[christmas]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1028</guid>
		<description><![CDATA[A part of the magic of Christmas is to give and receive presents. Though, often it not only matters what the present actually is but also how it is wrapped. I know, this is a bit irrational. On the other hand, it shows you whether someone cares about the entire experience (and if you give [...]]]></description>
			<content:encoded><![CDATA[<p>A part of the magic of Christmas is to give and receive presents. Though, often it not only matters what the present actually is but also how it is wrapped. I know, this is a bit irrational. On the other hand, it shows you whether someone cares about the entire experience (and if you give a present it simply feels much better to give a nicely wrapped present than a carelessly wrapped present). </p>
<p>As the title suggests, this post is not only about presents, but also about code. On a first view it looks like they don&#8217;t have anything in common. However, the code you write is a present you give to others (and often to yourself if you maintain the code). And the code written by others is a present from those people to you. The present itself is the functionality of the code, and the wrapping is how the code looks like. So, how do you wrap your (code) presents?</p>
<p>Merry Christmas, to those who celebrate it, and have a nice time!</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2008/12/24/what-code-and-presents-have-in-common/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Use a convention to structure your code</title>
		<link>http://cakebaker.42dh.com/2007/09/24/use-a-convention-to-structure-your-code/</link>
		<comments>http://cakebaker.42dh.com/2007/09/24/use-a-convention-to-structure-your-code/#comments</comments>
		<pubDate>Mon, 24 Sep 2007 09:11:17 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[convention]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/09/24/use-a-convention-to-structure-your-code/</guid>
		<description><![CDATA[One feature I like in Eclipse is the outline view which shows you the structure (i.e. the variables and methods) of the file you edit and allows you to jump quickly to those code elements (see image). To use this feature efficiently it makes sense to use a convention to structure your code (the example [...]]]></description>
			<content:encoded><![CDATA[<p>One feature I like in <a href="http://www.eclipse.org/pdt">Eclipse</a> is the outline view which shows you the structure (i.e. the variables and methods) of the file you edit and allows you to jump quickly to those code elements (see image). </p>
<p><img src='http://cakebaker.42dh.com/wp-content/uploads/2007/09/eclipse_outline.png' alt='Outline view' /></p>
<p>To use this feature efficiently it makes sense to use a convention to structure your code (the example in the image is unstructured hence it is more difficult to find a certain method). And even if your IDE doesn&#8217;t provide such a feature it makes sense to follow a convention as it makes your code more cleaner. </p>
<p>The convention I use is simple: first public stuff, then private stuff, both ordered alphabetically. So a CakePHP file may look like:</p>
<pre>
class A {
    var $a = ...
    var $z = ...
    var $__a = ...
    var $__z = ...

    function a() {}

    function z() {}

    function __a() {}

    function __z() {}
}
</pre>
<p>Especially if you have larger files it helps to avoid that you get a messy code structure. And it doesn&#8217;t require any additional effort. </p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2007/09/24/use-a-convention-to-structure-your-code/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

