<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">

  <channel>
	<title>Alfonso Jiménez</title>
	<link>http://www.alfonsojimenez.com</link>
	<description>El somni d'una nit d'estiu</description>
	<pubDate>Mon, 06 Oct 2008 08:28:50 GMT</pubDate>
	<generator>http://www.alfonsojimenez.com</generator>

	
    <item>
      <title><![CDATA[10 ways to demotivate your team]]></title>
      <link>http://www.alfonsojimenez.com/2008/09/28-10-ways-to-demotivate-your-team</link>
      <pubDate>Sun, 28 Sep 2008 18:56:36 GMT</pubDate>
      <author>alfonso</author>
      <description><![CDATA[<p><img src="http://www.alfonsojimenez.com/images/2008/09/unmotivated.jpg" class="centro" alt="Unmotivated" /></p>
<ol>
<li>Set up impossible deadlines.</li>
<li>Let them work overtime.</li>
<li>Don&#8217;t allow breaks.</li>
<li>Place a ban on laughing.</li>
<li>Break the coffee machine.</li>
<li>Don&#8217;t shield them from the dirty daily business.</li>
<li>Don&#8217;t challenge them.</li>
<li>Underpay them.</li>
<li>Bribe them.</li>
<li>Infiltrate a team member who is demotivated anyway.</li>
</ol>
<p>Seen on <a href="http://klimek.box4.net/blog/2006/12/20/top-10-ways-to-demotivate-your-programming-team/">Manuel Klimex</a>
</p>
]]></description>
    </item>
	
    <item>
      <title><![CDATA[Google 404]]></title>
      <link>http://www.alfonsojimenez.com/2008/08/27-google-404</link>
      <pubDate>Wed, 27 Aug 2008 10:44:33 GMT</pubDate>
      <author>alfonso</author>
      <description><![CDATA[<p>I gotta say, I had thought this before. <strong>Google</strong> provides a new way to enhance 404 pages. If our visitors get a <em>not found</em> error, we can give them some alternatives using a simple Google snippet. This code provides the <strong>closest match</strong> (for the URL) and other things to try such as search into the site. This is useful information designed to help them find the information the users need.</p>
<p><img src="http://www.alfonsojimenez.com/images/2008/08/google404.jpg" class="centro_sinmarco" alt="Google 404 Pages" /></p>
<p>You can read more about it on the <a href="http://googlewebmastercentral.blogspot.com/2008/08/make-your-404-pages-more-useful.html" title="Google 404 Pages">Official Google Webmaster Blog</a>.
</p>
]]></description>
    </item>
	
    <item>
      <title><![CDATA[Closed for holidays]]></title>
      <link>http://www.alfonsojimenez.com/2008/07/30-closed-for-holidays</link>
      <pubDate>Wed, 30 Jul 2008 16:14:03 GMT</pubDate>
      <author>alfonso</author>
      <description><![CDATA[<p>Closed for <strong>holidays</strong>. I&#8217;ll be in <strong>Japan</strong> until 15th August. I think I deserve a rest. Up until then, have a lovely summer.</p>
<p><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/6d/Japan_flag_-_variant.png/800px-Japan_flag_-_variant.png" style="width:450px" class="centro" alt="Japan" />
</p>
]]></description>
    </item>
	
    <item>
      <title><![CDATA[Multiple Constructors in PHP]]></title>
      <link>http://www.alfonsojimenez.com/2008/07/29-multiple-constructors-in-php</link>
      <pubDate>Tue, 29 Jul 2008 20:02:25 GMT</pubDate>
      <author>alfonso</author>
      <description><![CDATA[<p><img src="http://www.alfonsojimenez.com/images/2008/07/bob.jpg" class="izquierda_sinmarco" alt="Bob the builder" />As you probably know, it&#8217;s possible to have multiple constructors in Java. They need to have the same name as the class, and they can only be distinguished by the number and type of arguments. In PHP5, you can only have <strong>one constructor</strong>. You can define it using the reserved word <em>__construct</em>. If the <em>__construct</em> function doesn&#8217;t exist, PHP5 will search for the old-style constructor function (by the name of the class). So if we cannot have multiple constructors, how could we create objects with different initial conditions? It&#8217;s not a big deal. There&#8217;s a pattern called <strong>Factory Method</strong>, which <strong>defines <em>virtual</em> constructors using static methods</strong>. Let&#8217;s see an example:</p>
<pre class="code"><code>
class Person
{
    private $name;
    private $email;

    public static function withName($name)
    {
        $person       = new Person();
        $person->name = $name;

        return $person;
    }

    public static function withEmail($email)
    {
        $person        = new Person();
        $person->email = $email;

        return $person;
    }

    public static function fullPerson($name, $email)
    {
        $person        = new Person();
        $person->name  = $name;
        $person->email = $email;

        return $person;
    }
}
</code></pre>
<p>We have a class called <strong>Person</strong> which contains 2 private attributes: <strong>name</strong> and <strong>email</strong>. It also has 3 static methods: <strong>withName</strong>, <strong>withEmail</strong> and <strong>fullPerson</strong>. These methods will behave like constructors.</p>
<p>So if we want to create a Person object just with the name value, we can do it using the following statement:</p>
<pre class="code">
<code>
$person = Person::withName('Example');
</code>
</pre>
]]></description>
    </item>
	
    <item>
      <title><![CDATA[7 tips to write intelligible code]]></title>
      <link>http://www.alfonsojimenez.com/2008/07/27-7-tips-to-write-intelligible-code</link>
      <pubDate>Sun, 27 Jul 2008 11:52:41 GMT</pubDate>
      <author>alfonso</author>
      <description><![CDATA[<p><img src="http://www.alfonsojimenez.com/images/2008/07/php_logo.jpg" alt="PHP" class="derecha_sinmarco" />Writing <strong>intelligible code</strong> helps to increase the productivity of a developing team, even if you are an independent worker. Why is it so important to write intelligible code? How can it improve the productivity of my team? A messed up code could delay your partners understanding, or it could create a barrier for new developers. Even trying to understand your own code could be a real challenge as well. Here are 7 tips of how to make more <strong>intelligible PHP code</strong> (<em>coding style tips</em>):</p>
<ol>
<li><strong>75-85 characters per line</strong>: Each line must contains approximately 75-85 characters. If a line exceeds more than 85 characters, consider splitting the line into multiple lines. It will be helpful for code readability. You can see a great post on this topic in <a href="http://paul-m-jones.com/?p=276">Paul Jones&#8217; blog</a>. He talks about why this limitation is not really arbitrary, and he puts some brilliant examples such as this one:
<p><em>Bad</em></p>
<pre style="overflow: scroll;"><code>list($foo, $bar, $baz) = array(Zim::getVal('foo'), Dib::getVal('bar'), Gir::getVal('baz', Gir::DOOM));
</code></pre>
<p><em>Good</em></p>
<pre><code>$foo = Zim::getVal('foo');
$bar = Dib::getVal('bar');
$baz = Gir::getVal('baz', Gir::DOOM);
</code></pre>
</li>
<li><strong>Assignment statements</strong>: Assignment statements ought be aligned for better readability. Let&#8217;s see an example:
<p><em>Bad</em></p>
<pre class="code"><code>
$example = 'string_value';
$anotherExample = 42;
$exampleInst = new ExampleClass();
</code></pre>
<p><em>Good</em></p>
<pre class="code"><code>
$example        = 'string_value';
$anotherExample = 42;
$exampleInst    = new ExampleClass();
</code></pre>
</li>
<li><strong>4-spaces block indentation</strong>: Use an indent of 4 spaces with no tabs. It helps to avoid problems with diffs, patches and SVN history. It helps the readability as well. Usually tabs are 8 spaces length, which means a 5th-block indent starts 40 spaces from the left border (nearly to 50% of a code line).<br />
<pre class="code">
<code>
{block1}
    {block2}
        {block3}
            ...
</code>
</pre>
</li>
<li>
<strong>Control &#038; conditional structures</strong>: These statements must have <em>one space</em> between the control keyword (if, else, for, while, &#8230;) and the opening parenthesis, to distinguish them from function calls (which obviously don&#8217;t have a space). It&#8217;s nice to always use curly braces because they help to decreases the likelihood of logic errors.</p>
<pre class="code">
<code>
if ($display === 1) {
    while ($obj->next()) {
        echo $obj->toString();
    }
}
</code>
</pre>
</li>
<li>
<strong>Class and function/methods declarations</strong>: Class and function/methods declarations have their opening brace on a new line.</p>
<pre class="code"><code>
class Foo
{
    private $_obj;

    public function __construct($obj)
    {
        $this->_obj = $obj;
    }
}
</code></pre>
</li>
<li><strong>Comma-space between items of a list</strong>: When we list some items, it&#8217;s nice to separate them clearly with a comma followed by a space.
<p><em>BAD</em></p>
<pre class="code"><code>
$example = array(Foo::get('key',2),$value,true);
</code></pre>
<p><em>GOOD</em></p>
<pre class="code"><code>
$example = array(Foo::get('key', 2), $value, true);
</code></pre>
</li>
<li><strong>Use constants properly</strong>: If we have a method which returns some status codes, it&#8217;s nice to use literal constants. Having descriptive constants helps to make better intelligible code. For example:
<p><em>BAD</em></p>
<pre class="code"><code>
class Foo
{
    public static function getStatus()
    {
        $res = 0;

        if (!self::isValid()) {
            $res = 1;
        }
        ...

        if ($res === 0 &#038;&#038; self::isRepeated()) {
            $res = 2;
        }

        return $res;
    }
}
</code></pre>
<p><em>GOOD</em></p>
<pre class="code"><code>
class Foo
{
    const STATUS_SUCCESS  = 0;
    const STATUS_FAILURE  = 1;
    const STATUS_REPEATED = 2;

    public static function getStatus()
    {
        $res = self::STATUS_SUCCESS;

        if (!self::isValid()) {
            $res = self::STATUS_FAILURE;
        }

        ...

        if ($res === self::STATUS_SUCCESS &#038;&#038; self::isRepeated()) {
            $res = self::STATUS_REPEATED;
        }

        return $res;
    }
}
</code></pre>
</li>
</ol>
<p>These tips are just some <em>coding style tips</em>. If we really want to write intelligible code, we would keep in mind many more things like to use software patterns, to make use of well established software practises, &#8230;
</p>
]]></description>
    </item>
	
    <item>
      <title><![CDATA[Has Google acquired Digg?]]></title>
      <link>http://www.alfonsojimenez.com/2008/07/23-has-google-acquired-digg</link>
      <pubDate>Wed, 23 Jul 2008 09:58:42 GMT</pubDate>
      <author>alfonso</author>
      <description><![CDATA[<p>Has <strong>Google</strong> acquired <strong>Digg</strong> for 200 millions dollars? Michael Arrington has written a post on <a href="http://www.techcrunch.com/2008/07/22/google-in-final-negotiations-to-acquire-digg-for-around-200-million/" rel="nofollow">TechCrunch</a> saying that both companies have reached an agreement for around 200 millions dollars. The popular social bookmarking site would become part of <strong>Google News</strong> property.</p>
<p><img src="http://www.alfonsojimenez.com/images/2008/07/digg.jpg" class="centro" alt="Digg" />
</p>
]]></description>
    </item>
	
    <item>
      <title><![CDATA[Plurk, your life on the line]]></title>
      <link>http://www.alfonsojimenez.com/2008/06/20-plurk-your-life-on-the-line</link>
      <pubDate>Fri, 20 Jun 2008 12:37:57 GMT</pubDate>
      <author>alfonso</author>
      <description><![CDATA[<p><img src="http://www.alfonsojimenez.com/images/2008/06/plurk.png" title="Plurk" class="centro" /></p>
<p><a href="http://plurk.com" title="Plurk">Plurk</a> is a new microblogging based application. It lets to publish from texts (140 characters) to multimedia files such as pictures and videos. The most revolutionary feature that <strong>Plurk</strong> brings to us is the <strong>original timeline</strong>. When you take up using it, it can be a bit confusing, but you can get used quickly. I like how the system let the user knows new updates as well. I think <strong>Plurk</strong> could be a nice alternative to <strong>Twitter</strong>, but I have some questions:</p>
<ul>
<li>Why don&#8217;t they make a search engine for users? When you start using <strong>Plurk</strong>, it&#8217;s complicated to find friends</li>
<li>Why don&#8217;t they let upload ours own files directly onto the system?</li>
</ul>
<p>You can follow me on <a href="http://plurk.com/user/alfonsojimenez" title="Plurk">http://plurk.com/user/alfonsojimenez</a>
</p>
]]></description>
    </item>
	
    <item>
      <title><![CDATA[HDR time-lapse]]></title>
      <link>http://www.alfonsojimenez.com/2008/06/19-hdr-time-lapse</link>
      <pubDate>Thu, 19 Jun 2008 17:22:25 GMT</pubDate>
      <author>alfonso</author>
      <description><![CDATA[<p>This is a <strong>High Dynamic Range time-lapse </strong> from <em>Goblins State Park</em> in Utah (USA). It is very nice <img src='http://www.alfonsojimenez.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div style="text-align:center; margin-bottom: 20px"><object width="420" height="336"><br />
<param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=1098826&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowScriptAccess" value="always"></param><embed src="http://www.vimeo.com/moogaloop.swf?clip_id=1098826&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1 type="application/x-shockwave-flash" width="420" height="336" allowFullScreen="true" allowScriptAccess="always"></embed></object></div>
]]></description>
    </item>
	
    <item>
      <title><![CDATA[Simplemente tú]]></title>
      <link>http://www.alfonsojimenez.com/2008/06/19-simplemente-tu</link>
      <pubDate>Thu, 19 Jun 2008 07:38:36 GMT</pubDate>
      <author>alfonso</author>
      <description><![CDATA[<p>Te voy a escribir lo más bonito que he escrito en mi vida, porque simplemente eres lo más bonito que me ha pasado. Desde aquella noche en que me besaste, no ha habido ningún día en el que no haya pensado en ti. Eres mi pasado, mi presente y mi futuro, te llevo en mi mente y corazón a todas partes.</p>
<p>Pienso en ti cuando estoy triste y cuando estoy feliz, cuando me siento arropado y cuando me siento solo, cuando río y cuando lloro, cuando gano y cuando pierdo, tú siempre estás ahí. Eres la estrella que me guía, mi razón de ser, el motivo por el cual merece la pena vivir.</p>
<p>Cuando no estoy contigo me siento perdido, necesito tu presencia. Echo de menos los pequeños detalles que me das cada día; el latido de tu corazón, los abrazos de media noche, el aliento de tu boca cuando me besas cada mañana, el brillo de tus ojos verdes, cuando me dices <em>I love you baby</em>, tu dorada melena al caer el sol, tu bella sonrisa, y es que echo de menos hasta el aire que respiras. Aunque tal vez no puedas enteder todas estas palabras, no te preocupes cariño, que yo te las explico con el lenguaje de mis besos.</p>
<p><img src="http://www.alfonsojimenez.com/images/2008/06/alexandra_alfonso.jpg" alt="Alexandra Storey and Alfonso Jimenez" class="centro" />
</p>
]]></description>
    </item>
	
    <item>
      <title><![CDATA[PHE08 y Cámara Abierta 2.0: El lugar del Internauta]]></title>
      <link>http://www.alfonsojimenez.com/2008/06/06-phe08-y-camara-abierta-20-el-lugar-del-internauta</link>
      <pubDate>Fri, 06 Jun 2008 08:25:22 GMT</pubDate>
      <author>alfonso</author>
      <description><![CDATA[<p><a href="http://farm3.static.flickr.com/2337/2279395527_c6e2096583_o.jpg" title="Intruder"><img src="http://farm3.static.flickr.com/2337/2279395527_b47a96cf2d.jpg?v=0" alt="Intruder" class="centro" /></a>
</p>
]]></description>
    </item>
	

  </channel>
</rss>
