<?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"
	>

<channel>
	<title>Christoph's Blog &#187; Pylons</title>
	<atom:link href="http://blog.workaround.org/category/pylons/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.workaround.org</link>
	<description>Rants, discoveries and my tireless search for perfect Linux tools</description>
	<pubDate>Fri, 21 Nov 2008 23:29:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>screenshots.debian.net gets slashdotted</title>
		<link>http://blog.workaround.org/2008/11/19/screenshotsdebiannet-gets-slashdotted/</link>
		<comments>http://blog.workaround.org/2008/11/19/screenshotsdebiannet-gets-slashdotted/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 20:25:34 +0000</pubDate>
		<dc:creator>Christoph Haas</dc:creator>
		
		<category><![CDATA[Debian]]></category>

		<category><![CDATA[Open-Source]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Pylons]]></category>

		<guid isPermaLink="false">http://blog.workaround.org/?p=39</guid>
		<description><![CDATA[Bear with me that I keep you posted with boring news of screenshots.debian.net. But after further optimisation (caching the start page, serving screenshots directly from nginx instead of via Pylons) we decided that it&#8217;s time to get us on Slashdot. Thanks a lot to zepolen for teaching me about memcached and threading! The slashdot people [...]]]></description>
			<content:encoded><![CDATA[<p>Bear with me that I keep you posted with boring news of <a href="http://screenshots.debian.net" onclick="javascript:pageTracker._trackPageview('/outbound/article/screenshots.debian.net');">screenshots.debian.net</a>. But after further optimisation (caching the start page, serving screenshots directly from <a href="http://nginx.net/" onclick="javascript:pageTracker._trackPageview('/outbound/article/nginx.net');">nginx</a> instead of via Pylons) we decided that it&#8217;s time to get us on <a href="http://slashdot.org" onclick="javascript:pageTracker._trackPageview('/outbound/article/slashdot.org');">Slashdot</a>. Thanks a lot to zepolen for teaching me about <a href="http://www.danga.com/memcached/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.danga.com');">memcached</a> and threading! The slashdot people have approved my <a href="http://linux.slashdot.org/linux/08/11/19/1828220.shtml" onclick="javascript:pageTracker._trackPageview('/outbound/article/linux.slashdot.org');">announcement</a> and we are already getting hammered by people following the link to <a href="http://screenshots.debian.net" onclick="javascript:pageTracker._trackPageview('/outbound/article/screenshots.debian.net');">screenshots.debian.net</a>. Currently the server load is still near 100%, we have 10 Mbps network traffic and 60 request/second. Watching the web server logs is currently pretty cool. <img src='http://blog.workaround.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>21:08:30 up 455 days, 15:08,  2 users,  load average: 1.27, 0.94, 0.69</p>
<p><a href='http://blog.workaround.org/uploads/2008/11/network0135daydv3.png'><img src="http://blog.workaround.org/uploads/2008/11/network0135daydv3-300x191.png" alt="Network traffic when slashdotting began" title="Network traffic when slashdotting began" width="300" height="191" class="alignnone size-medium wp-image-40" /></a></p>
<p><a href='http://blog.workaround.org/uploads/2008/11/sdn-on-slashdot.png'><img src="http://blog.workaround.org/uploads/2008/11/sdn-on-slashdot-300x133.png" alt="Yes, I\&#039;m on slashdot! :)" title="Yes, I\&#039;m on slashdot! :)" width="300" height="133" class="alignnone size-medium wp-image-41" /></a></p>
<p>Honestly I hardly ever read Slashdot. But apparently many others do. And if you are especially bored you can read the comments on the posting there. So much childishness. &#8220;You should have made it a distribution-independent site.&#8221; &#8220;How should I make a screenshot of libfoo-bar?&#8221; Why can&#8217;t people just be happy with what they get for free and make proper suggestions? Well, go create something yourself. Expecting something perfect from the start is pretty naive. But not unexpected. <img src='http://blog.workaround.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.workaround.org/2008/11/19/screenshotsdebiannet-gets-slashdotted/feed/</wfw:commentRss>
		</item>
		<item>
		<title>screenshots.debian.net goes live</title>
		<link>http://blog.workaround.org/2008/11/14/screenshotsdebiannet-goes-live/</link>
		<comments>http://blog.workaround.org/2008/11/14/screenshotsdebiannet-goes-live/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 14:00:50 +0000</pubDate>
		<dc:creator>Christoph Haas</dc:creator>
		
		<category><![CDATA[Debian]]></category>

		<category><![CDATA[Open-Source]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Pylons]]></category>

		<guid isPermaLink="false">http://blog.workaround.org/?p=37</guid>
		<description><![CDATA[After just three days of beta operation I could already make screenshots.debian.net go live. Within the first day I fixed a few typos, optimized database queries and added proper HTTP headers for caching. We got a huge load spike after my announcement on debian-devel-announce. I&#8217;m very happy and proud to have this service running and [...]]]></description>
			<content:encoded><![CDATA[<p>After just three days of beta operation I could already make <a href="http://screenshots.debian.net" onclick="javascript:pageTracker._trackPageview('/outbound/article/screenshots.debian.net');">screenshots.debian.net</a> go live. Within the first day I fixed a few typos, optimized database queries and added proper HTTP headers for caching. We got a huge load spike after my <a href="http://lists.debian.org/debian-devel-announce/2008/11/msg00003.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/lists.debian.org');">announcement on debian-devel-announce</a>. I&#8217;m very happy and proud to have this service running and appreciate the help from the <a href="http://www.sqlalchemy.org" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.sqlalchemy.org');">SQLAlchemy</a>, <a href="http://pylonshq.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/pylonshq.com');">Pylons</a> and <a href="http://debian.org" onclick="javascript:pageTracker._trackPageview('/outbound/article/debian.org');">Debian</a> community. Michael Vogt has already added screenshots support to the Synaptic package manager. Martin Stigge has joined the admin team to speed up approving screenshots in the moderation queue. (It would nice if someone else volunteered who is from .us or .au to deal with uploads while we sleep.) And above all I&#8217;d like to thank &#8216;zepolen&#8217; from <a href="http://www.car.gr" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.car.gr');">car.gr</a> for allowing me to host the web application on his server. I think neither of us estimated so much interest in the service. May his server not melt under the load. <img src='http://blog.workaround.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Honestly the first feedback wasn&#8217;t very motivating (developers tend to point out errors first) but I enjoy seeing how quickly the news is spreading. And thanks to everybody for uploading further screenshots. I&#8217;ll keep on watching the moderation queue and enjoy how others blog about it. <img src='http://blog.workaround.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.workaround.org/2008/11/14/screenshotsdebiannet-goes-live/feed/</wfw:commentRss>
		</item>
		<item>
		<title>screenshots.debian.net goes beta</title>
		<link>http://blog.workaround.org/2008/11/10/screenshotsdebiannet-goes-beta/</link>
		<comments>http://blog.workaround.org/2008/11/10/screenshotsdebiannet-goes-beta/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 16:31:46 +0000</pubDate>
		<dc:creator>Christoph Haas</dc:creator>
		
		<category><![CDATA[Debian]]></category>

		<category><![CDATA[Open-Source]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Pylons]]></category>

		<guid isPermaLink="false">http://blog.workaround.org/?p=36</guid>
		<description><![CDATA[Roberto Sanchez and I proposed to create a service to provide screenshots for Debian packages. And with a little work, a lot of Pylons frameworking power and a tad of jQuery spice I created the &#8216;debexpo&#8217; software that provides a nice-looking web site doing exactly that. The service is already up and running at screenshots.debian.net. [...]]]></description>
			<content:encoded><![CDATA[<p>Roberto Sanchez and I proposed to create a service to provide screenshots for Debian packages. And with a little work, a lot of <a href="http://pylonshq.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/pylonshq.com');">Pylons</a> frameworking power and a tad of <a href="http://jquery.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/jquery.com');">jQuery</a> spice I created the &#8216;debexpo&#8217; software that provides a nice-looking web site doing exactly that. The service is already up and running at <a href="http://screenshots.debian.net" onclick="javascript:pageTracker._trackPageview('/outbound/article/screenshots.debian.net');">screenshots.debian.net</a>. This is still the phase where I have to sort out a few minor technical, legal and organisational issues. And thanks to a friendly fellow Pylons&#8217; user I have now a place to host the service (my vpslink-sponsored server is already overloaded). Once all the subleties are sorted out I will announce the service to debian-devel-announce and hope to get mentioned in the weekly news.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.workaround.org/2008/11/10/screenshotsdebiannet-goes-beta/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ExtJS - impressive for the user - painful for the programmer</title>
		<link>http://blog.workaround.org/2008/10/22/extjs-impressive-for-the-user-painful-for-the-programmer/</link>
		<comments>http://blog.workaround.org/2008/10/22/extjs-impressive-for-the-user-painful-for-the-programmer/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 20:04:27 +0000</pubDate>
		<dc:creator>Christoph Haas</dc:creator>
		
		<category><![CDATA[Open-Source]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Pylons]]></category>

		<category><![CDATA[Rants]]></category>

		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://blog.workaround.org/?p=34</guid>
		<description><![CDATA[When following my blog you may have learned one thing about me: I spend half of my spare time trying out every single piece of software because I fear I could miss a tool that would make my life a tad easier. It&#8217;s not really surprising that this way I wasted more time in my [...]]]></description>
			<content:encoded><![CDATA[<p>When following my blog you may have learned one thing about me: I spend half of my spare time trying out every single piece of software because I fear I could miss a tool that would make my life a tad easier. It&#8217;s not really surprising that this way I wasted more time in my life than any tool could help me save. On the other hand I know a whole lot of tools and can usually instantly recommend something thus making me appear like a professional liar to many people. <img src='http://blog.workaround.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> A helpful side-effect is that I can critisize tools and pieces of software more thorougly if knowing them better. And you may make fun of me for trying my current (workflow web-site) application with three different Javascript frameworks. Most of the time I spent fighting against <a href="http://extjs.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/extjs.com');">ExtJS</a>. No, seriously, I tried to work with it. I try not to deny working with new tools just because I&#8217;m not used to them. And ExtJS is seriously different from most other Javascript frameworks (with <a href="http://developer.yahoo.com/yui/" onclick="javascript:pageTracker._trackPageview('/outbound/article/developer.yahoo.com');">YUI</a> apparently being the closest). I don&#8217;t want to bore you too much but these are the pros and cons that finally made me go back to <a href="http://jquery.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/jquery.com');">jQuery</a> and rather create a new plugin instead of relying on ExtJS. These arguments are very subjective of course.</p>
<p>Pro ExtJS:</p>
<ul>
<li>Nice <a href="http://extjs.com/deploy/dev/examples/samples.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/extjs.com');">widgets</a>. They have just everything. ExtJS is like a superset of the widgets of all available Javascript frameworks. And so far I couldn&#8217;t find any obvious bugs. Be it <a href="http://extjs.com/deploy/dev/examples/menu/menus.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/extjs.com');">menus</a>, status bars or <a href="http://http://extjs.com/deploy/dev/examples/grid/array-grid.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/extjs.com');">grids</a>. It&#8217;s just impressive. Take a look at the <a href="http://extpaste.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/extpaste.com');">ExtJS-based pastebin</a> and you&#8217;ll likely say &#8220;Wow&#8221;. It&#8217;s great from a user&#8217;s perspective. When I saw it the first time I had to show it to everybody who couldn&#8217;t get away fast enough. It&#8217;s like a proof-of-concept of what&#8217;s possible in the web browser.</li>
<li>Good <a href="http://extjs.com/deploy/dev/docs/" onclick="javascript:pageTracker._trackPageview('/outbound/article/extjs.com');"><em>API</em> documentation</a>. If you need to look up something you&#8217;ll probably find it.</li>
</ul>
<p>Con ExtJS:</p>
<ul>
<li>Applications do not degrade gracefully. Turn off Javascript and you are left with a few naked lines on your screen screaming &#8220;eeeeek&#8221; and disappearing in shame. I try to make my applications work without Javascript (web 1.0 style) and just spice it up with Javascript to support the users and save them time.</li>
<li>The <a href="http://http://extjs.com/deploy/dev/resources/css/ext-all.css" onclick="javascript:pageTracker._trackPageview('/outbound/article/extjs.com');">CSS</a>. It&#8217;s nearly thousand definitions which are giving you no idea which is used for what purpose. You just can&#8217;t seriously customize it. No theming. Their style is &#8220;eat or die&#8221;.</li>
<li>The HTML. Okay, the generated HTML works. But it&#8217;s huge. Many tags get so many CSS styles assigned that you don&#8217;t understand what&#8217;s going on. DIVs are nested so deeply that you&#8217;ll need a minute at least to find a certain widget in Firebug. If you are fast.</li>
<li>ExtJS works in pixels. You don&#8217;t say &#8220;give me a textarea with 60&#215;5 chars to enter&#8221; but &#8220;give me a textarea that is 300 pixels wide and 80 pixels high&#8221;. I rather try to avoid working with pixels. Isn&#8217;t the point of HTML to render properly on every screen? Try a Layout in a Panel (rendered in a DIV). You&#8217;ll have to specify the height which is either too high or too low. Try a Layout in a Viewport and you are all set - it&#8217;s exactly filling the browser window. But you won&#8217;t be able to change anything in it or use it in the context or your existing application. If you want ExtJS you&#8217;ll have to virtually surrender to its way to render things.</li>
<li>The <a href="http://http://extjs.com/company/dual.php" onclick="javascript:pageTracker._trackPageview('/outbound/article/extjs.com');">license</a>. When ExtJS started to use the GPL3 everybody complained. At first I wondered why. After all 50% of what I do is open-source anyway. I just forgot about the other 50% where I either create web applications for my employer or for my own customers. I obviously don&#8217;t want to publish my own source code - especially not under the GPL. (At first I wondered why all the trolls were so upset about the viral nature of the GPL. But with the time I understood that&#8217;s really viral and often a problem. The GPL may be okay for applications. But it&#8217;s definitely the wrong choice for libraries - like ExtJS.) In the context of applications for my employer it&#8217;s all internal/intranet applications. So I&#8217;m not distributing the application and don&#8217;t need to pay for a license or publish the code. (Even though the ExtJS web site tries to confuse their readers regarding the &#8220;internal usage&#8221; and claims you need a license to do so.) Of course the makers of ExtJS can publish the library under whatever license they want. And it&#8217;s definitely high quality so they deserve to get paid for it. But their GPL restriction may really be a no-go for many projects that are evaluating different Javascript applications. If you like to hear my proposal: publish ExtJS under a permissive license (MIT or BSD) and just sell support. Many companies earn money that way. And it would make people worry less about using it and rather have them using it.</li>
<li>The web-based support <a href="http://extjs.com/forum/" onclick="javascript:pageTracker._trackPageview('/outbound/article/extjs.com');">forum</a>. Now that I went back to jQuery I value their <a href="http://docs.jquery.com/Discussion" onclick="javascript:pageTracker._trackPageview('/outbound/article/docs.jquery.com');">simple mailing list</a> so much. Web forums (although pretty widespread) are a PITA. Their advantage is that you can easily seperate different topics on a single site. If you tried the same with mailing lists you&#8217;d have to offer a dozen mailing lists. But on the downside you have just 20% value (with 80% being HTML, rankings, polls, blinking signatures and &#8220;me too&#8221; postings). I really wish we would all go back to using the usenet in a proper way - subscribe to a group and participate without subscribing or clicking your way through a web forum like a crazed monkey. And I believe that the friendliness in the jQuery community is much better than the arrogance of ExtJS users.</li>
<li>Lack of proper examples. The API documentation is pretty complete (I rarely found something in an example that wasn&#8217;t found in the official docs). But often the classes and objects are derived from other objects. So you have to click your way through hoping to find where something is documented. In addition the documentation hardly has any examples. You can&#8217;t learn from the docs. You&#8217;ll have to understand most of it already and just it to look something up. It doesn&#8217;t give you an idea of the concepts behind a certain class or object. You&#8217;ll have to look at the example applications (which are documented pretty well) to learn from it. And even then it&#8217;s a lot of guesswork.</li>
<li>No customization. I can hardly imagine how I should use ExtJS on a customer web site. Show me a web site and I&#8217;ll tell you if it&#8217;s done with ExtJS or not. ExtJS is probably good for applications where you really need all the widgets - like a internal management or workflow application. But you will hardly find a good way to make the widgets look any different than in the examples. It&#8217;s sink or swim. If you have to follow a corporate identity then you are pretty much screwed.</li>
<li>90% client-side coding. I still love <a href="http://pylonshq.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/pylonshq.com');">Pylons</a> (the Python WSGI MVC web framework). I have a <a href="http://python.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/python.org');">good programming language</a>. A good <a href="http://www.makotemplates.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.makotemplates.org');">templating language</a>. A nice online debugger. But with ExtJS I initialise the application in the browser and just interact with my backend using JSON. Which means that most of the complex logic that I use to display things on the web must be done in Javascript. This is error-prone and the user can see exactly what I&#8217;m doing. I overheard developers worrying on how to load Javascript code on-the-fly so that every user just sees the widgets that are necessary. Seriously - such code belongs in the backend. You&#8217;ll have to do the data validation in the backend anyway. (Although I saw some example of ExtJS applications where all the security validation was done in - easily tampered - Javascript.) Try the <a href="http://extjs.com/learn/Tutorial:Basic_Login" onclick="javascript:pageTracker._trackPageview('/outbound/article/extjs.com');">login tutorial</a>. You&#8217;ll see that logging you in means forwarding you to another page. No session cookies. No making sure that AJAX/XHR requests don&#8217;t come back with a 401 (Authentication needed) error. Just the kind of security you&#8217;ll expect from an average PHP application. AJAX is a security risk anyway and you should use it carefully to avoid <a href="http://docs.pythonweb.org/display/pylonsfaq/Warnings" onclick="javascript:pageTracker._trackPageview('/outbound/article/docs.pythonweb.org');">cross</a>-<a href="http://bob.pythonmac.org/archives/2007/04/05/fortify-javascript-hijacking-fud/" onclick="javascript:pageTracker._trackPageview('/outbound/article/bob.pythonmac.org');">site</a> <a href="http://en.wikipedia.org/wiki/JavaScript_Object_Notation#Cross-site_request_forgery" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');">scripting</a> problems. Did you know that passing JSON arrays is potentially insecure? ExtJS often expects JSON data as arrays (or in XML). ExtJS is virtually in invitation for hackers.</li>
<li>Verbosity. To do simple things you&#8217;ll find yourself writing large amounts of Javascript. Of course a grid or layout has a lot of possible options that you can pass. But nothing beats jQuery&#8217;s simplicity of <code>$('#div1').load('/something')</code>.
<li>Debugging. Although there is a debug version of the library I could hardly ever figure out what went wrong. My main debugging tool wasn&#8217;t Firebug. It was Mercurial. Because I checked in every single working change I had and diff&#8217;ed my changes in case anything didn&#8217;t work any more. Programming on trial and error isn&#8217;t really my favorite style.</li>
<li>Size. The library is 500 KB in size. While people may argue that you load that once and then keep it cached it&#8217;s still 500 KB. Imagine you have that on your start page. I wouldn&#8217;t worry about that size on an intranet application where everybody is on 100 or 1000 Mbps. But on the web?</li>
</ul>
<p>You probably won&#8217;t need long to count my pros and cons. Please don&#8217;t let me make your decision on whether to use ExtJS or not. Just consider the above criticism if you consider using ExtJS. Bah, enough with the politically correct talking. See you on #jquery. <img src='http://blog.workaround.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>P.S.: Yahoo&#8217;s <a href="http://developer.yahoo.com/yui/" onclick="javascript:pageTracker._trackPageview('/outbound/article/developer.yahoo.com');">YUI</a> has similar widgets like ExtJS. It&#8217;s just also very verbose. But at least they are flexible enough to be used easier and you can skin them.<br />
P.P.S.: I have to admit that the <a href="http://ui.jquery.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/ui.jquery.com');">jQuery UI</a> widgets are still a tad buggy. If you seriously need widgets then consider the YUI.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.workaround.org/2008/10/22/extjs-impressive-for-the-user-painful-for-the-programmer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ExtJS - better luck this time</title>
		<link>http://blog.workaround.org/2008/10/16/extjs-better-luck-this-time/</link>
		<comments>http://blog.workaround.org/2008/10/16/extjs-better-luck-this-time/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 19:59:34 +0000</pubDate>
		<dc:creator>Christoph Haas</dc:creator>
		
		<category><![CDATA[Open-Source]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Pylons]]></category>

		<guid isPermaLink="false">http://blog.workaround.org/?p=32</guid>
		<description><![CDATA[You may remember that I blogged about ExtJS before. I was impressed by ExtJS but somehow didn&#8217;t consider it for my owngoing projects.
This time I&#8217;m working on a project that would normally become a GUI application. Fat client-style. But I&#8217;m still wanting to make it a web application because I wouldn&#8217;t like to force the [...]]]></description>
			<content:encoded><![CDATA[<p>You may remember that I <a href="/2008/01/15/fun-and-despair-with-extjs/">blogged about <a href="http://extjs.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/extjs.com');">ExtJS</a> before</a>. I was impressed by ExtJS but somehow didn&#8217;t consider it for my owngoing projects.</p>
<p>This time I&#8217;m working on a project that would normally become a GUI application. Fat client-style. But I&#8217;m still wanting to make it a web application because I wouldn&#8217;t like to force the dozens of users to install updates frequently. And I&#8217;m also a newbie regarding UI toolkits like Qt or Gtk. So I thought I give ExtJS another try.</p>
<p>You can&#8217;t hurry love</p>
<p>ExtJS takes some learning. And with the limited literature on the web dealing with programming applications in ExtJS I felt pretty alone. Many tutorials that I found on the web that deal with what I wanted to know only used version 1.x. And 2.x works differently. So I needed support from #extjs (IRC channel on freenode), read parts of the API documentation and the ExtJS forums (why oh why can&#8217;t it just have a simple mailing list - web forums stink). With jQuery you will get results quickly. But ExtJS isn&#8217;t just giving you a few JS commands and classes to simplify your life. It&#8217;s a whole new paradigm really. It&#8217;s like you code a GUI application that works on the web. If you use layouts and panels and not just simple DOM-manipulating operations then you may need to take your time before you get something done that actually works. The API documentation is very complete. But the classes are wired together and subclassed in a way that you sometimes have to guess which documentation page describes certain attributes. (Where the heck are the items documented in tree panels again?)</p>
<p>I&#8217;m using <a href="http://pylonshq.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/pylonshq.com');">Pylons</a> as a backend and usually I have 70% Python code and 30% in static Javascript and HTML templates. But with ExtJS the equation is more like 30% Python code (for dealing with backend calls and JSON) and 70% Javascript with virtually no templates. Javascript is by far not as comfortable as Python so it&#8217;s a little drawback. But it&#8217;s roughly (very roughly) similar to Python so it should feel familiar.</p>
<p>Licensing chaos</p>
<p>Recently ExtJS turned around the licensing terms a little thus annoying many developers in the community. And I must say that I was close to not even considering ExtJS again because they frightened me with their &#8220;commercial license&#8221;. I&#8217;m (fortunately) not a lawyer but I&#8217;m pretty sure that the only case where you would need to pay for ExtJS is when you write applications using ExtJS that you use publicly and do NOT want to put your application/web site under the GPL. The important result for me was: as it&#8217;s an intranet application within our organisation we do not need to share the source or put the application under GPL. And for any other cases I usually put my projects under an open-source license anyway. Of course life would be easier for everyone if ExtJS just used the MIT license. But the library is of very high quality and very capable. From what I have seen so far I would happily write commercial applications that depended on ExtJS (then paying for the license and support of course). My point is: if you like ExtJS (perhaps even from just enjoying their programming samples) then see if you really need the commercial license.</p>
<p>What ExtJS isn&#8217;t useful for</p>
<p>The spectrum of applications where ExtJS is a good catch is a little limited. For example I wouldn&#8217;t make a customer web site using Ext unless they need a kind of GUI-style application. For effects and a little AJAX jQuery is much easier to understand and use and it&#8217;s MIT-licensed so I wouldn&#8217;t really have to worry about legal stuff. And the design is fixed. You would easily spot an ExtJS-based web site because you usually don&#8217;t style the widgets. The icons and widgets come in three different colors but that&#8217;s it. I wouldn&#8217;t want to start playing with a few hundred lines of CSS that ExtJS comes with unless I really have to. It doesn&#8217;t even play nicely with my existing style sheets because there&#8217;s little they don&#8217;t redefine for their own purposes. For example don&#8217;t expect LI tags to produce list items with dots in front any more.</p>
<p>Debug hell</p>
<p>Pylons has a nice online debugger. So if anything fails in your Python code then you can comfortably analyse the situation and quickly fix the problem But if most of your work is done in Javascript then you have to debug Javascript instead. Unfortunately most programming errors that I encountered lead to very strange error messages pointing to lines in ExtJS&#8217; main file ext-all.js. Other developers in #extjs recommended that I use the (1 MB large) extjs-all-debug.js file to help me nail down the origin of the error message. But I hardly ever got more useful messages. Clicking on the error messages in <a href="http://http://getfirebug.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/getfirebug.com');">Firebug</a> made my PC slow down like an ant in a mud puddle and after half a minute showed me a line of ExtJS internal code that didn&#8217;t help me either. So my current strategy is trying out things slowly. And whenever something works I check in my changes into the <a href="http://www.selenic.com/mercurial/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.selenic.com');">Mercurial</a> repository I use for the project. Thus I can exactly see what I changed and what might cause the problem. But this is surely not a very modern way to debug applications. Mercurial and Firebug are the only tools to save my life. By the way many of my problems are giving components the same DOM ID as an existing DIV on the web page. <img src='http://blog.workaround.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Validation done twice</p>
<p>I have seen other developers&#8217; web applications already where they fully trust the Javascript to do the right thing. They happily send everything that was deemed good by the Javascript code to the backend. Even SQL injections. That&#8217;s obviously a bad thing. So you&#8217;ll have to validate the data your backend gets. Just be aware that you will need to do the validation twice - in your JS frontend and then again in the backend. Just don&#8217;t trust anything that JS does. Whatever you do: validate what ExtJS sends to the backend! Everything else is optional.</p>
<p>Definition versus instantiation</p>
<p>A central thing I had to learn was the difference of defining some &#8220;component&#8221; to actually instantiating it. It&#8217;s not very complicated from an object-oriented point of view. But my first attempt to get a layout and a couple of panels working made me do everything in the doReady() call that is triggered when all referenced elements of the web page are loaded. I hesitate to use derived/subclassed components because it seems too complicated - although other developers recommended to do that. So to save memory and CPU cycles you rather define Javascript arrays containing the attributes that you would later use to instantiate a certain component. Think of it as &#8216;just in time instantiation&#8217;. Creating instances of everything right from the start is a waste of resources and will probably slow down the application.</p>
<p>Does half a megabyte of JS make things fast?</p>
<p>Yes, surprisingly it does. Half a megabyte is the largest amount of Javascript I had ever dealt with. But it&#8217;s loaded once and then usually kept in the browser cache. And looking at the start page of my employer&#8217;s web site they also use that much Javascript but accomplish much less than ExtJS. <img src='http://blog.workaround.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> The advantage of ExtJS&#8217; approach is that the application runs on the client/browser and not on the server. So everything is ready to use in the browser and the server just needs to send and receive data in the background. No loading times when you switch from one web to another. It becomes indistinguishable from a fat client application.</p>
<p>May the source be with you</p>
<p>Stay tuned for maybe more experiences once I finish my appliation. I hope I keep the patience because it took me three days of readig, trying, understanding, err&#8217;ing and programming to finally have a border layout with a tree view, a panel view and a click handler. What helped me a lot was reading the well-documented source from ExtJS&#8217; <a href="http://extjs.com/deploy/dev/examples/layout-browser/layout-browser.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/extjs.com');">layout browser</a> and <a href="http://examples.extjs.eu/" onclick="javascript:pageTracker._trackPageview('/outbound/article/examples.extjs.eu');">Saki&#8217;s web site</a>. And my personal favorite useless but amazing loading effect can be seen <a href="http://www.vinylfox.com/extjs/window-tab-google-map.php" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.vinylfox.com');">here</a>. <img src='http://blog.workaround.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.workaround.org/2008/10/16/extjs-better-luck-this-time/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
