<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Pablo&#039;s blog &#187; programming</title>
	<atom:link href="http://pupeno.com/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://pupeno.com</link>
	<description>A bit of this, a bit of that and a lot about computers</description>
	<lastBuildDate>Wed, 15 Feb 2012 08:39:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='pupeno.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/57ca76f9fb1bf9d10a9dd732ea88cc57?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Pablo&#039;s blog &#187; programming</title>
		<link>http://pupeno.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://pupeno.com/osd.xml" title="Pablo&#039;s blog" />
	<atom:link rel='hub' href='http://pupeno.com/?pushpress=hub'/>
		<item>
		<title>Why I love Lisp</title>
		<link>http://pupeno.com/2011/08/16/why-i-love-lisp/</link>
		<comments>http://pupeno.com/2011/08/16/why-i-love-lisp/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 11:04:30 +0000</pubDate>
		<dc:creator>Pablo</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Lisp]]></category>
		<category><![CDATA[macros]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">https://pupeno.com/?p=2509</guid>
		<description><![CDATA[This post was extracted from a small talk I gave at Simplificator, where I work, titled &#8220;Why I love Smalltalk and Lisp&#8221;. There&#8217;s another post titled &#8220;Why I love Smalltalk&#8221; published before this one. Lisp is an old language. Very old. Today there are many Lisps and no single language is called Lisp today. Actually, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=2509&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<blockquote><p>This post was extracted from a small talk I gave at <a href="http://simplificator.com">Simplificator</a>, where I work, titled &#8220;Why I love Smalltalk and Lisp&#8221;. There&#8217;s another post titled &#8220;<a title="Why I love Smalltalk" href="http://pupeno.com/2011/07/28/why-i-love-smalltalk/">Why I love Smalltalk</a>&#8221; published before this one.</p></blockquote>
<div id="attachment_5010" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-5010" title="Desert by Guilherme Jófili" src="http://pupeno.files.wordpress.com/2011/08/desert.jpg?w=300&#038;h=199" alt="" width="300" height="199" /><p class="wp-caption-text">Desert by Guilherme Jófili</p></div>
<p>Lisp is an old language. Very old. Today there are many Lisps and no single language is called Lisp today. Actually, there are as many Lisps as Lisp programmers. That&#8217;s because you become a <em>Lisp programmer</em> when you go alone in the desert and write an interpreter for your flavor of lisp with a stick on the sand.</p>
<p>There are two main Lisps these days: <a href="http://en.wikipedia.org/wiki/Common_Lisp">Common Lisp</a> and <a href="http://en.wikipedia.org/wiki/Scheme_(programming_language)">Scheme</a>, both standards with many implementations. The various Common Lisps are more or less the same, the various Schemes are the same at the basic level but then they differ, sometimes quite significantly. They are both interesting but I personally failed to make a practical use of any of those. Both bother me in different ways, and of all the other Lisps, my favorite is <a href="http://clojure.org">Clojure</a>. I&#8217;m not going to dig into that, it&#8217;s a personal matter and it&#8217;ll take me a long time.</p>
<p>Clojure, like any other Lisp, has a REPL (Read Eval Print Loop) where we can write code and get it to run immediately. For example:</p>
<p><pre class="brush: clojure;">
5
;=&gt; 5

&quot;Hello world&quot;
;=&gt; &quot;Hello world&quot;
</pre></p>
<p>Normally you get a prompt, like <code>user&gt;</code>, but here I&#8217;m using <a href="http://pupeno.com/2011/08/12/the-joyful-clojure-example-code-convention/" title="The joyful Clojure example code convention">the joyful Clojure example code convention</a>. You can give this REPL thing a try and run any code from this post in <a href="http://try-clojure.org">Try Clojure</a>.</p>
<p>We can call a function like this:</p>
<p><pre class="brush: clojure;">
(println &quot;Hello World&quot;)
; Hello World
;=&gt; nil
</pre></p>
<p>It printed &#8220;Hello World&#8221; and returned <code>nil</code>. I know the parenthesis look misplaced but there&#8217;s a reason for that and you&#8217;ll notice it&#8217;s not that different from Javaish snippet:</p>
<p><pre class="brush: clojure;">
println(&quot;Hello World&quot;)
</pre></p>
<p>except that Clojure uses the parenthesis in that way for all operations:</p>
<p><pre class="brush: clojure;">
(+ 1 2)
;=&gt; 3
</pre></p>
<p>In Clojure we also have vectors:</p>
<p><pre class="brush: clojure;">
[1 2 3 4]
;=&gt; [1 2 3 4]
</pre></p>
<p>symbols:</p>
<p><pre class="brush: clojure;">
'symbol
;=&gt; symbol
</pre></p>
<p>The reason for the quote is that symbols are treated as variables. Without the quote, Clojure would try to find its value. Same for lists:</p>
<p><pre class="brush: clojure;">
'(li st)
;=&gt; (li st)
</pre></p>
<p>and nested lists</p>
<p><pre class="brush: clojure;">
'(l (i s) t)
;=&gt; (l (i s) t)
</pre></p>
<p>Here&#8217;s how defining a variable and using it looks like</p>
<p><pre class="brush: clojure;">
(def hello-world &quot;Hello world&quot;)
;=&gt; #'user/hello-world

hello-world
;=&gt; &quot;Hello world&quot;
</pre></p>
<p>I&#8217;m going very fast, skipping lots of details and maybe some things are not totally correct. Bear with me, I want to get to the good stuff.</p>
<p>In Clojure you create functions like this:</p>
<p><pre class="brush: clojure;">
(fn [n] (* n 2))
;=&gt; #&lt;user$eval1$fn__2 user$eval1$fn__2@175bc6c8&gt;
</pre></p>
<p>That ugly long thing is how a compiled function is printed out. Don&#8217;t worry, it&#8217;s not something you see often. That&#8217;s a function, as created by the operator <code>fn</code>, of one argument, called <code>n</code>, that multiplies the argument by two and returns the result. In Clojure as in all Lisps, the value of the last expression of a function is returned.</p>
<p>If you look at how a function is called:</p>
<p><pre class="brush: clojure;">
(println &quot;Hello World&quot;)
</pre></p>
<p>you&#8217;ll notice the pattern is, open parens, function, arguments, close parens. Or saying it in another way, a list where the first item is the operator and the rest are the arguments.</p>
<p>Let&#8217;s call that function:</p>
<p><pre class="brush: clojure;">
((fn [n] (* n 2)) 10)
;=&gt; 20
</pre></p>
<p>What I&#8217;m doing there is defining an anonymous function and applying it immediately. Let&#8217;s give that function a name:</p>
<p><pre class="brush: clojure;">
(def twice (fn [n] (* n 2)))
;=&gt; #'user/twice
</pre></p>
<p>and then we can apply it by name:</p>
<p><pre class="brush: clojure;">
(twice 32)
;=&gt; 64
</pre></p>
<p>As you can see, functions are stored in <em>variables</em> like any other piece of data. Since that&#8217;s something that&#8217;s done very often, there&#8217;s a shortcut:</p>
<p><pre class="brush: clojure;">
(defn twice [n] (* 2 n))
;=&gt; #'user/twice

(twice 32)
;=&gt; 64
</pre></p>
<p>Let&#8217;s make the function have a maximum of 100 by using an if:</p>
<p><pre class="brush: clojure;">
(defn twice [n] (if (&gt; n 50) 100 (* n 2))))
</pre></p>
<p>The if operator has three arguments, the predicate, the expresion to evaluate when the predicate is true and the one when it&#8217;s false. Maybe like this it&#8217;s easier to read:</p>
<p><pre class="brush: clojure;">
(defn twice [n]
  (if (&gt; n 50)
      100
      (* n 2)))
</pre></p>
<p>Enough basic stuff, let&#8217;s move to the fun stuff.</p>
<p>Let&#8217;s say you want to write Lisp backwards. The operator at the last position, like this:</p>
<p><pre class="brush: clojure;">
(4 5 +)
</pre></p>
<p>Let&#8217;s call this language Psil (that&#8217;s Lisp backwards&#8230; I&#8217;m so smart). Obviously if you just try to run that it won&#8217;t work:</p>
<p><pre class="brush: clojure;">
(4 5 +)
;=&gt; java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn (NO_SOURCE_FILE:0)
</pre></p>
<p>That&#8217;s Clojure telling you that <code>4</code> is not a function (an object implementing the interface <code>clojure.lang.IFn</code>).</p>
<p>It&#8217;s easy enough to write a function that converts from Psil to Lisp:</p>
<p><pre class="brush: clojure;">
(defn psil [exp]
  (reverse exp))
</pre></p>
<p>The problem is that when I try to use it, like this:</p>
<p><pre class="brush: clojure;">
(psil (4 5 +))
;=&gt; java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn (NO_SOURCE_FILE:0)
</pre></p>
<p>I obviously get an error, because before psil is called, Clojure tries to evaluate the argument, that is, <code>(4 5 +)</code> and that fails. We can call it explicitly turning the argument into a list, like this:</p>
<p><pre class="brush: clojure;">
(psil '(4 5 +))
;=&gt; (+ 5 4)
</pre></p>
<p>but that didn&#8217;t evaluate it, it just reversed it. Evaluating it is not that hard though:</p>
<p><pre class="brush: clojure;">
(eval (psil '(4 5 +)))
;=&gt; 9
</pre></p>
<p>You can start to see the power of Lisp. The fact that the code is just a bunch of nested lists allows you to easily generate running programs out of pieces of data.</p>
<p>If you don&#8217;t see it, just try doing it in your favorite language. Start with an array containing two numbers and a plus and end up with the result of adding them. You probably end up concatenating strings or doing other nasty stuff.</p>
<p>This way of programming is so common on Lisp that it was abstracted away in a reusable thing call <em>macros</em>. Macros are functions that receive the unevaluated arguments and the result is then evaluated as Lisp.</p>
<p>Let&#8217;s turn psil into a macro:</p>
<p><pre class="brush: clojure;">
(defmacro psil [exp]
  (reverse exp))
</pre></p>
<p>The only difference is that I&#8217;m now calling <code>defmacro</code> instead of <code>defn</code>. This is quite remarkable:</p>
<p><pre class="brush: clojure;">
(psil (4 5 +))
;=&gt; 9
</pre></p>
<p>Note how the argument is not valid Clojure yet I didn&#8217;t get any error. That&#8217;s because it&#8217;s not evaluated until psil processes it. The <code>psil</code> macro is getting the argument as data. When you hear people say that in Lisp code is data, this is what they are talking about. It&#8217;s data you can manipulate to generate other programs. This is what allows you to invent your own programming language on top of Lisp and have any semantics you need.</p>
<p>There&#8217;s an operator on Clojure called <code>macroexpand</code> which makes a macro skip the evaluation part so you can see what&#8217;s the code that&#8217;s going to be evaluated:</p>
<p><pre class="brush: clojure;">
(macroexpand '(psil (4 5 +)))
;=&gt; (+ 5 4)
</pre></p>
<p>You can think of a macro as a function that runs at compile time. The truth is, in Lisp, compile time and run time are all mixed and you are constantly switching between the two. We can make our psil macro very verbose to see what&#8217;s going on, but before, I have to show you <code>do</code>.</p>
<p><code>do</code> is a very simple operator, it takes a list of expressions and runs them one after the other but they are all grouped into one single expression that you can pass around, for example:</p>
<p><pre class="brush: clojure;">
(do (println &quot;Hello&quot;) (println &quot;world&quot;))
; Hello
; world
;=&gt; nil
</pre></p>
<p>With do, we can make the macro return more than one expression and to make it verbose:</p>
<p><pre class="brush: clojure;">
(defmacro psil [exp]
  (println &quot;compile time&quot;)
  `(do (println &quot;run time&quot;)
       ~(reverse exp)))
</pre></p>
<p>That new macro prints &#8220;compile time&#8221; and returns a <code>do</code> that prints<br />
&#8220;run time&#8221; and runs exp backwards. The back-tick, <code>`</code> is like the quote <code>'</code> except that allows you to unquote inside it by using the tilde, <code>~</code>. Don&#8217;t worry if you don&#8217;t understand that yet, let&#8217;s just run it:</p>
<p><pre class="brush: clojure;">
(psil (4 5 +))
; compile time
; run time
;=&gt; 9
</pre></p>
<p>As expected, compile time happens before runtime. If we use <code>macroexpand</code> things will get more clear:</p>
<p><pre class="brush: clojure;">
(macroexpand '(psil (4 5 +)))
; compile time
;=&gt; (do (clojure.core/println &quot;run time&quot;) (+ 5 4))
</pre></p>
<p>You can see that the compile phase already happened and we got an expression that will print &#8220;run time&#8221; and then evaluate <code>(+ 5 4)</code>. It also expanded <code>println</code> into its full form, <code>clojure.core/println</code>, but you can ignore that. When that code is evaluated at run time.</p>
<p>The result of the macro is essentially:</p>
<p><pre class="brush: clojure;">
(do (println &quot;run time&quot;)
    (+ 5 4))
</pre></p>
<p>and in the macro it was written like this:</p>
<p><pre class="brush: clojure;">
`(do (println &quot;run time&quot;)
     ~(reverse exp))
</pre></p>
<p>The back-tick essentially created a kind of template where the tilde marked parts for evaluating (<code>(reverse exp)</code>) while the rest was left at is.</p>
<p>There are even more surprises behind macros, but for now, it&#8217;s enough hocus pocus.</p>
<p>The power of this technique may not be totally apparent yet. Following my <a title="Why I love Smalltalk" href="http://pupeno.com/2011/07/28/why-i-love-smalltalk/">Why I love Smalltalk</a> post, let&#8217;s imagine that Clojure didn&#8217;t come with an <code>if</code>, only <code>cond</code>. It&#8217;s not the best example in this case, but it&#8217;s simple enough.</p>
<p><code>cond</code> is like a <code>switch</code> or <code>case</code> in other languages:</p>
<p><pre class="brush: clojure;">
(cond (= x 0) &quot;It's zero&quot;
      (= x 1) &quot;It's one&quot;
      :else &quot;It's something else&quot;)
</pre></p>
<p>Around <code>cond</code> we can create a function <code>my-if</code> straightforward enough:</p>
<p><pre class="brush: clojure;">
(defn my-if [predicate if-true if-false]
  (cond predicate if-true
        :else if-false))
</pre></p>
<p>and at first it seems to work:</p>
<p><pre class="brush: clojure;">
(my-if (= 0 0) &quot;equals&quot; &quot;not-equals&quot;)
;=&gt; &quot;equals&quot;
(my-if (= 0 1) &quot;equals&quot; &quot;not-equals&quot;)
;=&gt; &quot;not-equals&quot;
</pre></p>
<p>but there&#8217;s a problem. Can you spot it? <code>my-if</code> is evaluating all its arguments, so if we do something like this, the result is not as expected:</p>
<p><pre class="brush: clojure;">
(my-if (= 0 0) (println &quot;equals&quot;) (println &quot;not-equals&quot;))
; equals
; not-equals
;=&gt; nil
</pre></p>
<p>Converting <code>my-if</code> into a macro:</p>
<p><pre class="brush: clojure;">
(defmacro my-if [predicate if-true if-false]
  `(cond ~predicate ~if-true
         :else ~if-false))
</pre></p>
<p>solves the problem:</p>
<p><pre class="brush: clojure;">
(my-if (= 0 0) (println &quot;equals&quot;) (println &quot;not-equals&quot;))
; equals
;=&gt; nil
</pre></p>
<p>This is just a glimpse into the power of macros. One very interesting case was when object oriented programming was invented (Lisp is older than that) and Lisp programmers wanted to use it.</p>
<p>C programmers had to invent new languages, C++ and Objective C, with their compilers. Lisp programmers created a bunch of macros, like defclass, defmethod, etc. All thanks to macros. Revolutions, in Lisp, tend to just be evolutions.</p>
<p><em>Thanks to Gonzalo Fernández, <a href="http://twitter.com/#!/grrrisu">Alessandro Di Maria</a>, Vladimir Filipović for reading drafts of this.</em></p>
<br />Filed under: <a href='http://pupeno.com/category/technical/'>Technical</a> Tagged: <a href='http://pupeno.com/tag/clojure/'>Clojure</a>, <a href='http://pupeno.com/tag/lisp/'>Lisp</a>, <a href='http://pupeno.com/tag/macros/'>macros</a>, <a href='http://pupeno.com/tag/programming/'>programming</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pupeno.wordpress.com/2509/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pupeno.wordpress.com/2509/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pupeno.wordpress.com/2509/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pupeno.wordpress.com/2509/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pupeno.wordpress.com/2509/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pupeno.wordpress.com/2509/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pupeno.wordpress.com/2509/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pupeno.wordpress.com/2509/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pupeno.wordpress.com/2509/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pupeno.wordpress.com/2509/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pupeno.wordpress.com/2509/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pupeno.wordpress.com/2509/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pupeno.wordpress.com/2509/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pupeno.wordpress.com/2509/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=2509&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pupeno.com/2011/08/16/why-i-love-lisp/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/931970b8dc51b72e05e3a12b88612d61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Pablo</media:title>
		</media:content>

		<media:content url="http://pupeno.files.wordpress.com/2011/08/desert.jpg?w=300" medium="image">
			<media:title type="html">Desert by Guilherme Jófili</media:title>
		</media:content>
	</item>
		<item>
		<title>The joyful Clojure example code convention</title>
		<link>http://pupeno.com/2011/08/12/the-joyful-clojure-example-code-convention/</link>
		<comments>http://pupeno.com/2011/08/12/the-joyful-clojure-example-code-convention/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 05:05:15 +0000</pubDate>
		<dc:creator>Pablo</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Clojure]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[convention]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[The Joy of Clojure]]></category>

		<guid isPermaLink="false">http://pupeno.com/?p=5038</guid>
		<description><![CDATA[I started reading The Joy of Clojure, seems like a great book and I like its example code convention. I&#8217;m documenting it here because I&#8217;ll adopt it on my blog and I want to be able to link to it. I&#8217;ll call it the joyful Clojure example code convention. A simple piece of Clojure code looks like [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=5038&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/gp/product/1935182641/ref=as_li_ss_tl?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=1935182641"><img class="alignright size-thumbnail wp-image-5045" title="The Joy of Clojure" src="http://pupeno.files.wordpress.com/2011/08/the-joy-of-clojure1.jpg?w=119&#038;h=150" alt="" width="119" height="150" /></a></p>
<p>I started reading <a href="http://www.amazon.com/gp/product/1935182641/ref=as_li_ss_tl?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=1935182641">The Joy of Clojure</a>, seems like a great book and I like its example code convention. I&#8217;m documenting it here because I&#8217;ll adopt it on my blog and I want to be able to link to it. I&#8217;ll call it <a title="The joyful Clojure example code convention" href="http://pupeno.com/2011/08/12/the-joyful-clojure-example-code-convention/">the joyful Clojure example code convention</a>.</p>
<p>A simple piece of Clojure code looks like this:</p>
<p><pre class="brush: clojure;">
(* 2 10)
</pre></p>
<p>If you run it on the <a href="http://try-clojure.org/">REPL</a> it looks like this:</p>
<p><pre class="brush: clojure;">
user&gt; (* 2 10)
20
</pre></p>
<p>The first example, it&#8217;s just the code, with no return value, the second one, shows the return value, but when you have several lines it becomes cumbersome to copy and paste:</p>
<p><pre class="brush: clojure;">
user&gt; (* 2 10)
20
user&gt; (* 2 11)
22
user&gt; (* 2 12)
24
</pre></p>
<p>The Joy of Clojure code convention solves both problems by removing the prompt and leaving return values in comments:</p>
<p><pre class="brush: clojure;">
(* 2 10)
;=&gt; 20
(* 2 11)
;=&gt; 22
(* 2 12)
;=&gt; 24
</pre></p>
<p>Now you can copy and paste and still have the results.</p>
<p>If the snippet prints something, it will also be displayed but without the arrow, like this:</p>
<p><pre class="brush: clojure;">
(println &quot;Hello world&quot;)
; Hello world
;=&gt; nil
</pre></p>
<br />Filed under: <a href='http://pupeno.com/category/technical/'>Technical</a> Tagged: <a href='http://pupeno.com/tag/clojure/'>Clojure</a>, <a href='http://pupeno.com/tag/code/'>code</a>, <a href='http://pupeno.com/tag/convention/'>convention</a>, <a href='http://pupeno.com/tag/example/'>example</a>, <a href='http://pupeno.com/tag/programming/'>programming</a>, <a href='http://pupeno.com/tag/the-joy-of-clojure/'>The Joy of Clojure</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pupeno.wordpress.com/5038/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pupeno.wordpress.com/5038/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pupeno.wordpress.com/5038/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pupeno.wordpress.com/5038/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pupeno.wordpress.com/5038/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pupeno.wordpress.com/5038/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pupeno.wordpress.com/5038/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pupeno.wordpress.com/5038/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pupeno.wordpress.com/5038/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pupeno.wordpress.com/5038/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pupeno.wordpress.com/5038/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pupeno.wordpress.com/5038/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pupeno.wordpress.com/5038/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pupeno.wordpress.com/5038/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=5038&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pupeno.com/2011/08/12/the-joyful-clojure-example-code-convention/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/931970b8dc51b72e05e3a12b88612d61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Pablo</media:title>
		</media:content>

		<media:content url="http://pupeno.files.wordpress.com/2011/08/the-joy-of-clojure1.jpg?w=119" medium="image">
			<media:title type="html">The Joy of Clojure</media:title>
		</media:content>
	</item>
		<item>
		<title>Why I love Smalltalk</title>
		<link>http://pupeno.com/2011/07/28/why-i-love-smalltalk/</link>
		<comments>http://pupeno.com/2011/07/28/why-i-love-smalltalk/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 19:15:58 +0000</pubDate>
		<dc:creator>Pablo</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Smalltalk]]></category>
		<category><![CDATA[Squeak]]></category>

		<guid isPermaLink="false">https://pupeno.com/?p=2510</guid>
		<description><![CDATA[This post was extracted from a small talk I gave at Simplificator, where I work, titled &#8220;Why I love Smalltalk and Lisp&#8221;. There should be another post, &#8220;Why I love Lisp&#8221; following this one. After I learned my basic coding skill in more or less traditional languages, like C, C++, Python, there were four languages [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=2510&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://pupeno.files.wordpress.com/2011/07/smalltalk-logo9.gif?w=538" alt="Smalltalk logo" title="Smalltalk logo"   class="alignright size-full wp-image-2537" /><br />
<blockquote>This post was extracted from a small talk I gave at <a href="http://simplificator.com">Simplificator</a>, where I work, titled &#8220;Why I love Smalltalk and Lisp&#8221;. There should be another post, &#8220;<a href="http://pupeno.com/2011/08/16/why-i-love-lisp/" title="Why I love Lisp">Why I love Lisp</a>&#8221; following this one.</p></blockquote>
<p>After I learned my basic coding skill in more or less traditional languages, like C, C++, Python, there were four languages that really taught me something new. Those languages changed my way of thinking and even if I never use them, they were worth learning. They are:</p>
<ul>
<li>Smalltalk</li>
<li>Lisp</li>
<li>Erlang</li>
<li>Haskell</li>
</ul>
<p>You can probably add Prolog to that list, but I never learned Prolog. This post is about Smalltalk.</p>
<p>My goal is not to teach Smalltalk but to show things that you can do with Smalltalk that you can&#8217;t do with any other language (disclaimer: surely other languages can do it, and we&#8217;ll call them Smalltalk dialects). Nevertheless I need to show you some basics of the language to be able to show you the good stuff, so here we go, a first program:</p>
<pre>
1 + 1
</pre>
<p>That of course, evaluates to 2. If we want to store it in a variable:</p>
<pre>
m := 1 + 1
</pre>
<p>Statements are finished by a period, like this:</p>
<pre>
m := 1.
m := m + 1
</pre>
<p>In <a href="http://squeak.org/">Squeak</a>, a Smalltalk implementation, there&#8217;s an object called Transcript and you can send messages to it to be displayed on the screen. It&#8217;s more or less like a log window. It works like this:</p>
<pre>
Transcript show: 'Hello world'
</pre>
<p>and it looks like this:</p>
<p><img src="http://pupeno.files.wordpress.com/2011/07/transcript-hello-world7.png?w=538" alt="Squeak transcript showing the result of Transcript show: 'Hello World'"   class="aligncenter size-full wp-image-2515" /></p>
<p>The syntax is quite unique to Smalltalk. The message, otherwise known as &#8220;method call&#8221; in other languages, is called <code>show:</code> (including the colon) and it takes an argument. We can run it 10 times in a row with the following snippet:</p>
<pre>
10 timesRepeat: [
  Transcript show: 'Hello world'
]
</pre>
<p>There you can start to see how Smalltalk is special. I&#8217;m sending the message <code>timesRepeat:</code> to the object 10, an <code>Integer</code>. Doing something N times repeatedly is handled by the <code>Integer</code> class, which if you think about it, makes sense.</p>
<p>The second interesting part, is the block. The part inside squared brackets. You might thing that&#8217;s the equivalent of other language&#8217;s block syntax, like in this Java example:</p>
<pre>
for(int i=1; i&lt;11; i++) {
  System.out.println(&quot;Hello world&quot;);
}
</pre>
<p>but Smalltalk version&#8217;s is a bit more powerful. It&#8217;s a real closure. Look at this:</p>
<pre>
t := [
  Transcript show: 'Hello world'
]
</pre>
<p>Now I have a variable named <code>t</code>, of type <code>BlockClosure</code>, and I can do anything I want with that variable. If I send it the <code>class</code> message it&#8217;ll return its class:</p>
<pre>
t class
</pre>
<p>and if I sed it the <code>value</code> message, it&#8217;ll execute and leave a &#8220;Hello World&#8221; in the transcript:</p>
<pre>
t value
</pre>
<p>Let&#8217;s see some more code. A message without any arguments:</p>
<pre>
10 printString
</pre>
<p>a message with one argument:</p>
<pre>
10 printStringBase: 2
</pre>
<p>and a message with two arguments:</p>
<pre>
10 printStringBase: 2 nDigits: 10
</pre>
<p>Isn&#8217;t it cute? That method is called <code>printStringBase:nDigits:</code>. I never seen that syntax anywhere else; well, except in Objective-C, which copied it from Smalltalk.</p>
<p>Enough toying around, let&#8217;s start building serious stuff. Let&#8217;s create a class:</p>
<pre>
Object subclass: #MyClass
       instanceVariableNames: ''
       classVariableNames: ''
       poolDictionaries: ''
       category: 'Pupeno'
</pre>
<p>Notice that a class is created by sending a message to another class telling it to subclass itself with the name and a few other arguments. It&#8217;s a message, a method call like any other. Object is a class, classes are objects. The object model of Smalltalk is a beauty but that&#8217;s a subject for another post.</p>
<p>Now that we have a class, let&#8217;s create a method called greet: in that class.</p>
<pre>
greet: name
  "Greets the user named name"

  | message |

  message := 'Hello ', name.
  Transcript show: message.
</pre>
<p>In that method definition first we have a comment for the method, then the list of local variables within pipes (&#8220;|&#8221;), and then the implementation, which sets the variable message to contain &#8220;Hello &#8221; and the comma concatenates name to it. Then we just send it to the transcript.</p>
<p>It looks like this:</p>
<p><img src="http://pupeno.files.wordpress.com/2011/07/myclass-greet8.png?w=538" alt="MyClass greet method" title="MyClass greet method"   class="aligncenter size-full wp-image-2523" /></p>
<p>Ok, let&#8217;s use it:</p>
<pre>
m := MyClass new.
m greet: 'Pupeno'
</pre>
<p>To create an object of class <code>MyClass</code>, we send the <code>new</code> message to that class. There&#8217;s no <code>new</code> keyword like in Java. <code>new</code> is just a method. You can read its code, override it, etc. Don&#8217;t mess with it unless you really know what you are doing.</p>
<p>Actually, if you think about it, we haven&#8217;t seen a single keyword. Look all the code we wrote without having to memorize any keywords! What&#8217;s even more important is that by now you essentially know Smalltalk. That&#8217;s all there is, but like LEGO bricks, this simple and small building blocks allow you to build whatever you want.</p>
<p>Yes, that&#8217;s it, that&#8217;s all there is to it. We already saw that Smalltalk doesn&#8217;t need loops, it has integers and that class implements the <code>timesRepeat:</code> message which allows you to do something N times. There are many other looping methods here and there.</p>
<p>What about the <code>if</code> keyword you ask? Surely Smalltalk has an <code>if</code>? Well, no, it doesn&#8217;t. What you can recognize as an <code>if</code> <em>is actually implemented in Smalltalk</em> using the same mechanism of classes and message passing you saw already. Just for fun let&#8217;s re-implement it.</p>
<p>We starte by creating the class <code>PBoolean</code> and then two classes inheriting from it, <code>PTrue</code> and <code>PFalse</code>.</p>
<pre>
Object subclass: #PBoolean
       instanceVariableNames: ''
       classVariableNames: ''
       poolDictionaries: ''
       category: 'Pupeno'

PBoolean subclass: #PTrue
       instanceVariableNames: ''
       classVariableNames: ''
       poolDictionaries: ''
       category: 'Pupeno'

PBoolean subclass: #PFalse
       instanceVariableNames: ''
       classVariableNames: ''
       poolDictionaries: ''
       category: 'Pupeno'
</pre>
<p>For the class we created before, MyClass, we define a <code>equals:</code> method that will return either true or false, or rather, <code>PTrue</code> or <code>PFalse</code>.</p>
<pre>
equals: other
  ^ PTrue new
</pre>
<p>The little hat, <code>^</code>, means return. For now, just a hardcoded true. Now we can do this in the workspace:</p>
<pre>
m1 := MyClass new.
m2 := MyClass new.
m1 equals: m2
</pre>
<p>and get true, that is <code>PTrue</code>, as a result. We are getting close but no <code>if</code> yet. How should <code>if</code> look like? It&#8217;ll look like something like this:</p>
<pre>
m1 := MyClass new.
m2 := MyClass new.
(m1 equals: m2) ifTrue: [
  Transcript show: 'They are equal'; cr
] else: [
  Transcript show: 'They are false'; cr
]
</pre>
<p>and you can start to imagine how to implement it. In <code>PTrue</code> we add the method:</p>
<pre>
ifTrue: do else: notdo
  ^ do value
</pre>
<p>That method basically takes two parameters, evaluates the first one and ignores the second one. For <code>PFalse</code> we create the oposite:</p>
<pre>
ifTrue: notdo else: do
  ^ do value
</pre>
<p>and that&#8217;s it. A working <code>if</code>! If you ask me, I think this is truly amazing. And if you check Squeak itself, you&#8217;ll find the <code>if</code> is actually implemented this way:</p>
<p><img src="http://pupeno.files.wordpress.com/2011/07/iftrueiffalse9.png?w=538" alt="True's ifTrue:ifFalse:" title="True's ifTrue:ifFalse:"   class="aligncenter size-full wp-image-2531" /></p>
<p>If your programming language allows you to create something as basic as the if conditional, then it allows you to create anything you want.</p>
<br />Filed under: <a href='http://pupeno.com/category/technical/'>Technical</a> Tagged: <a href='http://pupeno.com/tag/programming/'>programming</a>, <a href='http://pupeno.com/tag/smalltalk/'>Smalltalk</a>, <a href='http://pupeno.com/tag/squeak/'>Squeak</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pupeno.wordpress.com/2510/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pupeno.wordpress.com/2510/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pupeno.wordpress.com/2510/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pupeno.wordpress.com/2510/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pupeno.wordpress.com/2510/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pupeno.wordpress.com/2510/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pupeno.wordpress.com/2510/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pupeno.wordpress.com/2510/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pupeno.wordpress.com/2510/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pupeno.wordpress.com/2510/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pupeno.wordpress.com/2510/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pupeno.wordpress.com/2510/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pupeno.wordpress.com/2510/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pupeno.wordpress.com/2510/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=2510&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pupeno.com/2011/07/28/why-i-love-smalltalk/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/931970b8dc51b72e05e3a12b88612d61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Pablo</media:title>
		</media:content>

		<media:content url="http://pupeno.files.wordpress.com/2011/07/smalltalk-logo9.gif" medium="image">
			<media:title type="html">Smalltalk logo</media:title>
		</media:content>

		<media:content url="http://pupeno.files.wordpress.com/2011/07/transcript-hello-world7.png" medium="image">
			<media:title type="html">Squeak transcript showing the result of Transcript show: &#039;Hello World&#039;</media:title>
		</media:content>

		<media:content url="http://pupeno.files.wordpress.com/2011/07/myclass-greet8.png" medium="image">
			<media:title type="html">MyClass greet method</media:title>
		</media:content>

		<media:content url="http://pupeno.files.wordpress.com/2011/07/iftrueiffalse9.png" medium="image">
			<media:title type="html">True&#039;s ifTrue:ifFalse:</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting rid of RubyGems deprecation warnings</title>
		<link>http://pupeno.com/2011/05/08/getting-rid-of-rubygems-deprecation-warnings/</link>
		<comments>http://pupeno.com/2011/05/08/getting-rid-of-rubygems-deprecation-warnings/#comments</comments>
		<pubDate>Sun, 08 May 2011 16:45:45 +0000</pubDate>
		<dc:creator>Pablo</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[RubyGems]]></category>

		<guid isPermaLink="false">https://pupeno.com/?p=2479</guid>
		<description><![CDATA[A recent update to RubyGems is causing a lot of deprecation warnings like these: I generally like software to move forward and the way to do that is deprecate and then after a while, make backwards incompatible changes. It&#8217;s painful but there&#8217;s no other way. I do have a problem with all the cron jobs [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=2479&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A recent update to RubyGems is causing a lot of deprecation warnings like these:</p>
<p><pre class="brush: plain;">
NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from /usr/lib/ruby/gems/1.8/specifications/rubygems-update-1.4.1.gemspec:11.
NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from /usr/lib/ruby/gems/1.8/specifications/bundler-1.0.7.gemspec:10.
NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from /usr/lib/ruby/gems/1.8/specifications/file-tail-1.0.5.gemspec:10.
</pre></p>
<p>I generally like software to move forward and the way to do that is deprecate and then after a while, make backwards incompatible changes. It&#8217;s painful but there&#8217;s no other way.</p>
<p>I do have a problem with all the cron jobs of my web apps like <a href="http://keeponposting.com">Keep on Posting</a> or <a href="http://dnsk9.com">DNSk9</a> flooding my inbox with those warnings. Thankfully, that&#8217;s not hard to fix. Where I was doing:</p>
<p><pre class="brush: bash;">
rake pre_calculate_thingies &gt; /dev/null
</pre></p>
<p>now I&#8217;ll be doing:</p>
<p><pre class="brush: bash;">
rake pre_calculate_thingies 2&gt;&amp;1 &gt;/dev/null | grep -v default_executable
</pre></p>
<br />Filed under: <a href='http://pupeno.com/category/technical/'>Technical</a> Tagged: <a href='http://pupeno.com/tag/programming/'>programming</a>, <a href='http://pupeno.com/tag/ruby/'>Ruby</a>, <a href='http://pupeno.com/tag/ruby-on-rails/'>Ruby on Rails</a>, <a href='http://pupeno.com/tag/rubygems/'>RubyGems</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pupeno.wordpress.com/2479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pupeno.wordpress.com/2479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pupeno.wordpress.com/2479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pupeno.wordpress.com/2479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pupeno.wordpress.com/2479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pupeno.wordpress.com/2479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pupeno.wordpress.com/2479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pupeno.wordpress.com/2479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pupeno.wordpress.com/2479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pupeno.wordpress.com/2479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pupeno.wordpress.com/2479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pupeno.wordpress.com/2479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pupeno.wordpress.com/2479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pupeno.wordpress.com/2479/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=2479&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pupeno.com/2011/05/08/getting-rid-of-rubygems-deprecation-warnings/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/931970b8dc51b72e05e3a12b88612d61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Pablo</media:title>
		</media:content>
	</item>
		<item>
		<title>Metaprogramming Ruby</title>
		<link>http://pupeno.com/2010/10/18/metaprogramming-ruby/</link>
		<comments>http://pupeno.com/2010/10/18/metaprogramming-ruby/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 05:07:20 +0000</pubDate>
		<dc:creator>Pablo</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[metaprogramming]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">https://pupeno.com/?p=1935</guid>
		<description><![CDATA[http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=pupeno-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=1934356476 There are thousands of books that will take you from illiterate to novice in any programming language. But finding those that will take you from novice or intermediate to expert is hard. I remember reading Effective Java some years ago and wishing I had something like that for Python. I&#8217;ve never found one. Metaprogramming [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=1935&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="float:right;"><a href="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=pupeno-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=1934356476">http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=pupeno-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=1934356476</a></div>
<p>There are thousands of books that will take you from illiterate to novice in any programming language. But finding those that will take you from novice or intermediate to expert is hard. I remember reading <a href="http://www.amazon.com/gp/product/0321356683?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321356683">Effective Java</a><img src="http://www.assoc-amazon.com/e/ir?t=pupeno-20&amp;l=as2&amp;o=1&amp;a=0321356683" width="1" height="1" border="0" alt="" style="border:none!important;margin:0!important;" /> some years ago and wishing I had something like that for Python. I&#8217;ve never found one.</p>
<p><a href="http://www.amazon.com/gp/product/1934356476?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1934356476">Metaprogramming Ruby</a><img src="http://www.assoc-amazon.com/e/ir?t=pupeno-20&amp;l=as2&amp;o=1&amp;a=1934356476" width="1" height="1" border="0" alt="" style="border:none!important;margin:0!important;" /> is a great book full of very interesting knowledge, full of those things that separate a Ruby programmer and an export Ruby programmer. Before finishing the book I&#8217;ve already put to use some of the lessons and it saved me a lot of time. The book payed for itself before I&#8217;ve finished reading and I really recommend it to anyone who is serious about coding in Ruby.</p>
<br />Filed under: <a href='http://pupeno.com/category/technical/'>Technical</a> Tagged: <a href='http://pupeno.com/tag/metaprogramming/'>metaprogramming</a>, <a href='http://pupeno.com/tag/programming/'>programming</a>, <a href='http://pupeno.com/tag/ruby/'>Ruby</a>, <a href='http://pupeno.com/tag/ruby-on-rails/'>Ruby on Rails</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pupeno.wordpress.com/1935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pupeno.wordpress.com/1935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pupeno.wordpress.com/1935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pupeno.wordpress.com/1935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pupeno.wordpress.com/1935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pupeno.wordpress.com/1935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pupeno.wordpress.com/1935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pupeno.wordpress.com/1935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pupeno.wordpress.com/1935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pupeno.wordpress.com/1935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pupeno.wordpress.com/1935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pupeno.wordpress.com/1935/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pupeno.wordpress.com/1935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pupeno.wordpress.com/1935/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=1935&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pupeno.com/2010/10/18/metaprogramming-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/931970b8dc51b72e05e3a12b88612d61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Pablo</media:title>
		</media:content>

		<media:content url="http://www.assoc-amazon.com/e/ir?t=pupeno-20&#38;l=as2&#38;o=1&#38;a=0321356683" medium="image" />

		<media:content url="http://www.assoc-amazon.com/e/ir?t=pupeno-20&#38;l=as2&#38;o=1&#38;a=1934356476" medium="image" />
	</item>
		<item>
		<title>Are dynamic languages just a temporary workaround?</title>
		<link>http://pupeno.com/2009/10/13/are-dynamic-languages-just-a-temporary-workaround/</link>
		<comments>http://pupeno.com/2009/10/13/are-dynamic-languages-just-a-temporary-workaround/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 17:00:42 +0000</pubDate>
		<dc:creator>Pablo</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[dynamic typing]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[static typing]]></category>
		<category><![CDATA[type inference]]></category>
		<category><![CDATA[type systems]]></category>
		<category><![CDATA[typing]]></category>

		<guid isPermaLink="false">http://pupeno.com/?p=759</guid>
		<description><![CDATA[This can unleash so much hate mail, but here it goes, my inbox is ready! Are dynamic languages just a temporary workaround? I&#8217;m not sure! I&#8217;m switching between the two types of languages all the time: Java, Python, C#, JavaScript. I&#8217;ll try to make the long story short. Statically typed languages, like Java and C#, are nice [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=759&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This can unleash so much hate mail, but here it goes, my inbox is ready!</p>
<p>Are dynamic languages just a temporary workaround? I&#8217;m not sure! I&#8217;m switching between the two types of languages all the time: Java, Python, C#, JavaScript. I&#8217;ll try to make the long story short.</p>
<p>Statically typed languages, like Java and C#, are nice because when you do</p>
<pre>blah.bleh()</pre>
<p>you know that blah&#8217;s class has a bleh method, at compile time. But better than that, when you typed &#8220;blah.&#8221; you get a list of methods, and you already know whether there&#8217;s a bleh method or not, and if you typed bleh and it doesn&#8217;t exist, the IDE lets you know, no need to wait for the compiler. Also you can do very deterministic refactoring, renaming all &#8220;bleh&#8221; for &#8220;bluh&#8221; for example.</p>
<p>Statically typed languages are not nice because they are very verbose and require a lot of boilerplate (if you&#8217;ve used Haskell, just bear with me for now please), so you end up with things like:</p>
<pre>List[Car] cars = new List[Cars]();
foreach (Car car in cars) {
    car.Crash();
}</pre>
<p>How many &#8220;cars&#8221; do you read there? And that&#8217;s a nice example. There are worse. So come dynamically typed languages and you can write:</p>
<pre>cars = []
for car in cars:
    car.crash()</pre>
<p>You have less cars, and less (no) lists. That means you are more productive. You start chunking out code faster without having to stop and think &#8220;What type of object will this or that method return?&#8221;. But crash() can crash your application instead of just the car because you can&#8217;t know if it exists until run-time. That might be OK or not, testing and whatnot.</p>
<p>Then comes C# 3.0 where you can do:</p>
<pre>var cars = new List[Car]();
foreach (var car in cars) {
    car.crash();
}</pre>
<p>And you can see that syntactically it got closer to Python, which is what gives you the productivity. Don&#8217;t know the type? type &#8220;var&#8221;. But semantically, it&#8217;s still statically typed, like the previous statically typed example. You know that car is going to be of some class that has a crash method. You can actually know car&#8217;s class at compile time, no need to run it.</p>
<p>That&#8217;s called type inference. You don&#8217;t have to specify the type where the compiler is capable of inferring it for you. C# type inference system is still very limited (but better than Java&#8217;s). Let&#8217;s see an example in another language</p>
<pre>cars = []
map crash cars</pre>
<p>That means, create a list called cars, call the function crash on each car. Would you say that that is a statically typed language? or a dynamic one? I&#8217;d say it is dynamic, but it is static. Very static. It&#8217;s Haskell. Haskell&#8217;s compiler will infer all the types for you. It&#8217;s amazing, you&#8217;ll write code as robust as with C#, but as terse as Python&#8217;s (Monads will then kill your productivity, but that&#8217;s another story).</p>
<p>In Python 3 you can define types for arguments. They are mostly useless, but it&#8217;s an interesting direction. I think the best it can do is that when a program crashes it&#8217;ll tell you: &#8220;function blah expected an int, but got a float, not sure if that was the problem, but you might want to look into that&#8221;.</p>
<p>Now, my question is, are dynamically typed languages just a temporary workaround? As our compilers get better, our computers faster, will statically typed languages keep giving us as many or more reassurances about our code and utilities while at the same time they become as simple and terse as dynamically typed languages? Or will dynamically typed languages start to gain types and over time be more static without the programmers that use them ever noticing?</p>
<p>My question is, will we in the future, 50 or 100 years, look back and said &#8220;Dynamically typed languages where a temporary workaround to statically languages being painful to use when human beings and their toy computers were so primitive?&#8221; in the same way we can say today that &#8220;non-lexical scope was a limitation we had and have due to the limitations of computer hardware 30 years ago&#8221;.</p>
<p><em>Reviewed by <a href="http://danielmagliola.com/">Daniel Magliola</a>. Thank you!</em></p>
<br />Posted in Technical Tagged: C#, dynamic typing, Haskell, Java, programming, Python, static typing, type inference, type systems, typing <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pupeno.wordpress.com/759/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pupeno.wordpress.com/759/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pupeno.wordpress.com/759/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pupeno.wordpress.com/759/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pupeno.wordpress.com/759/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pupeno.wordpress.com/759/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pupeno.wordpress.com/759/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pupeno.wordpress.com/759/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pupeno.wordpress.com/759/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pupeno.wordpress.com/759/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pupeno.wordpress.com/759/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pupeno.wordpress.com/759/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pupeno.wordpress.com/759/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pupeno.wordpress.com/759/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=759&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pupeno.com/2009/10/13/are-dynamic-languages-just-a-temporary-workaround/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/931970b8dc51b72e05e3a12b88612d61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Pablo</media:title>
		</media:content>
	</item>
		<item>
		<title>Formating strings in C#, like in Python</title>
		<link>http://pupeno.com/2009/09/15/formating-strings-in-c-like-in-python/</link>
		<comments>http://pupeno.com/2009/09/15/formating-strings-in-c-like-in-python/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 16:15:01 +0000</pubDate>
		<dc:creator>Pablo</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[extensibility]]></category>
		<category><![CDATA[extension methods]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://pupeno.com/?p=834</guid>
		<description><![CDATA[I like Python&#8217;s way to format strings because you can use it everywhere, it&#8217;s part of the strings. You can do print("Welcome %s!" % user.name) as you can do Console.Writeln("Welcome {0}!", user.Name) But then in Python you can also do randomMethodThatTakesAString("Welcome %s!" % user.name) In C# it gets trickier, because the call to Console.Writeln takes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=834&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I like Python&#8217;s way to format strings because you can use it everywhere, it&#8217;s part of the strings. You can do</p>
<pre>print("Welcome %s!" % user.name)</pre>
<p>as you can do</p>
<pre>Console.Writeln("Welcome {0}!", user.Name)</pre>
<p>But then in Python you can also do</p>
<pre>randomMethodThatTakesAString("Welcome %s!" % user.name)</pre>
<p>In C# it gets trickier, because the call to Console.Writeln takes extra arguments for the string arguments, while RandomMethodThatTakesAString doesn&#8217;t. It just takes a string. So the only way to go is</p>
<pre>RandomMethodThatTakesAString(String.Format("Welcome {0}!", user.Name))</pre>
<p>which is ugly.</p>
<p>Thanfully C# 3.0 has extension methods, so I quickly wrote this method:</p>
<pre>blah blah</pre>
<p>and now I can write:</p>
<pre>RandomMethodThatTakesAString("Welcome {0}".Args(user.Name))</pre>
<p>which is more verbose that Python&#8217;s version, but equally nice in my eyes.</p>
<p>If you can understand why allowing the language to be extendable in one aspect was a win here, then you can understand why so many, me included, love Lisp that is extendable in every possible way.</p>
<p><em>Reviewed by <a href="http://danielmagliola.com/">Daniel Magliola</a>. Thank you!</em></p>
<p>Update 2009-09-17: For those complaining that I didn&#8217;t show how I did it, here is the Args method:</p>
<pre>public static class StringExtensions {
    public static string Args(this string str, params object[] args) {
        return String.Format(str, args);
    }
}</pre>
<br />Posted in Technical Tagged: .Net, C#, extensibility, extension methods, programming, Python <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pupeno.wordpress.com/834/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pupeno.wordpress.com/834/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pupeno.wordpress.com/834/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pupeno.wordpress.com/834/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pupeno.wordpress.com/834/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pupeno.wordpress.com/834/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pupeno.wordpress.com/834/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pupeno.wordpress.com/834/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pupeno.wordpress.com/834/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pupeno.wordpress.com/834/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pupeno.wordpress.com/834/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pupeno.wordpress.com/834/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pupeno.wordpress.com/834/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pupeno.wordpress.com/834/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=834&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pupeno.com/2009/09/15/formating-strings-in-c-like-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/931970b8dc51b72e05e3a12b88612d61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Pablo</media:title>
		</media:content>
	</item>
		<item>
		<title>Complexity of writing software</title>
		<link>http://pupeno.com/2009/09/08/complexity-of-writing-software/</link>
		<comments>http://pupeno.com/2009/09/08/complexity-of-writing-software/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 16:15:37 +0000</pubDate>
		<dc:creator>Pablo</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[complexity]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://pupeno.com/?p=836</guid>
		<description><![CDATA[There seems to be a lot of discussion about software complexity, and although I think many people are talking about different stuff, here&#8217;s my take on it. We often compare writing software with other professional disciplines, like civil engineering and medicine, which allows us to pick at possible futures of writing software. I believe writing software [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=836&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-949 alignright" src="http://pupeno.files.wordpress.com/2009/09/broken-bridge7.jpg?w=300&#038;h=205" alt="Broken bridge, picture by Ghost V" width="300" height="205" /></p>
<p>There seems to be a lot of discussion about software complexity, and although I think many people are talking about different stuff, here&#8217;s my take on it. We often compare writing software with other professional disciplines, like civil engineering and medicine, which allows us to pick at possible futures of writing software.</p>
<p>I believe writing software is hard, very hard, extremely hard. Probably one of the hardest thing to do. Any non trivial piece of code has an amazing amount of moving pieces. I bet the average software project is more complex than a car or a bridge. But how do we reconcile that with the fact that we have children programming and not children building cars or bridges?</p>
<p>Well, we do have children building cars and bridges, just that they are <em>toy</em> cars and <em>toy</em> bridges. Toy cars and bridges are very different from real cars and bridges. Toy software is not much different from real software. The path for going from toy to real in software, unlike in medicine, motor and civil engineering, is smooth. You don&#8217;t jump from building toy software into building real software, you just build better and bigger software until it&#8217;s <em>real or professional</em>.</p>
<p>That makes sense because software is abstract. Software is like ideas. There&#8217;s no jump between having toy ideas and having real ideas. If you don&#8217;t buy it, let&#8217;s do the analogy with math. There&#8217;s no jump between doing toy math and real math. You learn more math, more operations, more tools, but the sums and multiplication you learned when you were 5 years old are the same you use in civil engineering. There&#8217;s no <em>toy sums vs real sums</em>.</p>
<p>At some point in time, ages ago, math was primitive. A 12 year old could discover something new in math. We are at that period in the world of software writing. We are young and there&#8217;s not a lot out there. That&#8217;s why even though it&#8217;s extremely complex, a kid can still do something meaningful.</p>
<p>There&#8217;s something special about software. Even though it is abstract like math, it has a concrete impact, like civil engineering. So the 12 year old kid can do something new and it&#8217;s not just a piece of paper with a couple of numbers on it. It&#8217;s a real usable thing that other people can start, well, using. And that&#8217;s why I believe programming is so wonderful.</p>
<p>There&#8217;s another very important property of software that makes it so complex and still approachable. Imagine the world ages ago when 12 years old where doing math discoveries. Probably 99.9% were wrong in what they discovered as 99.9% of the software written by kids is wrong in the way it has bugs. But buggy software is still software and it&#8217;s still usable. Buggy math is wrong and should be discarded, buggy bridges kill people. Buggy software is a nuisance, but usable.</p>
<p>There&#8217;s some code in which only very smart and professional people put their hands on. Code written at NASA has something like 10 times more code to test it. Code put in a machine that can kill people, like a robot at a factory or a radiotherapy machine is written quite differently than the latest web toy or even the operating system you are using (last time I checked my analytics, nobody was using QNX to access this web site).</p>
<p><img class="size-thumbnail wp-image-951 alignleft" src="http://pupeno.files.wordpress.com/2009/09/nasa9.jpg?w=150&#038;h=150" alt="Rocket picture by SWP Moblog" width="150" height="150" /></p>
<p>As software becomes more important in our lives, more of it has to be written rigorously. You can accept the latest web toy to crash, but you cannot accept your phone to crash. And then, the latest web toy becomes very important, like Twitter, and you cannot accept it to crash. The way code is written at NASA is more similar to the way a civil engineer makes a bridge: accounting for all possible variables.</p>
<p>It&#8217;s a real possibility that in 20 or 30 years all code will have to be written very rigorously. That means that you probably won&#8217;t be able to get a job working as a programmer in many, many places unless you have a proper degree, certification and license. I know it sounds crazy, but extrapolate about who was building bridges ages ago (anybody) and who are building them now (civil engineers) to who is building software now and who is going to be building software tomorrow.</p>
<p>For me, that sounds very depressing. I like the chaos of innovation that software is today. I probably couldn&#8217;t live in a rigorous software environment. One aspect that I haven&#8217;t analyzed is that, unlike civil engineers, software programmers will most likely always be able to build software by themselves, put it out there and be out of the loop of rigorous working. Anyone can build a bridge in their back-yard and nobody will use it, because it doesn&#8217;t stand a chance of being useful. But <em>the back-yard of a programmer is the Internet</em>. The only question is whether people will use that crapy web toy built by a 12-year old 20 years from now. I honestly hope so because that will keep the thriving environment of chaotic innovation that programming is today.</p>
<p><em>Reviewed by <a href="http://danielmagliola.com">Daniel Magliola</a>. Thank you! <a href="http://www.flickr.com/photos/ghostv/380447074/">Broken bridge picture by Ghost V</a>, </em><a href="http://www.flickr.com/photos/15549210@N04/2350891466/">rocket picture by SWP Moblog</a>.</p>
<br />Posted in Personal Tagged: complexity, programming, software <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pupeno.wordpress.com/836/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pupeno.wordpress.com/836/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pupeno.wordpress.com/836/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pupeno.wordpress.com/836/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pupeno.wordpress.com/836/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pupeno.wordpress.com/836/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pupeno.wordpress.com/836/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pupeno.wordpress.com/836/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pupeno.wordpress.com/836/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pupeno.wordpress.com/836/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pupeno.wordpress.com/836/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pupeno.wordpress.com/836/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pupeno.wordpress.com/836/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pupeno.wordpress.com/836/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=836&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pupeno.com/2009/09/08/complexity-of-writing-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/931970b8dc51b72e05e3a12b88612d61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Pablo</media:title>
		</media:content>

		<media:content url="http://pupeno.files.wordpress.com/2009/09/broken-bridge7.jpg?w=300" medium="image">
			<media:title type="html">Broken bridge, picture by Ghost V</media:title>
		</media:content>

		<media:content url="http://pupeno.files.wordpress.com/2009/09/nasa9.jpg?w=150" medium="image">
			<media:title type="html">Rocket picture by SWP Moblog</media:title>
		</media:content>
	</item>
		<item>
		<title>File input for forms in ASP.NET MVC</title>
		<link>http://pupeno.com/2009/08/13/file-input-type-for-forms-in-for-asp-net-mvc/</link>
		<comments>http://pupeno.com/2009/08/13/file-input-type-for-forms-in-for-asp-net-mvc/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 16:15:04 +0000</pubDate>
		<dc:creator>Pablo</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[open]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://pupeno.com/?p=643</guid>
		<description><![CDATA[I&#8217;m not sure why ASP.NET MVC was shipped without a file input type for forms. Maybe it&#8217;ll come in MVC 2.0 or 3.0. Meanwhile, I created one. I spent two or three hours trying to figure out how to go from Object to IDictionary&#60;String, Object&#62; to follow the same ASP.NET MVC style where you have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=643&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-767" src="http://pupeno.files.wordpress.com/2009/08/file8.jpg?w=213&#038;h=300" alt="file" width="213" height="300" />I&#8217;m not sure why ASP.NET MVC was shipped without a file input type for forms. Maybe it&#8217;ll come in MVC 2.0 or 3.0. Meanwhile, I created one. I spent two or three hours trying to figure out how to go from Object to IDictionary&lt;String, Object&gt; to follow the same ASP.NET MVC style where you have methods like:</p>
<pre>TextBox(HtmlHelper, String, Object, IDictionary);
TextBox(HtmlHelper, String, Object, Object);</pre>
<p>which are essentially the same. The last argument is a dictionary of extra HTML attributes, like style=&#8221;float: left;&#8221;. The good thing about accepting Object Is that you can call it this way:</p>
<pre>Html.TextBox("email", new { style="float: left;" })</pre>
<p>which is very handy for forms. The bad thing is that it is a pain in the ass to do that <em>hocus pocus</em> in C# using reflection. Thankfully <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=53289097-73ce-43bf-b6a6-35e00103cb4b&amp;displaylang=en">ASP.NET MVC is open source</a>. I downloaded the source and after 15 minutes I got it working nicely (and without manually using reflection). <strong>Use the source Luke!</strong></p>
<p>In a recent episode of <a href="http://www.hanselminutes.com/">Hansel Minutes podcast</a> someone argued what was the value of releasing the code of ASP.NET MVC at all. Well, this is the value. You help developers, you build a better developing community.</p>
<p>Without further ado, here&#8217;s the code:</p>
<pre>public static class HtmlHelperExtensions {
   /// &lt;summary&gt;
   /// Returns a file input element by using the specified HTML helper and the name of the form field.
   /// &lt;/summary&gt;
   /// &lt;param name="htmlHelper"&gt;The HTML helper instance that this method extends.&lt;/param&gt;
   /// &lt;param name="name"&gt;The name of the form field and the &lt;see cref="member"&gt;System.Web.Mvc.ViewDataDictionary&lt;/see&gt; key that is used to look up the validation errors.&lt;/param&gt;
   /// &lt;returns&gt;An input element that has its type attribute set to "file".&lt;/returns&gt;
   public static string FileBox(this HtmlHelper htmlHelper, string name) {
       return htmlHelper.FileBox(name, (object)null);
   }

    /// &lt;summary&gt;
    /// Returns a file input element by using the specified HTML helper, the name of the form field, and the HTML attributes.
    /// &lt;/summary&gt;
    /// &lt;param name="htmlHelper"&gt;The HTML helper instance that this method extends.&lt;/param&gt;
    /// &lt;param name="name"&gt;The name of the form field and the &lt;see cref="member"&gt;System.Web.Mvc.ViewDataDictionary&lt;/see&gt; key that is used to look up the validation errors.&lt;/param&gt;
    /// &lt;param name="htmlAttributes"&gt;An object that contains the HTML attributes for the element. The attributes are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax.&lt;/param&gt;
    /// &lt;returns&gt;An input element that has its type attribute set to "file".&lt;/returns&gt;
    public static string FileBox(this HtmlHelper htmlHelper, string name, object htmlAttributes) {
        return htmlHelper.FileBox(name, new RouteValueDictionary(htmlAttributes));
    }

    /// &lt;summary&gt;
    /// Returns a file input element by using the specified HTML helper, the name of the form field, and the HTML attributes.
    /// &lt;/summary&gt;
    /// &lt;param name="htmlHelper"&gt;The HTML helper instance that this method extends.&lt;/param&gt;
    /// &lt;param name="name"&gt;The name of the form field and the &lt;see cref="member"&gt;System.Web.Mvc.ViewDataDictionary&lt;/see&gt; key that is used to look up the validation errors.&lt;/param&gt;
    /// &lt;param name="htmlAttributes"&gt;An object that contains the HTML attributes for the element. The attributes are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax.&lt;/param&gt;
    /// &lt;returns&gt;An input element that has its type attribute set to "file".&lt;/returns&gt;
    public static string FileBox(this HtmlHelper htmlHelper, string name, IDictionary&lt;String, Object&gt; htmlAttributes) {
        var tagBuilder = new TagBuilder("input");
        tagBuilder.MergeAttributes(htmlAttributes);
        tagBuilder.MergeAttribute("type", "file", true);
        tagBuilder.MergeAttribute("name", name, true);
        tagBuilder.GenerateId(name);

        ModelState modelState;
        if (htmlHelper.ViewData.ModelState.TryGetValue(name, out modelState)) {
            if (modelState.Errors.Count &gt; 0) {
                tagBuilder.AddCssClass(HtmlHelper.ValidationInputCssClassName);
            }
        }

        return tagBuilder.ToString(TagRenderMode.SelfClosing);
    }
}</pre>
<p><em>Reviewed by <a href="http://danielmagliola.com">Daniel Magliola</a>. Thank you!</em></p>
<br />Posted in Technical Tagged: .Net, ASP.NET MVC, C#, file, form, input, open, open source, programming, source <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pupeno.wordpress.com/643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pupeno.wordpress.com/643/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pupeno.wordpress.com/643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pupeno.wordpress.com/643/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pupeno.wordpress.com/643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pupeno.wordpress.com/643/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pupeno.wordpress.com/643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pupeno.wordpress.com/643/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pupeno.wordpress.com/643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pupeno.wordpress.com/643/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pupeno.wordpress.com/643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pupeno.wordpress.com/643/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pupeno.wordpress.com/643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pupeno.wordpress.com/643/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=643&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pupeno.com/2009/08/13/file-input-type-for-forms-in-for-asp-net-mvc/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/931970b8dc51b72e05e3a12b88612d61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Pablo</media:title>
		</media:content>

		<media:content url="http://pupeno.files.wordpress.com/2009/08/file8.jpg?w=213" medium="image">
			<media:title type="html">file</media:title>
		</media:content>
	</item>
		<item>
		<title>Music for coding</title>
		<link>http://pupeno.com/2009/08/11/music-for-coding/</link>
		<comments>http://pupeno.com/2009/08/11/music-for-coding/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 16:15:14 +0000</pubDate>
		<dc:creator>Pablo</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[working]]></category>

		<guid isPermaLink="false">http://pupeno.com/?p=654</guid>
		<description><![CDATA[I&#8217;ve been looking for ages for the perfect music for coding. I&#8217;ve asked around and tried new age, Mozart, Bach, and other academic music. I&#8217;ve tried instrumental soothing music and instrumental electronic music. Nothing worked until I started to expand my original coding music: Indiana Jones and the Last Crusade. Yes, I used to code [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=654&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/gp/product/B000002O6R?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B000002O6R"><img class="alignright size-medium wp-image-764" src="http://pupeno.files.wordpress.com/2009/08/back-to-the-future8.jpg?w=300&#038;h=300" alt="Back to the Future" width="300" height="300" /></a><img class=" zskafupwakbfjnrfwcnb zskafupwakbfjnrfwcnb" style="border:none!important;margin:0!important;" src="http://www.assoc-amazon.com/e/ir?t=pupeno-20&amp;l=as2&amp;o=1&amp;a=B000002O6R" border="0" alt="" width="1" height="1" />I&#8217;ve been looking for ages for the perfect music for coding. I&#8217;ve asked around and tried new age, Mozart, Bach, and other academic music. I&#8217;ve tried instrumental soothing music and instrumental electronic music. Nothing worked until I started to expand my original coding music: <a href="http://www.amazon.com/gp/product/B001J32H6W?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B001J32H6W">Indiana Jones and the Last Crusade</a><img class=" zskafupwakbfjnrfwcnb zskafupwakbfjnrfwcnb" style="border:none!important;margin:0!important;" src="http://www.assoc-amazon.com/e/ir?t=pupeno-20&amp;l=as2&amp;o=1&amp;a=B001J32H6W" border="0" alt="" width="1" height="1" />.</p>
<p>Yes, I used to code to the music of Indiana Jones and the Last Crusade and I loved it. I started to try others and I&#8217;ve found I like coding to these albums:</p>
<ul>
<li><a href="http://www.amazon.com/gp/product/B000002O6R?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B000002O6R">Back to the Future II</a><img class=" zskafupwakbfjnrfwcnb zskafupwakbfjnrfwcnb" style="border:none!important;margin:0!important;" src="http://www.assoc-amazon.com/e/ir?t=pupeno-20&amp;l=as2&amp;o=1&amp;a=B000002O6R" border="0" alt="" width="1" height="1" /> <a href="http://www.amazon.com/gp/product/B0000014RN?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B0000014RN">and III</a><img class=" zskafupwakbfjnrfwcnb zskafupwakbfjnrfwcnb" style="border:none!important;margin:0!important;" src="http://www.assoc-amazon.com/e/ir?t=pupeno-20&amp;l=as2&amp;o=1&amp;a=B0000014RN" border="0" alt="" width="1" height="1" /> (<a href="http://www.amazon.com/gp/product/B000002O4S?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B000002O4S">not I</a><img class=" zskafupwakbfjnrfwcnb zskafupwakbfjnrfwcnb" style="border:none!important;margin:0!important;" src="http://www.assoc-amazon.com/e/ir?t=pupeno-20&amp;l=as2&amp;o=1&amp;a=B000002O4S" border="0" alt="" width="1" height="1" />)</li>
<li><a href="http://www.amazon.com/gp/product/B00008W2OO?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B00008W2OO">The Matrix Reloaded</a><img class=" zskafupwakbfjnrfwcnb zskafupwakbfjnrfwcnb" style="border:none!important;margin:0!important;" src="http://www.assoc-amazon.com/e/ir?t=pupeno-20&amp;l=as2&amp;o=1&amp;a=B00008W2OO" border="0" alt="" width="1" height="1" /> disc II and <a href="http://www.amazon.com/gp/product/B0000DJYQ4?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B0000DJYQ4">The Matrix Revolutions</a><img class=" zskafupwakbfjnrfwcnb zskafupwakbfjnrfwcnb" style="border:none!important;margin:0!important;" src="http://www.assoc-amazon.com/e/ir?t=pupeno-20&amp;l=as2&amp;o=1&amp;a=B0000DJYQ4" border="0" alt="" width="1" height="1" /> (but not <a href="http://www.amazon.com/gp/product/B00000IFW8?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B00000IFW8">The Matrix</a><img class=" zskafupwakbfjnrfwcnb zskafupwakbfjnrfwcnb" style="border:none!important;margin:0!important;" src="http://www.assoc-amazon.com/e/ir?t=pupeno-20&amp;l=as2&amp;o=1&amp;a=B00000IFW8" border="0" alt="" width="1" height="1" />, see a pattern there? sequels are worse, but get better music)</li>
<li><a href="http://www.amazon.com/gp/product/B0009IW88A?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B0009IW88A">Batman Begins</a><img class=" zskafupwakbfjnrfwcnb zskafupwakbfjnrfwcnb" style="border:none!important;margin:0!important;" src="http://www.assoc-amazon.com/e/ir?t=pupeno-20&amp;l=as2&amp;o=1&amp;a=B0009IW88A" border="0" alt="" width="1" height="1" /> (this one so so)</li>
</ul>
<p>I&#8217;m looking for more. There&#8217;s a clear pattern: instrumental and fast. It has to be of movies I&#8217;ve seen. When I listened repeatedly to Indiana Jones and the Last Crusade when I was a teenager I would recreate the whole movie in my head. I don&#8217;t do that anymore but the music still carries some subconscious meaning. I&#8217;ve tried with music of movies that I haven&#8217;t seen and it doesn&#8217;t work. And some don&#8217;t work and I don&#8217;t know why. These songs work as isolated songs, but not the whole album:</p>
<ul>
<li><a href="http://www.amazon.com/gp/product/B001O3SIBU?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B001O3SIBU">L&#8217;Enfant</a><img class=" zskafupwakbfjnrfwcnb zskafupwakbfjnrfwcnb" style="border:none!important;margin:0!important;" src="http://www.assoc-amazon.com/e/ir?t=pupeno-20&amp;l=as2&amp;o=1&amp;a=B001O3SIBU" border="0" alt="" width="1" height="1" /></li>
<li><a href="http://www.amazon.com/gp/product/B001NTH8CA?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B001NTH8CA">Blade Runner (End Titles)</a><img class=" zskafupwakbfjnrfwcnb zskafupwakbfjnrfwcnb" style="border:none!important;margin:0!important;" src="http://www.assoc-amazon.com/e/ir?t=pupeno-20&amp;l=as2&amp;o=1&amp;a=B001NTH8CA" border="0" alt="" width="1" height="1" /></li>
<li><a href="http://www.amazon.com/gp/product/B000WGTSZA?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B000WGTSZA">Chariots of Fire</a><img class=" zskafupwakbfjnrfwcnb zskafupwakbfjnrfwcnb" style="border:none!important;margin:0!important;" src="http://www.assoc-amazon.com/e/ir?t=pupeno-20&amp;l=as2&amp;o=1&amp;a=B000WGTSZA" border="0" alt="" width="1" height="1" /></li>
</ul>
<p>All by <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2Fs%3Fie%3DUTF8%26x%3D0%26ref%255F%3Dnb%255Fss%255Fdmusic%26y%3D0%26field-keywords%3Dvangelis%26url%3Dsearch-alias%253Daps&amp;tag=pupeno-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=390957">Vangelis</a><img class=" zskafupwakbfjnrfwcnb zskafupwakbfjnrfwcnb" style="border:none!important;margin:0!important;" src="https://www.assoc-amazon.com/e/ir?t=pupeno-20&amp;l=ur2&amp;o=1" border="0" alt="" width="1" height="1" /> of course. Star Wars music kind of works, but only some songs. I still have to sit down and select them (6 albums, lot of work). I remember other music like <a href="http://www.amazon.com/gp/product/B000002OW6?ie=UTF8&amp;tag=pupeno-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B000002OW6">Apollo 13</a><img class=" zskafupwakbfjnrfwcnb zskafupwakbfjnrfwcnb" style="border:none!important;margin:0!important;" src="http://www.assoc-amazon.com/e/ir?t=pupeno-20&amp;l=as2&amp;o=1&amp;a=B000002OW6" border="0" alt="" width="1" height="1" /> also worked, but I don&#8217;t have it anymore.</p>
<p>What do I mean by work? It seems that music speeds me up. It makes me work faster, concentrate more and enjoy myself more. It makes me not want to stop, like watching a good movie. What do you listen to? Any other movies with great coding music?</p>
<p><em>Reviewed by <a href="http://danielmagliola.com">Daniel Magliola</a>. Thank you!</em></p>
<br />Posted in Personal Tagged: code, coding, music, programming, working <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pupeno.wordpress.com/654/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pupeno.wordpress.com/654/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pupeno.wordpress.com/654/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pupeno.wordpress.com/654/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pupeno.wordpress.com/654/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pupeno.wordpress.com/654/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pupeno.wordpress.com/654/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pupeno.wordpress.com/654/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pupeno.wordpress.com/654/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pupeno.wordpress.com/654/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pupeno.wordpress.com/654/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pupeno.wordpress.com/654/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pupeno.wordpress.com/654/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pupeno.wordpress.com/654/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pupeno.com&amp;blog=8470507&amp;post=654&amp;subd=pupeno&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pupeno.com/2009/08/11/music-for-coding/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/931970b8dc51b72e05e3a12b88612d61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Pablo</media:title>
		</media:content>

		<media:content url="http://pupeno.files.wordpress.com/2009/08/back-to-the-future8.jpg?w=300" medium="image">
			<media:title type="html">Back to the Future</media:title>
		</media:content>

		<media:content url="http://www.assoc-amazon.com/e/ir?t=pupeno-20&#38;l=as2&#38;o=1&#38;a=B000002O6R" medium="image" />

		<media:content url="http://www.assoc-amazon.com/e/ir?t=pupeno-20&#38;l=as2&#38;o=1&#38;a=B001J32H6W" medium="image" />

		<media:content url="http://www.assoc-amazon.com/e/ir?t=pupeno-20&#38;l=as2&#38;o=1&#38;a=B000002O6R" medium="image" />

		<media:content url="http://www.assoc-amazon.com/e/ir?t=pupeno-20&#38;l=as2&#38;o=1&#38;a=B0000014RN" medium="image" />

		<media:content url="http://www.assoc-amazon.com/e/ir?t=pupeno-20&#38;l=as2&#38;o=1&#38;a=B000002O4S" medium="image" />

		<media:content url="http://www.assoc-amazon.com/e/ir?t=pupeno-20&#38;l=as2&#38;o=1&#38;a=B00008W2OO" medium="image" />

		<media:content url="http://www.assoc-amazon.com/e/ir?t=pupeno-20&#38;l=as2&#38;o=1&#38;a=B0000DJYQ4" medium="image" />

		<media:content url="http://www.assoc-amazon.com/e/ir?t=pupeno-20&#38;l=as2&#38;o=1&#38;a=B00000IFW8" medium="image" />

		<media:content url="http://www.assoc-amazon.com/e/ir?t=pupeno-20&#38;l=as2&#38;o=1&#38;a=B0009IW88A" medium="image" />

		<media:content url="http://www.assoc-amazon.com/e/ir?t=pupeno-20&#38;l=as2&#38;o=1&#38;a=B001O3SIBU" medium="image" />

		<media:content url="http://www.assoc-amazon.com/e/ir?t=pupeno-20&#38;l=as2&#38;o=1&#38;a=B001NTH8CA" medium="image" />

		<media:content url="http://www.assoc-amazon.com/e/ir?t=pupeno-20&#38;l=as2&#38;o=1&#38;a=B000WGTSZA" medium="image" />

		<media:content url="https://www.assoc-amazon.com/e/ir?t=pupeno-20&#38;l=ur2&#38;o=1" medium="image" />

		<media:content url="http://www.assoc-amazon.com/e/ir?t=pupeno-20&#38;l=as2&#38;o=1&#38;a=B000002OW6" medium="image" />
	</item>
	</channel>
</rss>
