<?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>szafranek.net &#187; Programming</title>
	<atom:link href="http://www.szafranek.net/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.szafranek.net</link>
	<description>The homepage of Krzysztof Szafranek, a guy who makes websites</description>
	<lastBuildDate>Sun, 22 Jan 2012 14:28:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Front Row 2011: Productive JavaScript Workflow</title>
		<link>http://www.szafranek.net/blog/2011/10/27/front-row-2011-productive-javascript-workflow/</link>
		<comments>http://www.szafranek.net/blog/2011/10/27/front-row-2011-productive-javascript-workflow/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 11:08:44 +0000</pubDate>
		<dc:creator>Szafranek</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://szafranek.net/?p=1644</guid>
		<description><![CDATA[JavaScript is used more and more for writing large web applications. My recent presentation at Front Row 2011 explores the topic, but there's still much more to it.]]></description>
			<content:encoded><![CDATA[<p>Last week I visited Cracow to speak at <a href="http://frontrowconf.com/">Front Row 2011</a>. The conference was a small event with a nice, friendly atmosphere. If you understand Polish (or don&#8217;t mind using <a href="http://translate.google.com/translate?sl=pl&amp;tl=en&amp;js=n&amp;prev=_t&amp;hl=en&amp;ie=UTF-8&amp;layout=2&amp;eotf=1&amp;u=http%3A%2F%2Fblog.end3r.com%2F162%2Ffront-row-2011-w-krakowie-relacja-z-konferencji%2F">Google Translate</a>), you can read a summary of the talks on <a href="http://blog.end3r.com/162/front-row-2011-w-krakowie-relacja-z-konferencji/">End3r&#8217;s blog</a>. My personal favorites were:</p>

<ul>
	<li><a href="http://www.slideshare.net/wojciechzajac/top-mistakes-in-web-accessibility">Wojtek Zając&#8217;s presentation on web accessibility</a>, full of practical tips.</li>
	<li><a href="http://www.slideshare.net/zefhemel/frontrow-conf">Zef Hemel&#8217;s talk</a> about <a href="http://c9.io/">Cloud9 IDE</a>. I had a chance to talk with Zef in person and I was quite impressed by the technical sophistication of Cloud9.</li>
	<li><a href="http://www.slideshare.net/stopsatgreen/the-css-of-tomorrow-front-row-2011">Peter Gasston&#8217;s talk</a> about new exciting features from CSS3 and CSS4. While I have heard before about flex box or CSS regions, it was interesting to learn how exactly they work. Peter presented upcoming solutions to problems that CSS currently suffers from, like difficulties with grid layouts.</li>
</ul>

<p>Jake Archibald closed the conference with <a href="http://www.slideshare.net/jaffathecake/in-your-fontface" title="In your @font-face">one the best talks</a> I&#8217;ve heard on any conference. He managed to explain obscure technical issues with web fonts in a hilarious way that kept interested even people who are less-than-thrilled about typography.</p>


<p>In my presentation I shared learnings from working on a large front-end codebase at Nokia. For some time I&#8217;ve been obsessed with the problem of scaling up front-end teams, so they could stay effective when dealing with complexity. I didn&#8217;t dwell on architecture, but focused on workflow and tools. While preparing the presentation I assumed that some techniques popular among back-end developers, like unit testing or continuous integration, are still not adopted by most JavaScript developers.</p>

<p>I showed how these techniques can be applied to front-end development. I also demonstrated how to use jslint to detect mistakes before they show up in a browser and how to work with team mates to learn from them and improve code quality.</p>

<p>Just prior to the presentation I realized that instead of relying on accidental knowledge and assumptions it would be better to perform a research and verify how popular are these tools among JavaScript programmers. Thus the survey: <a href="http://braun.questionform.com/public/JavaScript-development-practices">JavaScript development practices</a>.</p>

<p>I will share more of my own experiences in a future blog post, but I also want to know how much of what I have learned is a common knowledge. The survey will be active for about a week. In November I will publish the results, together with more practical tips on individual techniques covered in my Front Row presentation.</p>

<p>Big thanks to people who gave me feedback after the talk and everybody who has voted already! If you&#8217;re a JavaScript developer and haven&#8217;t completed the survey yet, <a href="http://braun.questionform.com/public/JavaScript-development-practices">please do so</a> – it doesn&#8217;t take more than 2 minutes.</p>]]></content:encoded>
			<wfw:commentRss>http://www.szafranek.net/blog/2011/10/27/front-row-2011-productive-javascript-workflow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Retreat</title>
		<link>http://www.szafranek.net/blog/2011/07/12/code-retreat/</link>
		<comments>http://www.szafranek.net/blog/2011/07/12/code-retreat/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 22:52:19 +0000</pubDate>
		<dc:creator>Szafranek</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://szafranek.net/?p=1638</guid>
		<description><![CDATA[Impressions from my first Code Retreat event in Berlin.]]></description>
			<content:encoded><![CDATA[<p>Last Saturday I participated in <a href="http://www.coderetreat-berlin.de/">Code Retreat in Berlin</a>. Code Retreats are small events where programmers practice together <a href="http://www.jbrains.ca/permalink/the-four-elements-of-simple-design">Four Elements of Simple Design</a>, defined as:</p>

<ol>
	<li>Testing; in practice it is about Test Driven Development, where tests are written before the implementation.</li>
	<li>Minimizing code duplication.</li>
	<li>Maximizing clarity; it comes to down to meaningful naming.</li>
	<li>Removing unnecessary elements. That postulate usually is naturally met when previous two are done properly.</li>
</ol>

<p>The event was free (thanks to sponsors) and attracted almost 50 passionate programmers. There were people not only from Berlin, but also other places in Germany, Poland, Sweden and Czech Republic. Our facilitator was <a href="http://www.alexbolboaca.ro/">Alex Bolboaca</a> from Romania.</p>


<div class="figure">
	<a class="page" href="http://www.flickr.com/photos/60906583@N08/5928032322/" title="Retrospective"><img src="http://farm7.static.flickr.com/6022/5928032322_13766a625e_m.jpg" width="240" height="159" alt="Retrospective"/></a>
    <div class="legend">
        Retrospective. Photo credit by <a href="http://www.flickr.com/photos/60906583@N08/">Łukasz Bałamut</a>.
    </div>
</div>


<p>During a Retreat participants are given a practical programming problem to “implement”: <a href="en.wikipedia.org/wiki/Conway's_game_of_life">Conway&#8217;s Game of Life</a>. I put “implement” in quotes because the real goal is to work on the quality of the code and programming skills, not completing the solution. The day is divided into six 45-minute sessions. At the end of each session code has to be <strong>deleted</strong> and the whole group has short retrospective. Programming is done in pairs and you should switch your partner after each session. Usually sessions have particular focus, like working on more flexible implementation, better naming, shorter methods, etc.</p>

<p>The event started at 8am on Saturday (!) and it seems to be designed to work like a natural preselection. Only people truly enthusiastic about programming made the sacrifice. I was genuinely impressed by the atmosphere. All the people were really friendly, and since there was no pressure on finishing the project, everybody was relaxed.</p>

<p>I must admit that I fell in love with Code Retreat. The idea of pair programming with total strangers may look daunting (“Gosh, all these guys must be a thousand times better than me! I can&#8217;t possibly pair up with any of them!”), but the program is constructed in a way that lets one focus on the craft and co-operation, instead of competing for the solution. When you realize that it&#8217;s not about stitching together a functioning program with the help of duct tape, you can relax and focus on improving your craft. This realization reached me during the 3rd of 6 sessions :).</p>

<h4>Getting the most out of it</h4>
<p>Some practical advice from a one-time “veteran”:</p>

<ul>
	<li>Bring your own computer and have your environment (editor, unit testing framework) ready. There&#8217;s really not enough time to setup everything during a session and you will loose precious time that could be better spent on writing the code.</li>
	<li>Pair up with different people, even if you don&#8217;t know the language they&#8217;re using. In Berlin we had people coding in Java, JavaScript, Scala, Python, Ruby, C# and I even heard Haskell being mentioned by somebody.</li>
</ul>


<div class="figure">
	<a class="page" href="http://www.flickr.com/photos/60906583@N08/5927467239/" title="Hard at work"><img src="http://farm7.static.flickr.com/6129/5927467239_7b64d221f6_m.jpg" width="160" height="240" alt="Hard at work"/></a>
    <div class="legend">
        Hard at work. Photo credit by <a href="http://www.flickr.com/photos/60906583@N08/">Łukasz Bałamut</a>.
    </div>
</div>



<p>I wouldn&#8217;t mind at all to participate in another Retreat, as there are things I would do a bit differently the second time.</p>
<ul>
	<li>I had most fun when I tried to do things differently from my normal programming routine. For instance, writing Ruby instead of JavaScript. Pairing up with a total stranger. Trying to remove duplication from the code that already seemed clean.</li>
	<li>Switch pairs each time. The event attracts passionate people, so use the opportunity to pair up with as many of them as possible.</li>
	<li>Focus on some aspect of the problem instead of the complete solution. Me and my partner literally wasted one session when we tried to analyze the problem with pen and paper, instead of WRITING THE CODE. It would be perfectly reasonable in real work, but this event is about improving programming skills, not analysis. However, I think it is OK to think about the problem up-front and even have the solution in mind. Optimize for having as much time as possible to write the code during the event.</li>
</ul>

<p>If you&#8217;re a programmer yourself, why not to organize Code Retreat in your city? It may turn out to be awesome. If you&#8217;re willing to try, Alex Bolboaca has some <a href="http://www.alexbolboaca.ro/wordpress/articles/how-to-organize-a-code-retreat" title="How to Organize A Code Retreat">advice for future facilitators</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.szafranek.net/blog/2011/07/12/code-retreat/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Front-Trends 2010</title>
		<link>http://www.szafranek.net/blog/2010/11/03/front-trends-2010/</link>
		<comments>http://www.szafranek.net/blog/2010/11/03/front-trends-2010/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 01:37:39 +0000</pubDate>
		<dc:creator>Szafranek</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Webstandards]]></category>

		<guid isPermaLink="false">http://szafranek.net/?p=1545</guid>
		<description><![CDATA[Front-Trends 2010 was a conference with ambitions. How it turned out eventually? See my impressions from the conference.]]></description>
			<content:encoded><![CDATA[<p>
I was happy to learn this spring that people I had a pleasure to work with are going organize in Poland a conference about front-end development. I was thrilled primarily because such events haven&#8217;t been hosted before in my country. When the speaker line-up was announced it turned out that there&#8217;s much more to be excited about than the location. With names such as Douglas Crockford, Peter Paul Koch and Tantek Çelik it looked more than promising.
</p>
<p>
The <a href="http://front-trends.com/">Front-Trends 2010</a> conference took place last week. How did it go? Excellent.
</p>

<p>Subjects ranged from web and mobile design, through CSS and markup to unit testing and server-side JavaScript. With the name of the conference explicitly mentioning trends, I was looking for some of them in the talks. In fact trends did emerge.</p>

<h4>Mobile</h4>

<p>I have been hearing about the need for focus on mobile web since years. Phones with web browsers have been around for a decade. So what&#8217;s the deal? Well, we reached a point when designing for mobile is not an extra activity that requires knowledge about obscure phone-only technologies (anybody still remembers WAP?). We can finally apply existing knowledge about web standards such as CSS and HTML. Surprisingly, contemporary smartphones often provide better capabilities than their desktop counterparts: Webkit has become a de facto standard rendering engine for the phones, while desktop web still struggles with IE6 legacy. Last but not least, better touch screens make browsing on the phone a pleasure rather than sadomasochistic experience it was just few years ago.</p>

<p>The subject of mobile web appeared in few presentations:</p>
<ul>
    <li><a href="http://www.thinmachine.ch/presentations/ft2010/">“You know WebOS”</a> by Markus Leutwyler</li>
    <li>“Cross-Device Applications Development”, talk about <a href="http://www.phonegap.com/">PhoneGap</a> by <a href="http://twitter.com/KamilTrebunia">Kamil Trebunia</a></li>
    <li>“Mobile UX and Current Trends in Mobile Design” by <a href="http://ribot.co.uk/">Antony Ribot</a></li>
    <li><a href="http://www.quirksmode.org/blog/archives/2010/10/fronttrends_sli.html">“JSON over SMS”</a> by Peter Paul Koch</li>
</ul>

<div class="figure">
    <a href="http://www.flickr.com/photos/krzysztofdanek/5108040733/" title="PPK and Douglas Crockford - Panel Discussion by Krzychu Danek, on Flickr" class="page"><img src="http://farm2.static.flickr.com/1161/5108040733_f38057f818_m.jpg" width="240" height="160" alt="PPK and Douglas Crockford - Panel Discussion" /></a>
    <div class="legend">
        PPK and Douglas Crockford &#8211; Panel Discussion; photo credit by <a href="http://www.flickr.com/photos/krzysztofdanek/">Krzysztof Danek</a>
    </div>
</div>

<p>Koch&#8217;s talk was certainly one of my favorites. For the last two years PPK has been working for Vodafone on what he does best: discovering quirks and bugs in browsers. Except this time he&#8217;s been doing this in the wild mobile world, where the sheer amount of browsers, resolutions, viewports and phone models can give a headache. In his talk he tried to predict how the mobile landscape will look like in 2018, when phones as powerful as today&#8217;s iPhone 3G will be accessible at 10 euro price tag. Make sure to check back this blog post in eight years to verify PPK&#8217;s predictions:</p>

<ul>
    <li>HTML5 apps are the future, not the native ones. Only applications written with open standards ensure cross-platform interoperability and thus the broadest reach.</li>
    <li>App stores are destined to die. There&#8217;s already at least 41 of them – Apple&#8217;s App Store is just one of the many. The value they provide is either overrated (discoverability), already provided by others (payments have been handled by operators for years) or will be replaced by open standards (common APIs). What I am missing on this list is the convenience for users, so I wonder how this particular prediction will turn out.</li>
    <li>Access to phone features (calls, camera, storage etc.) will be standardized across different devices. <a href="http://www.wholesaleappcommunity.com/" title="Wholesale Applications Community">WAC</a> initiative is a step in that direction.</li>
    <li>High-speed network coverage will not grow as fast as the computing power of mobile devices. Thus there still will be the need for efficient and cheap data transfer format. This format could be a streamlined version of JSON sent over SMS (thus the title of the talk).</li>
    <li>We are about to see some totally new JavaScript events untangled by mobile devices, way beyond desktop metaphors such as click and hover. Think events like <code>orientationchange</code>, <code>phonecall</code>, <code>move</code> (GPS location change), <code>cameraopen</code>. Mobile context enables creativity that&#8217;s been somewhat missing in the desktop web in the last ten years.</li>
</ul>


<p>
My personal takeaway from the talks on mobile is that it&#8217;s worth to invest time <em>now
</em> in learning how to design for this new environment. It&#8217;s not that hard to adapt existing web sites and web applications to mobile devices, but it requires consideration during design and development phases. Reasonably working devices and standards are already there. The share of users accessing the web through phones will only continue to grow.
</p>

<h4>JavaScript as THE programming language of the web</h4>
<p>
JavaScript has been around for over a decade and from the beginning it was used to spice up user interface (as any other spice, it has been widely abused). In the last 5 years – after “Ajax revolution” – it has become indispensable ingredient of web applications with heavy client. So what&#8217;s the news here? I think there are two, actually:
</p>
<div class="figure">
    <a href="http://www.flickr.com/photos/morganroderick/5130688735/" title="Douglas Crockford by Morgan Roderick, on Flickr" class="page"><img src="http://farm2.static.flickr.com/1222/5130688735_dcfcf11046_m.jpg" width="160" height="240" alt="DSC_0149" /></a>
    <div class="legend">
        Douglas Crockford; photo credit by <a href="http://www.flickr.com/photos/morganroderick/">Morgan Roderick</a>
    </div>
</div>
<ol>
    <li><strong>JavaScript is now used for more complex tasks than ever before.</strong> Animations and DOM interactions, integration of browser APIs and web services – all this is done with JavaScript. As the applications become more complex, development style for JavaScript has changed. It&#8217;s no longer the fragile cycle: write, reload, pray it works. With tools like JSLint, Firebug and unit testing frameworks it&#8217;s finally possible to efficiently develop and debug even large JavaScript codebases. With complexity came new design challenges and the notion of “JavaScript application architecture” doesn&#8217;t sound ridiculous anymore.</li>
    <li><strong>JavaScript expands to the server side.</strong> This idea is not new. Proprietary solutions utilizing JavaScript syntax on the server side have been around since 1990&#8242;s, with Microsoft JScript being the most popular. But with <a href="http://nodejs.org/">node.js</a> there seems to be finally a framework that embraces language&#8217;s philosophy (like architecture based on asynchronous callbacks) instead of merely using familiar syntax.</li>
</ol>

<p>
This changed approach to JavaScript was reflected in several talks:
</p>

<ul>
    <li><a href="http://www.slideshare.net/shadedecho/rise-of-the-middle-end">“JavaScript: The Rise of the Middle-End”</a> by Kyle Simpson</li>
    <li>“Testing JavaScript” by <a href="http://roderick.dk/">Morgan Roderick</a></li>
    <li><a href="http://cjohansen.no/en/javascript/fronttrends_2010">“Test-First JavaScript”</a> by Christian Johansen</li>
    <li><a href="http://webreflection.blogspot.com/2010/10/front-trends-2010-my-talk.html">“JS Performances vs Common Good Practices”</a> by Andrea Giammarchi</li>
    <li><a href="http://www.slideshare.net/cheilmann/using-web-services-with-javascript-fronttrends-2010">“Using Web Services with JavaScript”</a> by Chris Heilman</li>
    <li><a href="http://www.yuiblog.com/blog/2010/08/30/yui-theater-douglas-crockford-crockford-on-javascript-scene-6-loopage-52-min/">“Server-Side JavaScript”</a> by Douglas Crockford</li>
    <li><a href="http://www.slideshare.net/jaffathecake/reusable-code-for-good-or-for-awesome">“Reusable Code, For Good Or For Awesome”</a> by Jake Archibald</li>
</ul>

<p>While I skipped the talks about unit testing (having a conference with two tracks enforces tough choices), it&#8217;s encouraging to see that unit testing and Test Driven Development are not anymore alien concepts in JavaScript world. To the point that they deserved a <a href="http://www.amazon.com/Test-Driven-JavaScript-Development-Developers-Library/dp/0321683919" title="Test-Driven JavaScript Development on Amazon">600-page book</a> written by one of the speakers. (Fortunately it&#8217;s not obligatory to read it in order to start writing unit tests in JavaScript.)</p>

<p>Kyle Simpson&#8217;s and Douglas Crockford&#8217;s talks addressed the subject of server-side JavaScript. It&#8217;s still in its infancy – e.g. there are not many libraries out there and even node.js is in an early phase – but I hope that eventually we will be able to run the same code on the server and the client. That was the premise of Kyle&#8217;s talk about middle-end, which was a fancy name for JS code that bridges the gap between the client and the server. Think about solution for eternal problem of validation code repeated in JavaScript and server-side language.</p>

<p>An interesting point was made by Douglas Crockford during the (excellent) panel discussion with PPK and Tantek Çelik: JavaScript has become a Virtual Machine for the world. Any application doing anything interesting on the web right now has to execute JavaScript in the browser runtime. It&#8217;s especially striking with projects like <a href="http://code.google.com/webtoolkit/" title="Google Web Toolkit">GWT</a>, that allow developers to use their language of choice (in this case: Java), but eventually compile to JavaScript for execution.</p>

<p>One of the most inspiring talks of the whole conference was delivered by <a href="http://www.wait-till-i.com/">Chris Heilman</a>. He first showed how to use JavaScript to create mashups connecting data from different REST web services. While totally feasible and not too complex, the task can quickly become tedious when developer has to go through registration process for different APIs and learn their details. Therefore in the second part Chris showed how to reduce the whole effort to two lines of code. Silver bullet? In fact it&#8217;s <a href="http://developer.yahoo.com/yql/">YQL</a>, a language for web service integration with syntax similar to SQL. It takes care of the mundane details and allows developer to treat RESTful services or even regular HTML websites as database tables that can be joined and queried. For instance, imagine a query that takes Twitter messages in Polish with the keyword “Warszawa” inside and automatically translates them to English using Google Translation API. Sounds like a lot of work, but in fact it can be done with one line of YQL code. I knew that YQL has been around for a while, but the presentation gave me a boost to create something new with that shiny new toy. I mean tool.</p>

<h4>HTML5 and CSS3</h4>

<p>A conference about front-end development cannot happen without addressing web standards. On Front-Trends CSS3 and HTML5 were all the rage. While both buzzwords were repeated like a mantra in most of the talks, three presentations went into details:</p>

<ul>
    <li><a href="http://www.slideshare.net/robnyman/javascript-html5-brave-new-world">“JavaScript &amp; HTML – Brave New World”</a> by Robert Nyman</li>
    <li><a href="http://leaverou.me/2010/10/my-ft2010-slides-and-csss-my-presentation-framework/">“Pragmatic CSS”</a> by Lea Verou</li>
    <li>“<a href="http://tantek.com/presentations/2010/10/html5-now/">HTML5: Right Here, Right Now”</a> by Tantek Çelik</li>
</ul>

<div class="figure">
    <a href="http://www.flickr.com/photos/krzysztofdanek/5108037665/" title="Lea Verou - &quot;Pragmatic CSS&quot; (4) by Krzychu Danek, on Flickr" class="page"><img src="http://farm2.static.flickr.com/1327/5108037665_a50d3e438d_m.jpg" width="160" height="240" alt="Lea Verou - &quot;Pragmatic CSS&quot; (4)" /></a>
    <div class="legend">
        Lea Verou; photo credit by <a href="http://www.flickr.com/photos/krzysztofdanek/">Krzysztof Danek</a>
    </div>
</div>

<p>
According to people who have seen it, Lea&#8217;s presentation was one of the best of the conference (unfortunately I missed it). She published her <a href="http://leaverou.me/ft2010/">slides</a> online and they&#8217;re definitely worth checking. The presentation itself is written in HTML5 and styled with CSS3. Lea went through several new CSS3 properties, explained them and showed how they can be used to simplify the code and deliver features that were previously hard or impossible to implement. All this was accompanied with information about browser support, so one can tell immediately how feasible is the cutting edge. Spoiler: a lot from CSS3 can be used right now.
</p>

<p>
The talk by Tantek Çelik was in a similar spirit. Tantek went through most of the new features of HTML5 and grouped them into five buckets:
</p>
<ol>
    <li>dependable now</li>
    <li>roughly usable</li>
    <li>awkward</li>
    <li>interesting but ignorable</li>
    <li>worthy of experimentation</li>
</ol>

<p>I strongly recommend checking his <a href="http://tantek.com/presentations/2010/10/html5-now/">slides</a> as they give a primer of what&#8217;s possible now with HTML5 and what&#8217;s just around the corner.</p>

<p>One of the highlights of his talks was a call to action: send the following tweet to Internet Explorer 9 team:</p>

<blockquote>
    <p>Dear <a href="http://twitter.com/IE">@IE</a>: please implement Geolocation API, it&#8217;s Candidate Recommendation now!</p>
</blockquote>

<div class="figure">
    <a href="http://www.flickr.com/photos/krzysztofdanek/5108040277/" title="Tantek Çelik (2) by Krzychu Danek, on Flickr" class="page"><img src="http://farm2.static.flickr.com/1339/5108040277_dd44186bcf_m.jpg" width="160" height="240" alt="Tantek Çelik (2)" /></a>
    <div class="legend">
        Tantek Çelik; photo credit by <a href="http://www.flickr.com/photos/krzysztofdanek/">Krzysztof Danek</a>
    </div>
</div>

<p>Tantek is a former Microsoft employee and a person behind IE5 for Mac, known at the time for its excellent CSS support. Microsoft is usually implementing W3C specs that reached certain level of maturity, so there&#8217;s a hope that <a href="http://www.w3.org/TR/geolocation-API/">Geolocation API</a> will make its way into IE9. I have sent a <a href="http://twitter.com/#!/szafranek/status/28447174247">tweet</a>, have you?</p>

<h4>Truthy value</h4>

<p>
The conference was not without some flaws. In accordance with long tradition of tech gatherings, the wifi didn&#8217;t survive the rush of 300 bandwidth-hungry nerds. Nevertheless, the whole event was fantastic.</p>

<p>I&#8217;ve already heard about most of the new developments shown during the conference. Yet after leaving the venue I felt inclined to give some of them a try NOW, instead of waiting for IE8&#8242;s death in 2050. If the conference inspires you to try something new, could you wish for something more?
</p>]]></content:encoded>
			<wfw:commentRss>http://www.szafranek.net/blog/2010/11/03/front-trends-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Estimating front-end development</title>
		<link>http://www.szafranek.net/blog/2009/03/26/estimating-front-end-development/</link>
		<comments>http://www.szafranek.net/blog/2009/03/26/estimating-front-end-development/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 00:49:26 +0000</pubDate>
		<dc:creator>Szafranek</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://szafranek.net/?p=1510</guid>
		<description><![CDATA[Fortune-telling or essential part of project work? Here's what I learned the hard way about front-end development estimation.]]></description>
			<content:encoded><![CDATA[<p>Just after I had begun to work as a front-end developer in 2005, my manager started to ask me the question: “How long it will take you to implement this?” It was apparently easy, but I had been always failing to give the correct answer. However, my manager was smart enough to figure out the real numbers from the ones I gave him. He just multiplied them by the factor of 2. Thus the infamous <em>Szafranek&#8217;s constant</em> was born.</p>

<blockquote><p>Szafranek&#8217;s constant equals 2</p></blockquote>

<p>Soon thereafter, I applied this breakthrough discovery in my estimations. And a strange thing has happened: I was now able to provide correct numbers when asked for the time needed for a job. Though I regained some credibility, the damage was done and <em>Szafranek&#8217;s constant</em> is still a running joke among people I work with.</p>

<p>Proper estimation of front-end development tasks is hard and for any but the simplest tasks just applying the constant is not enough. How to estimate correctly? And first of all:</p>

<h4>Why bother?</h4>

<p>Estimation doesn&#8217;t sound too cool for the impassioned and young. Isn&#8217;t it better to start banging out the code right away? Well, surely, but unless you have unlimited amounts of time and money, you&#8217;ll need to face the reality and evaluate how much of the resources you need versus how much do you have. You&#8217;ll need to perform the estimation exercise whenever:</p>

<ul>
  <li>You work alone as a freelancer. Your estimation will determine how much time you&#8217;ll need for the new project and how much you should charge.</li>
  <li>You work in a team. Other people (back-end developers, graphic designers) depend on you. They need the timelines from you to plan their own work. Most likely there&#8217;ll be also a manager over your neck, asking how much time do you need for this new task, so he could prepare a project plan and report the date to his boss or the customer. And if you think your manager is pesky about the dates, be assured that if he won&#8217;t ask you, he&#8217;ll come up with the (wrong) numbers himself. The results will be much more disastrous. For you.</li>
</ul>

<p>Regardless of the context, you need to learn estimation fu to establish credibility. After all, people will like to work with you more if you&#8217;ll keep your own word.</p>

<p>Let me share with you few tips that I learned the hard way during the last few years. Let&#8217;s imagine a scenario: you work in a team of few people, building a simple web application. You have the vague idea what it will do, but the requirements are far from deserving the noble title of “specification”.</p>

<h4>Lesson 1: Estimation takes time</h4>

<p>This is probably the single most important fact about estimation. If you want to get any helpful numbers, you need some time to think about them. So if you are asked a question “How much time do you need to implement the user interface for this simple web application?” and you&#8217;re expected to provide the numbers immediately, they are unlikely to be relevant.</p>

<h4>Lesson 2: Break it down</h4>

<p>What you need the time for? To break the project into managable tasks. Don&#8217;t even think that a 2-week task is a managable one. The following quote from <a href="https://gettingreal.37signals.com/" title="Getting Real: The Book by 37signals">Getting Real</a> nails it down:</p>

<blockquote>
  <p>Estimates that stretch into weeks or months are fantasies. The truth is you just don&#8217;t know what&#8217;s going to happen that far in advance.</p>

  <p>So shrink your time. Keep breaking down timeframes into smaller chunks. Instead of a 12 week project, think of it as 12 weeklong projects. Instead of guesstimating at tasks that take 30+ hours, break them down into more realistic 6-10 hour chunks. Then proceed one step at a time.</p>
<cite><a href="http://gettingreal.37signals.com/ch06_Shrink_Your_Time.php">Getting Real: Shrink Your Time</a></cite>
</blockquote>

<div class="figure">
  <a href="/files/news/20090326/flow.png" title="Enlarge"><img src="/files/news/20090326/tn-flow.png" alt="Page flow" width="175" height="118" /></a>
  <div class="legend">Simple page flow</div>
</div>
<p>I approach this analysis by drawing a user&#8217;s page flow. This a simple diagram showing what screens the application needs to have to satisfy all the tasks the user can perform, from start to finish.</p>
  
<p>This method is very user interface-centric and likely to underestimate graphic design and server-side development. Thus the next lesson is:</p>

<h4>Lesson 3: Don&#8217;t do it alone</h4>

<p>Unless it&#8217;s a one-man project you&#8217;re working on, the work breakdown can hardly be done by one person. I usually do it together with the back-end developer. This second person is able to spot missing elements on the page flow.</p>

<p>The page flow is a good starting point, but it doesn&#8217;t cover every activity in the project. If you&#8217;re a front-end developer, you also need to consider some common but often forgotten site elements:</p>

<ul>
  <li>error pages</li>
  <li>print version</li>
  <li>mobile version</li>
</ul>

<p>The list could go on, depending on the project and split of the roles. For instance, in my team front-end developer is also responsible for prototyping. Together with user testing this activity can take significant part of the project time. If you&#8217;re a project manager who wants to estimate the whole project time, you must also consider graphic design, data model design, server-side development, testing and a whole lot of other activities. It&#8217;s a topic for a book, not a blog entry. In fact, more than one book, as the search for <a href="http://www.amazon.com/s/ref=nb_ss_gw?url=search-alias%3Daps&amp;field-keywords=software+estimation&amp;x=0&amp;y=0" title="Amazon book search results for “software estimation”"><em>software estimation</em></a> on Amazon confirms. For the sake of the exercise, I&#8217;ll focus here on front-end coding only.</p>

<p>Even in this area it&#8217;s easy to fall into:</p>

<h4>Lesson 4: Common pitfalls</h4>

<p>Software developers are widely affected by a disease called <strong>optimism</strong>. Front-end engineers are no exception and I don&#8217;t exclude myself. It&#8217;s hard to find a developer who is not overly optimistic about the timelines and complexity of his tasks. <em>80 percent completion syndrome</em> is very typical for this reality distortion: regardless when do you ask the developer how much work on the task he&#8217;s already done, the answer is usually around 80%. It&#8217;s fine after first day of the development, but too often the same answer is given on the deadline. “Only few fixes here and there and it&#8217;s done.” But it&#8217;s usually these “few fixes” that take most of the development time.</p>

<p>If you play an optimist in order to be nice to the manager or the customer, be asured it will backfire at you when you miss the deadline. I know at least one company where people are <em>expected</em> to give unrealistic estimates and cross the deadlines. But if the project manager respects himself and his people, he will treat underestimation as a mistake, not a rule. In that case developer is obliged to do his best to provide honest estimates. I&#8217;m lucky to know at least one other company that follows the second path.</p>

<p>How to avoid the trap of optimism and provide realistic numbers?</p>

<h5>Development is more than just writing the code</h5>

<p>This simple realization was something that helped me to recover from undue optimism. My own estimates were usually wrong because I didn&#8217;t consider work other than coding. But that work still needs to be done to finish the task. For a front-end developer it includes:</p>

<ul>
  <li><strong>Problem analysis and solution design</strong>. It&#8217;s the essence and the hard part of software development. It&#8217;s, basically, thinking. Because results of thinking are not very tangible, this part tends to be underestimated. However, it still needs to be included into estimates if they are to be correct. A proven way to make this activity more transparent is to create <strong>prototypes</strong>. One of the cool things about prototyping is that it forces you to think about the problem and allows you to experiment faster than you&#8217;d do with the fully-blown code. It&#8217;s also more effective than vague discussions or writing the documentation prose, since usually people think more effectively with visual aid than in pure abstract terms. Of course prototype could be an overkill for small tasks. In that case just make sure you have enough time to think about the problem, not only to code it.</li>
  <li><strong>Communication</strong> with server-side developers and graphic designers. Especially in ajax applications server and client side are deeply intertwined. On the other hand, image files often require explanation or fixes before they can be implemented.</li>
  <li><strong>Interfaces</strong> with other code. The more complex the application is, the more time is required to make sure that newly added piece of code won&#8217;t break some parts of it. It&#8217;s especially true for CSS which is highly reusable and thus can easily break a lot.</li>
  <li><strong>Documentation</strong> is one of these things that everybody praises, but nobody does. If you won&#8217;t plan the time to write it, it won&#8217;t appear magically.</li>
  <li><strong>Novelty</strong>. Unless the application you write is just another version of what you wrote a hundred times, you will need some time to research how to re-use other people&#8217;s code or write it by yourself.</li>
</ul>


<h4>Lesson 5: Try, fail, repeat</h4>

<p>Taking all the above factors into account results in much stronger connection between estimates and the reality. It allows developers to provide project leader and other team members with numbers that can be actually used for planning. Still, developer&#8217;s input alone doesn&#8217;t automatically produce the delivery date for the product. Sicknesses, unpredicted hardware failures, sudden requirement changes and Jupiter phases will probably wreck the initial schedule anyway. In that sense software development is not far from the warfare:</p>

<blockquote><p>In preparing for battle I have always found that plans are useless, but planning is indispensable.</p>
<cite>Dwight D. Eisenhower</cite>  
</blockquote>

<p>The good thing is that with each project you should come up with more sound estimations. Reality will always have the nasty property of surprise. But the experience you get through failures will allow you to reduce your own magic factor to a value smaller than the infamous 2 (or even more). If you repeatedly achieve the factor of 1, you can begin writing your own book on software estimation and future-telling.</p>

<h4>The true value</h4>

<p>Eventually, the value of estimation doesn&#8217;t come from predicting the future. Though vital in this business, it&#8217;s far from reliable predicting. But it forces you to think about the problem, analyze it and, eventually, solve it.</p>]]></content:encoded>
			<wfw:commentRss>http://www.szafranek.net/blog/2009/03/26/estimating-front-end-development/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>RuPy 2008</title>
		<link>http://www.szafranek.net/blog/2008/05/18/rupy_2008/</link>
		<comments>http://www.szafranek.net/blog/2008/05/18/rupy_2008/#comments</comments>
		<pubDate>Sun, 18 May 2008 21:33:29 +0000</pubDate>
		<dc:creator>Szafranek</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://szafranek/blog/2008/05/18/rupy-2008/</guid>
		<description><![CDATA[RuPy is a conference dedicated to two most fashionable web programming languages: Ruby and Python. Fortunately it wasn't a fashion show but a truly enjoyable event.]]></description>
			<content:encoded><![CDATA[<p>The last few weeks have been very busy for me. I attended <a title="RuPy 2008" href="http://rupy.eu">two</a> <a title="Future of Web Design 2008" href="http://futureofwebdesign.com/">conferences</a>, I&#8217;m preparing for a <a title="@media 2008" href="http://www.vivabit.com/atmedia2008/london/">third one</a>, and I&#8217;ve just launched a <a title="natrasie.pl" href="http://natrasie.pl">new web</a> app together with my friends. All of these have been important enough to deserve a place on this weblog. So please turn a blind eye to the delay of my postings and let me start with a one-month-late report from the first of the forementioned events: <a title="RuPy 2008" href="http://rupy.eu">RuPy 2008</a> – Ruby and Python conference in Poznań.</p>
<p>It was the second edition of the conference <a title="RuPy 2007" href="http:///blog/archive/2007/04/23/rupy_2007/">I wrote about last year</a>. This time it was bigger, the list of sponsors was longer, and the <a title="speakers' page" href="http://rupy.eu/speakers">speakers&#8217; page</a> included more famous names. Fortunately, the conference preserved its “geek camp” atmosphere. The organizers, who were the students last year and are now graduates, had much more experience this time. The talks went according to the schedule, which was probably the biggest change from the previous installment ;). The two talks I enjoyed the most were:</p>
<ul>
<li><a title="PDF with the presentation" href="http://www.zedshaw.com/projects/rupy2008/presentation.pdf">Correlations and conclusions</a> by <a title="Zed Shaw" href="http://www.zedshaw.com/">Zed Shaw</a>. Mr Shaw delivered a witty presentation on measuring performance of web apps. He compared <a title="WebPy" href="http://webpy.org/">web.py</a> with <a title="Ruby on Rails" href="http://www.rubyonrails.org/">Ruby on Rails</a> in serving a “Hello world” application. To nobody&#8217;s surprise Python&#8217;s library won by an order of magnitude, confirming Zed&#8217;s proposition that “Rails sucks”. While one could argue whether it makes sense to compare the efficiency of a fork and knife in a spaghetti eating contest, the show was entertaining.</li>
<li><a title="TDD in Rails" href="http://andrzejonsoftware.blogspot.com/2008/04/tdd-with-rails-slides-from-my-talk-at.html">TDD in Rails</a> by <a title="Andrzej's blog" href="http://andrzejonsoftware.blogspot.com/">Andrzej Krzywda</a>. Andrzej is a Rails developer with a Java background. He shared his practical experience with a test driven development in different languages. While he advertised TDD as almost the only sane way to develop a software, I&#8217;m still a bit skeptical. I work mostly on the UI part of Ajax-heavy applications, and it&#8217;s hard for me to imagine even partial test coverage of complicated interactions. And what about automated testing of CSS layouts? I&#8217;m currently playing with <a title="Testing tool for web apps" href="http://selenium.openqa.org/">Selenium</a>, but my first impression is that it won&#8217;t be a silver bullet for front-end testing.</li>
</ul>
<p>I also had my own talk. I covered a few of the <a title="Amazon Web Services" href="http://aws.amazon.com">Amazon Web Services</a>: S3, EC2, SQS, SimpleDB and Mechanical Turk. I demonstrated their possible use cases and pitfalls, plus Ruby API&#8217;s. As I expected, people were mostly interested in <a title="Mechanical Turk" href="http://www.mturk.com" id="gu-d">Mechanical Turk</a>, but unfortunately this service is available only for US developers.</p>
<p>As a side note, I had the worst possible time slot: Sunday morning, after the conference party. The party was good enough to stop most people from getting up in the morning.</p><p>My slides are shown below. RuPy folks have promised to put videos from the talks online on YouTube.</p>
<div class="figure"><object width="442" height="368"><param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=rupy2008aws-1231025298455465-1&amp;stripped_title=ruby-amazon-web-services-and-you-presentation" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=rupy2008aws-1231025298455465-1&amp;stripped_title=ruby-amazon-web-services-and-you-presentation" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="442" height="368"></embed></object><div class="legend"></div></div>

<p>What&#8217;s coolest about the conference is the people. My personal highlight was <a title="Netguru" href="http://netguru.pl">Netguru</a>, a small code house in Poznań. I met three nice guys from the company: Adam, Wiktor and Kuba. It turned out they have developed the main <a title="kolumber.pl" href="http://kolumber.pl">competitor</a> for the <a title="natrasie.pl" href="http://natrasie.pl">web app</a> I&#8217;ve been working on recently. It didn&#8217;t stop us, however, from sharing a beer at Saturday&#8217;s party :).</p>
<p>Now I&#8217;m looking forward for RuPy 2009!</p>]]></content:encoded>
			<wfw:commentRss>http://www.szafranek.net/blog/2008/05/18/rupy_2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

