<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Open eyes Working brain &#187; programming</title>
	<atom:link href="http://federico.galassi.net/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://federico.galassi.net</link>
	<description>dedicated, in respect and admiration, to the spirit that lives in the computer</description>
	<lastBuildDate>Wed, 25 May 2011 18:08:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>How I did It: Touch Typist in five months</title>
		<link>http://federico.galassi.net/2010/01/27/how-i-did-it-touch-typist-in-five-months/</link>
		<comments>http://federico.galassi.net/2010/01/27/how-i-did-it-touch-typist-in-five-months/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 17:22:52 +0000</pubDate>
		<dc:creator>federico</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[deep]]></category>
		<category><![CDATA[kaizen]]></category>
		<category><![CDATA[kata]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[practice]]></category>
		<category><![CDATA[touch]]></category>
		<category><![CDATA[type]]></category>
		<category><![CDATA[typeracer]]></category>
		<category><![CDATA[typing]]></category>
		<category><![CDATA[typingweb]]></category>
		<category><![CDATA[typist]]></category>
		<category><![CDATA[wpm]]></category>

		<guid isPermaLink="false">http://federico.galassi.net/?p=242</guid>
		<description><![CDATA[Until, from the midst of this darkness, a sudden light broke in upon me, a light so brilliant and wonderous, and yet so simple. Deep practice, eradicate errors and deep practice again. I alone succeeded in discovering the secret of bestowing skill. Nay, even more, I myself became capable of bestowing mastery upon apprentice matter. [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><img class="alignright size-full wp-image-243" title="it-could-work" src="http://federico.galassi.net/wp-content/uploads/2010/01/it-could-work.jpg" alt="it-could-work" width="200" height="157" />Until, from the midst of this darkness, a sudden light broke in upon me, a light so brilliant and wonderous, and yet so simple. Deep practice, eradicate errors and deep practice again. I alone succeeded in discovering the secret of bestowing skill. Nay, even more, I myself became capable of bestowing mastery upon apprentice matter.</p>
<p><strong>It could work.</strong></p></blockquote>
<p>At the end of august 2009, while i was reading about <a href="http://steve-yegge.blogspot.com/2008/09/programmings-dirtiest-little-secret.html">the importance for a programmer to touch type</a>, i found out many programmers could type at 80 <a href="http://en.wikipedia.org/wiki/Words_per_minute">wpm</a> and above. I tried myself and consistently scored 60 wpm or below. I have been spending many hours a day at the keyboard since at least 1996. How could it be i am not as fast? I already knew about the importance of practice, but i did practice for years, didn&#8217;t I? Well, uhm, no.</p>
<p>Think of the career of a professional <a href="http://en.wikipedia.org/wiki/Soccer_player">football (soccer) player</a>. How does he get there, does he play all the time for years? Actually, he spends most of the week <a href="http://www.soccer-training-info.com/sample_workout_routine.asp">training</a>: stretching, pushups, sprints, weights, long runs, ball work, etc&#8230; Only a small percentage of time is indeed to play short games and the main game on sunday. That&#8217;s because play alone can only push your performance to the upper end of the range set by current skill. It&#8217;s not going to push you to the next level, to the next order of magnitude, and it doesn&#8217;t keep you from developing bad habits. And that&#8217;s where i got, very fast at typing in my very flawed 7-fingers posture. Not able to improve any further, not even in more than 10 years.</p>
<p>I really <a href="http://en.wikipedia.org/wiki/Kaizen">wanted to get better</a>, so the questions were How? and How long will it take? I didn&#8217;t know the answer to the latter but the former was by then clear in my mind. Find a keyboard dojo, do keyboard <a href="http://federico.galassi.net/2009/09/02/code-katas-programmers-deep-practice/">katas</a> and take the needed time. After trying a lot of viable solutions i found my dojo at <a href="http://www.typingweb.com/">www.typingweb.com</a>. To add some salt to the challenge i switched keyboard layout from italian to U.S., which is quite better for programming, and i started practicing daily with their courses, routinely taking tests to record my progress. Two <a href="www.pomodorotechnique.com/">pomodoros</a> a day for the first two months, then one, then again two when i was reaching the end. Always striving to get 97% or above accuracy at the higher possible speed for every single lesson.</p>
<p>Now, five months and about 120 pomodoros of deep practice later, i am writing this to shout to the world that IT COULD WORK. Next i&#8217;ll be moving to <a href="http://federico.galassi.net/2009/07/31/vim-or-the-inevitable-value-of-complexity/">vim</a> katas, while still having some fun at <a href="http://www.typeracer.com">www.typeracer.com</a>, because you never really stop to practice right?!</p>
<p style="text-align: right;">Yours sincerely,<br />
ten fingers typist<br />
american layout<br />
80 wpm average<br />
up to 100 wpm under a good moon<br />
Federico.</p>
<p style="text-align: right;"><img class="aligncenter size-full wp-image-252" title="typing_sep09" src="http://federico.galassi.net/wp-content/uploads/2010/01/typing_sep092.png" alt="typing_sep09" width="573" height="282" /></p>
<p style="text-align: right;"><img class="aligncenter size-full wp-image-251" title="typing_nov09-gen10" src="http://federico.galassi.net/wp-content/uploads/2010/01/typing_nov09-gen10.png" alt="typing_nov09-gen10" width="573" height="284" /></p>
<p style="text-align: right;">
]]></content:encoded>
			<wfw:commentRss>http://federico.galassi.net/2010/01/27/how-i-did-it-touch-typist-in-five-months/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Performance: Make the Browser Happy (and You Sad)</title>
		<link>http://federico.galassi.net/2009/11/15/javascript-performance-make-the-browser-happy-and-you-sad/</link>
		<comments>http://federico.galassi.net/2009/11/15/javascript-performance-make-the-browser-happy-and-you-sad/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 20:40:11 +0000</pubDate>
		<dc:creator>federico</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[simplicity]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[aptimize]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[closure]]></category>
		<category><![CDATA[compilers]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[foreach]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[mark]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[twain]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://federico.galassi.net/?p=193</guid>
		<description><![CDATA[The browser is emerging as the best platform for applications, so a large community is growing to address its final weakness: speed. Google, Yahoo and various independent programmers are all pushing a bunch of clever techniques to boost performance and please end users. That&#8217;s nice, yet as Mark Twain once said, half of the results of good [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-203" title="BENDER" src="http://federico.galassi.net/wp-content/uploads/2009/11/BENDER1.jpeg" alt="BENDER" width="232" height="184" />The browser is emerging as the <a href="http://en.wikipedia.org/wiki/HTML5">best platform</a> for applications, so a large community is growing to address its final weakness: speed. <a href="http://code.google.com/speed/">Google</a>, <a href="http://developer.yahoo.com/performance/">Yahoo</a> and <a href="http://javascriptrocks.com/performance/">various independent programmers</a> are all pushing a bunch of clever techniques to boost performance and please end users. That&#8217;s nice, yet as Mark Twain once said, <em>half of the results of good intentions are evil</em> and i see potential danger in many of the suggestions made. Here a representative short list of them:</p>
<ul>
<li>Avoid for-in and forEach in favor of optimized while loops</li>
<li>Before making modifications to a DOM node remove it and then re-insert it</li>
<li>To insert multiple DOM nodes, first insert them into a Document Fragment and then add it to the DOM</li>
<li>Join all scripts into a single file</li>
<li>Load javascript files on demand</li>
</ul>
<p>Let&#8217;s make it clear for once, execution speed is not a human problem, that&#8217;s what computers are for, they execute our commands fast. The human problem is programming speed and writing down clear, readable, maintainable commands aka programs. forEach loops make sense to me, they say &#8220;i want to do something on each item&#8221;, optimized while loops make sense to computers. If i want to add DOM nodes or modify one, i don&#8217;t care of removing it or document fragments, browsers care. To me it&#8217;s just noise. Almost all of the problems addressed by those techniques stem from lack of smartness in the browser, and that&#8217;s where fixes belong to, on the machine side. The fact that there are <a href="http://www.microsoft.com/windows/Internet-explorer/default.aspx">inept browser makers</a> is no excuse. Fixes still belong to the machine, they&#8217;re repeatable and can be made automatic. We have a long history of programs automatically converting human friendly code to machine friendly code. They&#8217;re called <a href="http://en.wikipedia.org/wiki/Compiler">compilers</a> and the output either machine code or optimized javascript doesn&#8217;t matter.</p>
<p>So, learn about javascript performance since knowledge is always the way, but don&#8217;t turn yourself into a machine, you&#8217;d be an awful one. Use the tools and wait for browsers to catch up.</p>
<ul>
<li><a href="http://www.aptimize.com/">Aptimize</a></li>
<li><a href="http://code.google.com/closure/compiler/">Closure Compiler</a></li>
<li><a href="http://developer.yahoo.com/yui/3/yui/#use">YUI 3 use</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://federico.galassi.net/2009/11/15/javascript-performance-make-the-browser-happy-and-you-sad/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Test Automation Conference: Testing is not enough</title>
		<link>http://federico.galassi.net/2009/10/26/google-test-automation-conference-testing-is-not-enough/</link>
		<comments>http://federico.galassi.net/2009/10/26/google-test-automation-conference-testing-is-not-enough/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 00:19:22 +0000</pubDate>
		<dc:creator>federico</dc:creator>
				<category><![CDATA[great people]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[simplicity]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[abstraction]]></category>
		<category><![CDATA[declarative]]></category>
		<category><![CDATA[dsl]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[gtac]]></category>
		<category><![CDATA[niklaus]]></category>
		<category><![CDATA[wirth]]></category>

		<guid isPermaLink="false">http://federico.galassi.net/?p=164</guid>
		<description><![CDATA[If i had to award the best talk at GTAC 2009, the no-brainer choice would be Prof. Niklaus Wirth opening talk. That&#8217;s not surprising if you consider who the speaker is, one of the great pioneers of computer science in the field of programming languages. What&#8217;s most surprising to me is that he presented a [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-170" title="niklaus wirth at google" src="http://federico.galassi.net/wp-content/uploads/2009/10/niklaus.jpg" alt="niklaus wirth at google" width="238" height="240" /></p>
<p>If i had to award the best talk at <a href="http://www.gtac.biz/">GTAC 2009</a>, the no-brainer choice would be Prof. <a href="http://en.wikipedia.org/wiki/Niklaus_Wirth">Niklaus Wirth</a> <a href="http://www.youtube.com/watch?v=8W5Jd_wzB90">opening talk</a>. That&#8217;s not surprising if you consider who the speaker is, one of the great pioneers of computer science in the field of <a href="http://en.wikipedia.org/wiki/Pascal_(programming_language)">programming languages</a>. What&#8217;s most surprising to me is that he presented a (pre)historical review of problems which turned out to be incredibly relevant today and, somehow, forced me to reframe my understanding of testing.</p>
<p><span style="background-color: #ffffff;">Building on <a href="http://www.cs.utexas.edu/users/EWD/transcriptions/EWD03xx/EWD340.html">1972 Dijkstra dismissal of software testing</a></span></p>
<blockquote><p><span style="background-color: #ffffff;">program testing can be a very effective way to show the presence of bugs, but is hopelessly inadequate for showing their absence.</span></p></blockquote>
<p><span style="background-color: #ffffff;">Wirth explained that testing is treating symptoms instead of the disease, with the disease being our failure to prove correctness of programs by analytical means. This failure has its roots in distant past but it still holds today with languages and tools too complex and unreliable. Languages and tools providing proper abstraction, <em>really</em> hiding the system beneath, would give us the simple and rigorous ground to make programs easy to prove correct, so that no testing would be needed. Unfortunately, this looks far from happening</span></p>
<blockquote><p><span style="background-color: #ffffff;">Programming languages are further from being mathematically nice than they were 50 years ago! They&#8217;re huge and complicated. They contain big libraries, and most of a programmer&#8217;s time is spent finding and learning the right libraries.</span></p></blockquote>
<p><span style="background-color: #ffffff;">and again</span></p>
<blockquote><p><span style="background-color: #ffffff;">What progress has this field actually made? We still struggle with the same problems as 50 years ago: iteration times, debugging, scratching our heads trying to figure out what went wrong.<span> </span></span></p></blockquote>
<p><span style="background-color: #ffffff;"><span>How insightful! Empirical evidence that computer science made no sizable improvement in software construction is everywhere. It&#8217;s like a hamster in a wheel, running nowhere. Why is that? Maybe, we&#8217;ve been piling </span><a href="http://www.joelonsoftware.com/articles/LeakyAbstractions.html">leaky abstractions</a><span> on leaky abstractions, apparently hiding information without really simplifying, to the point where progress is drowning in complexity.</span></span></p>
<p><span style="background-color: #ffffff;"><span>Testing is a nice way to easily lay down executable specifications, yet it requires maintenance and quickly degrades as we try to cover more cases. But when we code we have the chance to write self-describing programs which </span><em>are</em><span> executable specifications, reducing the coverage of tests needed, ideally to zero.</span></span></p>
<p>What does it mean in practice? Whenever it&#8217;s possible one should aim at <a href="http://en.wikipedia.org/wiki/Declarative_programming">declarative code</a>. <a href="http://www.martinfowler.com/bliki/DomainSpecificLanguage.html">Domain specific languages</a> and <a href="http://en.wikipedia.org/wiki/Functional_programming">functional programming</a> come to mind. The point being, if a program matches closely its specification, what&#8217;s left to test?</p>
<pre class="brush: ruby">def factorial(n)
    if n == 0
        1
    else
        n * factorial(n-1)
    end
end</pre>
]]></content:encoded>
			<wfw:commentRss>http://federico.galassi.net/2009/10/26/google-test-automation-conference-testing-is-not-enough/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Katas: Programmer&#8217;s Deep Practice</title>
		<link>http://federico.galassi.net/2009/09/02/code-katas-programmers-deep-practice/</link>
		<comments>http://federico.galassi.net/2009/09/02/code-katas-programmers-deep-practice/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 17:27:46 +0000</pubDate>
		<dc:creator>federico</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[deep]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[kaizen]]></category>
		<category><![CDATA[kata]]></category>
		<category><![CDATA[master]]></category>
		<category><![CDATA[practice]]></category>
		<category><![CDATA[talent]]></category>

		<guid isPermaLink="false">http://federico.galassi.net/?p=148</guid>
		<description><![CDATA[I&#8217;ve recently blogged about talent and how it&#8217;s grown through disciplined, committed, error focused practice at the edge of your ability, known as deep practice. I guess now it makes sense to approach it from the perspective of programming: What&#8217;s programmer&#8217;s deep practice? Unsurprisingly, inspiration can be found in the great japanese culture, people who [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-149" style="margin: 2px;" title="karate_champ" src="http://federico.galassi.net/wp-content/uploads/2009/09/karate_champ.png" alt="karate_champ" width="180" height="206" />I&#8217;ve recently <a href="http://federico.galassi.net/2009/08/28/teach-yourself-anything-in-10000-hours/">blogged about talent and how it&#8217;s grown</a> through disciplined, committed, error focused practice at the edge of your ability, known as deep practice. I guess now it makes sense to approach it from the perspective of programming: What&#8217;s programmer&#8217;s deep practice? Unsurprisingly, inspiration can be found in the great japanese culture, people who highly value <a href="http://en.wikipedia.org/wiki/Bushid%C5%8D">discipline</a> and <a href="http://en.wikipedia.org/wiki/Kaizen">self improvement</a>. Specifically i&#8217;m talking of martial arts. If you were to learn, say, karate you would go to a <a href="http://en.wikipedia.org/wiki/Dojo">dojo</a> and perform <a href="http://en.wikipedia.org/wiki/Kata">katas</a>. If you happen to be a programmer, you can go to a coding dojo and practice code katas.</p>
<p><a href="http://en.wikipedia.org/wiki/Kata_%28programming%29">Code katas</a>, a term first coined by Pragmatic Programmer <a href="http://en.wikipedia.org/wiki/Dave_Thomas_%28programmer%29">Dave Thomas</a>, are small programming exercises geared to hone a specific programming skill. Traditionally, they tend to be <a href="http://en.wikipedia.org/wiki/Algorithm">algorithmic</a> like parsing or visiting graphs but could as well aim to improve understanding of particular <a href="http://en.wikipedia.org/wiki/Programming_paradigm">programming paradigms</a>, like functional or object oriented, or a specific language. Also, <a href="http://matteo.vaccari.name/blog/archives/177">as remarkably pointed out by Matteo</a>, katas can be crafted to master a certain technology like web or database. While, as you may guess, Coding Dojos are sites, groups or communities which propose and maintain collections of katas hopefully with solutions and reviews.</p>
<p>So, how do you practice? I suggest you solve a kata, review your work, compare it to other solutions, share your code with others and discuss it. Then solve it again trying to take a different path, balance pros and cons, then solve it again and again, until you <em>feel you internalized the essence of the problem</em>. Finally, you can move to another kata. If it feels like a lot of work, then you got it right. No question mastership requires time and effort but, then again, masters are those destined for greatness.</p>
<p><strong>Resources</strong></p>
<ul>
<li><a href="http://www.katacasts.com/">Katacasts</a></li>
<li><a href="http://codekata.pragprog.com/2007/01/code_kata_backg.html">21 Code Katas by Dave Thomas</a></li>
<li><a href="http://www.rubyquiz.com/">Lots of Code Quizzes with Ruby Solutions</a></li>
<li><a href="http://matteo.vaccari.name/blog/archives/177">Matteo Vaccari&#8217;s Technological Katas</a></li>
<li><a href="http://codingdojo.org/cgi-bin/wiki.pl?KataCatalogue">Coding Dojo Code Katas</a></li>
<li><a href="http://charlesmaxwood.com/8-lessons-from-corey-haines-performance-kata/">Corey Haines Video Solution in Ruby of String Template</a></li>
<li><a href="http://butunclebob.com/ArticleS.UncleBob">Uncle Bob</a> Code Katas (search &#8220;kata&#8221;, ie bowling kata)</li>
<li><a href="http://rubyconf2008.confreaks.com/ruby-kata-and-sparring.html">Micah Martin on Code Katas and Video Solution in Ruby of Langton&#8217;s Ant</a></li>
<li><a href="http://sparring.rubyforge.org/battleship/">Micah Martin&#8217;s BattleShip Tournament</a></li>
<li><a href="http://code.google.com/codejam/">Google Code Jam</a></li>
<li><a href="http://www.codinghorror.com/blog/archives/001138.html">Jeff Atwood on Code Katas</a></li>
<li><a href="http://steve.yegge.googlepages.com/practicing-programming">Steve Yegge on Code Katas<br />
</a></li>
<li><a href="http://norvig.com/21-days.html">Peter Norvig on Deep Practice</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://federico.galassi.net/2009/09/02/code-katas-programmers-deep-practice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

