<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7615243692077612735</id><updated>2012-01-20T20:53:12.282Z</updated><category term='ECMA-262'/><category term='Threading'/><category term='node.js'/><category term='setTimeout'/><category term='listento'/><category term='AJAX'/><category term='Cappucino'/><category term='objective-j'/><category term='Humour'/><category term='Lisp'/><category term='RIA'/><category term='imutable'/><category term='ASP.NET'/><category term='queue'/><category term='treegrid'/><category term='s#arp'/><category term='dojo'/><category term='Functional'/><category term='web 2.0'/><category term='Asynchronous'/><category term='Web Applications'/><category term='ViewState'/><category term='Sproutcore'/><category term='JavaScript'/><category term='spring.net'/><category term='nhibernate'/><category term='svn'/><title type='text'>Over my head</title><subtitle type='html'>Development, Music and stuff.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-3542355574451509355</id><published>2010-03-29T14:47:00.016+01:00</published><updated>2010-03-30T10:53:51.078+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='node.js'/><title type='text'>A guide to running nodejs on Windows (almost)</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;nodejs doesnt work with windows.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So imo the best thing we can do if we want to join the community is run a virtual machine.&lt;br /&gt;&lt;br /&gt;Here's how:&lt;br /&gt;&lt;br /&gt;1) Install virtual box &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.virtualbox.org/wiki/Downloads"&gt;http://www.virtualbox.org/wiki/Downloads&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2) Get an unbuntu iso &lt;br /&gt;&lt;a href=" http://www.ubuntu.com/GetUbuntu/download"&gt;&lt;br /&gt;http://www.ubuntu.com/GetUbuntu/download&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3) Install the ubuntu iso. For detailed instructions visit &lt;br /&gt;&lt;a href=" http://psychocats.net/ubuntu/virtualbox"&gt;&lt;br /&gt;http://psychocats.net/ubuntu/virtualbox&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3) Install vbox guest additions. For detailed instructions visit &lt;br /&gt;&lt;br /&gt;&lt;a href="http://helpdeskgeek.com/linux-tips/install-virtualbox-guest-additions-in-ubuntu/"&gt;http://helpdeskgeek.com/linux-tips/install-virtualbox-guest-additions-in-ubuntu/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;4) Open a terminal on your ubuntu virtual machine.&lt;br /&gt;&lt;br /&gt;5) Type in the following into your terminal to grab git and the build-essential packages&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;  sudo apt-get install build-essential git-core&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;6)  Type in the following into your terminal to grab node.js from git&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;git clone git://github.com/ry/node.git&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;7) Configure, make and install... type the following into your terminal:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; ./configure&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; make&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; make install&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;node.js is now installed on your machine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-3542355574451509355?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/3542355574451509355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=3542355574451509355' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/3542355574451509355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/3542355574451509355'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2010/03/nodejs-on-windows.html' title='A guide to running nodejs on Windows (almost)'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-2025825748609990218</id><published>2008-12-11T09:14:00.003Z</published><updated>2008-12-11T09:20:51.939Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='treegrid'/><category scheme='http://www.blogger.com/atom/ns#' term='dojo'/><category scheme='http://www.blogger.com/atom/ns#' term='svn'/><title type='text'>DOJO and the elusive GridTree</title><content type='html'>If you look in the current release of dojo you wont find a GridTree.&lt;br /&gt;&lt;br /&gt;However, if you are willing to pull down the full dojo source code (including dojox and the utils etc)  from the &lt;a href="http://svn.dojotoolkit.org/src"&gt;svn repository &lt;/a&gt; and apply the patch associated with &lt;a href="http://trac.dojotoolkit.org/ticket/7402"&gt;ticket #7402&lt;/a&gt;, when you build the source, you'll find yourself the proud owner of an unsupported  dojox.grid.TreeGrid.&lt;br /&gt;&lt;br /&gt;It works well and if you look in the dojox grid tests directory you'll find the file test_tree_grid.html which is a good example of how to use it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-2025825748609990218?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/2025825748609990218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=2025825748609990218' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/2025825748609990218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/2025825748609990218'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/12/dojo-and-elusive-gridtree.html' title='DOJO and the elusive GridTree'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-5821655073331774930</id><published>2008-11-25T09:04:00.000Z</published><updated>2008-11-25T09:05:26.604Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Humour'/><title type='text'>The Physicist and the dairy farmer</title><content type='html'>A bunch of dairy farmers want to increase milk yield so they hire a physicist (who they are told understands all things and can model anything) who spends a year studying cows, their diet, yields, and slowly understanding everything there is to know about dairy farming.&lt;br /&gt;&lt;br /&gt;After a year he gathers the farmers together to present his findings and starts his lecture by drawing a circle on a blackboard and saying "Imagine a perfectly spherical cow..."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-5821655073331774930?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/5821655073331774930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=5821655073331774930' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/5821655073331774930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/5821655073331774930'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/11/physicist-and-dairy-farmer.html' title='The Physicist and the dairy farmer'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-797993403280666713</id><published>2008-11-24T10:43:00.002Z</published><updated>2008-11-24T10:45:59.285Z</updated><title type='text'>Hands up who..</title><content type='html'>I wonder how many companies are today scrambling to fix hard coded VAT values in their ecommerce apps.&lt;br /&gt;&lt;br /&gt;Hands up.&lt;br /&gt;&lt;br /&gt;Gordon Brown doesnt know what he's done :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-797993403280666713?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/797993403280666713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=797993403280666713' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/797993403280666713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/797993403280666713'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/11/hands-up-who.html' title='Hands up who..'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-8855816236787194627</id><published>2008-11-23T17:42:00.031Z</published><updated>2008-11-23T23:51:24.541Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='web 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='RIA'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Applications'/><category scheme='http://www.blogger.com/atom/ns#' term='Cappucino'/><category scheme='http://www.blogger.com/atom/ns#' term='Sproutcore'/><title type='text'>Building an application to make my brothers life easier</title><content type='html'>&lt;p&gt;I'm looking at building a couple of apps (outside of my day job) that will help my brother with his job. The first application will need a rich desktop like interface and so I'm investigating my options.&lt;p&gt; &lt;p&gt; &lt;ul&gt;&lt;li&gt; Build upon the application framework I've built  - this is MVP based which means its highly testable and has good seperation of concerns. It supports  templatable views, binding, observers, code generation (via ruby) and is based upon dojo so has access to all the lovely widgets that dojo provides.&lt;/li&gt;&lt;li&gt;Use an existing framework. &lt;/li&gt;&lt;/ul&gt;So before I make a decision, I need to research the existing frameworks and define my requirements. &lt;ol&gt;&lt;li&gt;I want an application framework. A framework that lets me build applications rather than add nice effects to my web pages. &lt;/li&gt;&lt;li&gt;The framework should abstract away the concepts of html, css and the browser. &lt;/li&gt;&lt;li&gt;I'm not designing a web page, so for me its perfectly acceptable for my application to look like a windows app or a OS X app. In fact this is desirable since it should mean that my brother will instantly know how to use the application.&lt;/li&gt;&lt;li&gt;The framework should not be closed source or depend on a browser pluggin.&lt;/li&gt;&lt;/ol&gt;So I'm not using: &lt;ul&gt;&lt;li&gt;Flex (4), &lt;/li&gt;&lt;li&gt;sliverlight (4),&lt;/li&gt;&lt;li&gt;extjs (4),&lt;/li&gt;&lt;li&gt;scriptaculous (1), &lt;/li&gt;&lt;li&gt;moo tools (1)&lt;/li&gt;&lt;li&gt;dojo(1)&lt;/li&gt;&lt;/ul&gt;Note that I have marked each technlogy with a number which refers to my requirements defined above. So, this leaves me with: &lt;ul&gt;&lt;li&gt;Sproutcore&lt;/li&gt;&lt;li&gt;Cappucino&lt;/li&gt;&lt;li&gt;Open laszloa&lt;/li&gt;&lt;li&gt;1 million other RIA framworks I'm unaware of.&lt;/li&gt;&lt;/ul&gt; &lt;/p&gt;  &lt;p&gt; So now I've reduced my area of research down to 3 frameworks. This post will become part of a series which I will investigate these 3 frameworks. The series will serve mainly as a scratch pad, but hopefully may help others.&lt;/p&gt;&lt;p&gt; This remainder of this blog post will discuss my initial thoughts on Sproutcore based upon a few hours reading around and mucking around with code. &lt;/p&gt;  &lt;h3&gt;Sproutcore Pros.&lt;/h3&gt; &lt;h4&gt;You write your application prodiminantly in JavaScript.&lt;/h4&gt;  &lt;p&gt;I dont have to learn an new language!&lt;p&gt;  &lt;h4&gt;The framework is based upon MVC.&lt;/h4&gt;  &lt;p&gt;I like this pattern, I've used it a few times and developed frameworks based upon it. Its simple and usually only the views are difficult to test. I'll talk about views, controllers and models in more detail later. For a good definition of MVC, read &lt;a href="http://en.wikipedia.org/wiki/Model-view-controller"&gt;this wikipedia article&lt;/a&gt;&lt;h4&gt;Its backed by a big boy (Apple)&lt;/h4&gt;&lt;p&gt; This means its probably going to be around for a while and should have some money pumped into its development. Apple have in the past branched existing open source projects, invested and changed the licence on the branch. I dont think this will happen here.&lt;p&gt;  &lt;h4&gt;Gem&lt;/h4&gt; &lt;p&gt;Its installed as a gem and I can generate my application stub, controllers etc at the command line.&lt;/p&gt;  &lt;h4&gt;Models - Binding and Observing&lt;/h4&gt; &lt;p&gt;Sproutcore uses a similar approach to binding model properties to controllers, models and UI as Cocoa bindings.&lt;/br&gt; Its easy to "mark" a function as an observer of a property on any given object.&lt;/br&gt; In order to notifiy an observer of a change to any of your models properties, you are required to get and set property values on the model via two inherited methods, &lt;span style="font-weight: bold;"&gt;get &lt;/span&gt;and &lt;span style="font-weight: bold;"&gt;set&lt;/span&gt;.&lt;/br&gt; To &lt;span style="font-weight: bold;"&gt;get &lt;/span&gt;a property "title" on a model called myModel, I code: myModel.get("title").&lt;/br&gt; To &lt;span style="font-weight: bold;"&gt;set &lt;/span&gt;a property value I call myModel.set("title", "new value here").&lt;/br&gt; This may seem annoying at first since, quite rightly, you will realise that you&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;could &lt;/span&gt;just code myModel.title="new  value here".  &lt;/br&gt;However, the set method is not just setting the properties new value, its also informing all observers that the value has changed.&lt;p&gt;  &lt;p&gt;This is incredibly powerful since, for example, views can be kept synchronised with any model they are observing.&lt;/p&gt; &lt;h4&gt;Views&lt;/h4&gt; &lt;p&gt;View templates are written as rhtml files using templating language called Erubis (ROR uses this, so I'm familiar with the syntax).&lt;/p&gt;&lt;h4&gt;Controllers&lt;/h4&gt;&lt;p&gt;These appear to be standard MVC controllers.&lt;/p&gt;  &lt;h3&gt;Sproutcore Cons&lt;/h3&gt; &lt;h4&gt;You write your application prodiminantly in JavaScript.&lt;/h4&gt; &lt;p&gt; While the amount of css and html I've written so far within sproutcore is small, I'm not really abstracted away from the underlying technologies that the browser interprets.&lt;/p&gt;  &lt;h4&gt;Look&lt;/h4&gt; &lt;p&gt;The widgets are UGLY in comparison to those generated by extjs and dojo! I expect this to change!&lt;/p&gt;  &lt;h4&gt;Documentation is scarce.&lt;/h4&gt; &lt;p&gt;This isnt a massive deal, since I can just look at the sproutcore source, although a few more best practice tutorials would be helpful. This may be a problem for developers who are used to the quality of documenation usually associated with commercial frameworks or more establish opensource libraries such as dojo.&lt;/p&gt;&lt;h4&gt;Real World apps&lt;/h4&gt;&lt;p&gt;The only application &lt;strong&gt;I have found&lt;/strong&gt; that it is available to the public thats built with Sproutcore is the &lt;a href="http://www.sproutcore.com/static/photos/"&gt;demo photo viewer&lt;/a&gt;. This is quite slow and clunky and I hope it isnt a good representation of what can be achieved with Sproutcore. Its a poor show in comparison to 280 slides, a world real world application built with 280North's Cappucino&lt;/p&gt;.   &lt;h3&gt;And so..&lt;/h3&gt;&lt;p&gt;Now I'm going to actually start developing a simple application using sproutcore. I'll write a follow up to this post with opinions based upon 12 or more hours development time. Should provide me with a more informed opinion and I expect the cons list to fill up a little&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-8855816236787194627?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/8855816236787194627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=8855816236787194627' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/8855816236787194627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/8855816236787194627'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/11/building-application-to-make-my.html' title='Building an application to make my brothers life easier'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-4885671095983227092</id><published>2008-11-17T19:55:00.007Z</published><updated>2008-11-17T20:08:44.803Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cappucino'/><category scheme='http://www.blogger.com/atom/ns#' term='objective-j'/><title type='text'>nil and objective-j</title><content type='html'>Suppose I have an object instance called person, which has an instance method called yelp.&lt;br /&gt;&lt;br /&gt;To call this method, in  objective-j, I code:&lt;br /&gt;&lt;br /&gt;[person yelp];&lt;br /&gt;&lt;br /&gt;In most languages if person is null (or in this case nil) calling yelp would result in an exception being thrown.&lt;br /&gt;&lt;br /&gt;Not in objective-j. The method* yelp isnt  called.&lt;br /&gt;&lt;br /&gt;Thats just wierd.&lt;br /&gt;&lt;br /&gt;*Note that method calls are referred to as messages in objective-j.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-4885671095983227092?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/4885671095983227092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=4885671095983227092' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/4885671095983227092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/4885671095983227092'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/11/nil-and-objective-j.html' title='nil and objective-j'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-4840437439071799663</id><published>2008-11-16T21:52:00.005Z</published><updated>2008-11-17T10:04:47.836Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='web 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Applications'/><category scheme='http://www.blogger.com/atom/ns#' term='Cappucino'/><title type='text'>The problem is...</title><content type='html'>My client has charged me with the task of building an application which solves a problem.&lt;br /&gt;&lt;br /&gt;A warehouse management application perhaps.&lt;br /&gt;&lt;br /&gt;So, I'm going to deliver the applications interface over the web because my client doesnt want to manage the installation and management of software across their 3,000,0000 warehouses.&lt;br /&gt;&lt;br /&gt;Further they  wont allow me to install 3rd party browser plugins - all I can rely on is HTML, CSS, JavaScript and HTTP.&lt;br /&gt;&lt;br /&gt;So I cant use Flash or Silverlight.&lt;br /&gt;&lt;br /&gt;Also, the .NET framework isnt available on the client machines. Java isnt either.&lt;br /&gt;&lt;br /&gt;There goes ClickOnce and Java Web Start etc etc.&lt;br /&gt;&lt;br /&gt;So what do I do?&lt;br /&gt;&lt;br /&gt;Shit.&lt;br /&gt;&lt;br /&gt;Recently I wrote a little MVP application framework on top of Dojo. It worked well. Nice seperation of concerns, testable etc etc.&lt;br /&gt;&lt;br /&gt;Before that I wrote an MVC framework on top of the clientside Microsoft AJAX framework.&lt;br /&gt;That worked okay too. The codes horrid.&lt;br /&gt;&lt;br /&gt;I worked with extJS, but then they started to play with their licence...&lt;br /&gt;&lt;br /&gt;Before that I wrote a.....&lt;br /&gt;&lt;br /&gt;Infact for almost every major web application I've had to write an application framework on top of some other framework/library.&lt;br /&gt;&lt;br /&gt;The underlying framework provided code that attempted to hide the fact that the different browsers were... different.&lt;br /&gt;&lt;br /&gt;My framework would provide common services to the developer and enforce a development style for the team to work within. Literally an application framework.&lt;br /&gt;&lt;br /&gt;The fact that I felt like I had to write an application framework was annoying in itself.&lt;br /&gt;&lt;br /&gt;Why hasnt someone whose cleverer* than me done it? If they have done it, why dont I know about it?&lt;br /&gt;&lt;br /&gt;Further, the underlying frameworks didnt completely abstract the differences between the browsers and they seemed focused on enabling developers to build small web 2.0 esq additions to their web pages rather than enabling me to build fully formed applications.&lt;br /&gt;&lt;br /&gt;In each case, the project started well, however later down the line, browser related issues ALWAYS cropped up.&lt;br /&gt;&lt;br /&gt;For example, IE6's piss poor JavaScript engine prevented me from building large DOMS.&lt;br /&gt;&lt;br /&gt;The application in question used tabs, probably like the browser you're using. As more tabs were loaded, the app slowed down.&lt;br /&gt;&lt;br /&gt;I solved this problem by disconnecting unfocused tabs from the DOM and re-attaching them when the tab was focussed. At this point my layout manager was told to redraw the layout to ensure that scaling had occured correctly.&lt;br /&gt;&lt;br /&gt;So in each case I had to solve problems that werent in the business domain. In most cases these issues took up the majority of the time.&lt;br /&gt;&lt;br /&gt;Desktop application development isnt generally like this. Sure ,there are still issues, but they often arent as frequent and as complex to solve.&lt;br /&gt;&lt;br /&gt;I should be able to develop a web based application where the biggest problems I have to solve are in the business domain.&lt;br /&gt;&lt;br /&gt;So, it is possible to write a large scale web base application, google and friends have proven this.&lt;br /&gt;&lt;br /&gt;BUT.....  its NOT trivial and the majority of the problems you have to solve are down to the platform (browser).&lt;br /&gt;&lt;br /&gt;Also, if I'm building small web apps such as RSS feed readers, then I can do so quickly and easily. Dojo and ExtJs are all good enough to do this.&lt;br /&gt;&lt;br /&gt;But as soon as you're handed a enterprise scale app your development cycle will probably begin to unravel.&lt;br /&gt;&lt;br /&gt;Of course, you guys may be all geniuses and may solve these problems easily and quickly. If so, I havent met any of you :)&lt;br /&gt;&lt;br /&gt;At the moment I'm investigating technologies in preperation for a technology referesh of a applications user interface.&lt;br /&gt;&lt;br /&gt;Cappucino I'm told, is the solution to my problems.&lt;br /&gt;&lt;br /&gt;* Most people are cleverer than me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-4840437439071799663?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/4840437439071799663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=4840437439071799663' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/4840437439071799663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/4840437439071799663'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/11/problem-is.html' title='The problem is...'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-1615815900841983969</id><published>2008-11-14T10:06:00.009Z</published><updated>2008-11-14T10:30:44.848Z</updated><title type='text'>Re-applying CSS to the DOM with IE6</title><content type='html'>I've been involved in developing a AJAX framework which sits on top of the Microsoft AJAX libraries.&lt;br /&gt;&lt;br /&gt;This contains a layout manager which manages the DOM, so for example if the user re sizes the browser window, the layout manager will manipulate the DOM to ensure the correct layout.&lt;br /&gt;&lt;br /&gt;In most cases it merely sets the height and width styles on DOM elements and applies CSS classes.&lt;br /&gt;&lt;br /&gt;When testing with IE6 my colleague noticed that any images managed by the layout manager (i.e. tab headers) were flickering and that resizing was generally slow.&lt;br /&gt;&lt;br /&gt;I assumed that the layout manger was to blame. It wasn't directly.&lt;br /&gt;&lt;br /&gt;All images associated with the layout manager are referenced in CSS classes to allow for "themes".&lt;br /&gt;&lt;br /&gt;The layout manager will perform the following sequences of actions:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Apply CSS to a DOM element - &lt;span style="font-style: italic;"&gt;if the CSS references an image, your browser will request the file from the server&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Next, remove the CSS class from the DOM element...&lt;/li&gt;&lt;li&gt;Then, if re-apply the same CSS class again to the previously mentioned DOM element -&lt;span style="font-style: italic;"&gt; you would not expect the image to be requested again&lt;/span&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;This is not the case for IE6.&lt;br /&gt;&lt;br /&gt;Every time the layout manager was re-applying the same CSS class to the DOM, the associated resources were being re-requested.&lt;br /&gt;&lt;br /&gt;We used fiddler to confirm this.&lt;br /&gt;&lt;br /&gt;We added a expiry header to all the referenced images (IIS configuration) and now the layout manager runs *almost* as quickly in IE6 as it does in IE7.&lt;br /&gt;&lt;br /&gt;Woot.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-1615815900841983969?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/1615815900841983969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=1615815900841983969' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/1615815900841983969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/1615815900841983969'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/11/re-applying-css-to-dom-with-ie6.html' title='Re-applying CSS to the DOM with IE6'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-4846297530972341607</id><published>2008-11-13T11:23:00.010Z</published><updated>2008-11-14T09:59:25.414Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ViewState'/><title type='text'>ASP.NET ViewState</title><content type='html'>&lt;strong&gt;Background.&lt;/strong&gt;&lt;br /&gt;ViewState is a collection of data which enables a control/page etc to persist properties across postbacks.&lt;br /&gt;&lt;br /&gt;Like a HashTable, the ViewState contains key value pairs. &lt;br /&gt;&lt;br /&gt;The ViewState is represented across posts by a hidden form field. &lt;br /&gt;&lt;br /&gt;The data stored within this hidden field is referred to as a StateBag.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;TrackViewState&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The ViewState object exposes a method called TrackViewState.&lt;br /&gt;&lt;br /&gt;Only after this method is called upon the ViewState, are items stored within the ViewState marked as dirty when a keys value is changed. &lt;br /&gt;&lt;br /&gt;New key value pairs will also be marked as dirty from this point.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;TrackViewState and the page/control life cycle&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;TrackViewState is called during OnInit.&lt;br /&gt;&lt;br /&gt;After this point, data in the StateBag is applied to the ViewState.&lt;br /&gt;&lt;br /&gt;This means that if you modify the ViewState after OnInit, the data will be persisted in the StateBag and will be available after a subsequent postback.&lt;br /&gt;&lt;br /&gt;However if you modify the ViewState before OnInit, or during OnInit your changes will NOT be stored in the StateBag.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-4846297530972341607?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/4846297530972341607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=4846297530972341607' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/4846297530972341607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/4846297530972341607'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/11/aspnet-viewstate.html' title='ASP.NET ViewState'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-8083132093146450393</id><published>2008-07-09T13:40:00.004+01:00</published><updated>2008-07-09T14:06:14.617+01:00</updated><title type='text'>Embracing the new narcissism</title><content type='html'>Now that we've finally decided the technology we're going to use to build the new version of &lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;a style="font-weight: bold;" href="http://www.listentomanchester.co.uk/"&gt;ListenTo&lt;/a&gt;, we're starting to think in terms of new functionality and improving the user experience.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;a style="font-weight: bold;" href="http://www.listentomanchester.co.uk/"&gt;ListenTo&lt;/a&gt; needs bands and needs the bands to interact with the site in order to generate some of our content.&lt;br /&gt;&lt;br /&gt;We've never had problems getting bands to sign up, but have had problems with getting to come back to the site to interact.&lt;br /&gt;&lt;br /&gt;I'm in a band called &lt;a style="font-weight: bold;" href="http://www.myspace.com/weareseizures"&gt;Seizures&lt;/a&gt; and one things I've realised from talking to the guys in the band and other members of the local music community is that people in bands generally have an element of narcissism to their personalities.&lt;br /&gt;&lt;br /&gt;After reading this &lt;a href="http://www.thenewatlantis.com/publications/virtual-friendship-and-the-new-narcissism"&gt;article&lt;/a&gt; we realised that allowing people to add the photos they've taken at gigs  and  tagging the bands  in the photos may draw bands back to the site.&lt;br /&gt;&lt;br /&gt;For example, one of our photographers or users takes a photo of &lt;a style="font-weight: bold;" href="http://www.myspace.com/weareseizures"&gt;Seizures&lt;/a&gt; during a gig, uploads it to &lt;span style="font-weight: bold;"&gt;&lt;a href="http://www.listentomanchester.co.uk/"&gt;ListenTo&lt;/a&gt; &lt;/span&gt;and tags us. The band members get an email telling them they've been tagged, so they visit the site and look at the new photos and perhaps add content themselves.&lt;br /&gt;&lt;br /&gt;This is not a new idea facebook and myspace all do this, but &lt;span style="font-style: italic;"&gt;I think&lt;/span&gt; it is new to our style of website. We arent a social networking site, really we're about promoting the gigs of &lt;span style="font-weight: bold;"&gt;local&lt;/span&gt; bands, but taking some of the ideas that these sites use so successfully may work.&lt;br /&gt;&lt;br /&gt;We'll have a few original ideas in the next release too - I'm not telling though.&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;a style="font-weight: bold;" href="http://www.listentomanchester.co.uk/"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-8083132093146450393?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/8083132093146450393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=8083132093146450393' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/8083132093146450393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/8083132093146450393'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/07/embracing-new-narcissism.html' title='Embracing the new narcissism'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-240673535362565417</id><published>2008-07-07T16:07:00.006+01:00</published><updated>2008-07-08T14:11:42.758+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring.net'/><category scheme='http://www.blogger.com/atom/ns#' term='nhibernate'/><category scheme='http://www.blogger.com/atom/ns#' term='listento'/><category scheme='http://www.blogger.com/atom/ns#' term='s#arp'/><title type='text'>ListenTo and s#arp.</title><content type='html'>I've just started re-developing ListenToManchester.&lt;br /&gt;&lt;br /&gt;I seem to do this every 6 months. It goes something like this...&lt;br /&gt;&lt;br /&gt;A new technology comes along.&lt;br /&gt;&lt;br /&gt;I get excited.&lt;br /&gt;&lt;br /&gt;I begin redeveloping the site with this new technology (ie Ruby on Rails, s#arp).&lt;br /&gt;&lt;br /&gt;I discover that the flavour of the month isnt quite as good as I expected and that my productivity isnt quite what I was promised (I usually want to have it completed in a few days).&lt;br /&gt;&lt;br /&gt;Most recently I looked at S#arp which is a framework based on nHibernate (yay), Spring.NET (yayer) and the new MVC preview from Microsoft.&lt;br /&gt;&lt;br /&gt;I love MVC.&lt;br /&gt;I love nHibernate.&lt;br /&gt;I love Spring.NET.&lt;br /&gt;&lt;br /&gt;I dont like s#arp based upon what I've seen of the "best practice" NorthwindMVC project shipped with the project.&lt;br /&gt;&lt;br /&gt;The NorthwindMVC.Core project contains the business logic of the application.&lt;br /&gt;&lt;br /&gt;It also contains nHibernate mapping files.&lt;br /&gt;&lt;br /&gt;Why would they do this??&lt;br /&gt;&lt;br /&gt;I dont want my business tier to have any dependency upon the implementation of my data access tier!!!&lt;br /&gt;&lt;br /&gt;Ideally I'd have a seperate project that defines interfaces i.e. ISupplierDAO (lets call it NorthwindMVC.Shared).&lt;br /&gt;&lt;br /&gt;Using spring I'd inject an implementation of this interface into my business tier.&lt;br /&gt;&lt;br /&gt;I dont want to care about the details of the DAO implementation in my Business layer!&lt;br /&gt;&lt;br /&gt;This way my business and data tiers only depend upon NorthwindMVC.Shared!!&lt;br /&gt;&lt;br /&gt;Is this really how the devs of this platform want us to use it?&lt;br /&gt;&lt;br /&gt;Of course, I'm probably being a bit whiney. This is probably just an implementation detail.&lt;br /&gt;&lt;br /&gt;Thoughts??&lt;br /&gt;&lt;br /&gt;Having said all this, this framework is leaps and bounds better than what ListenTo is currently running off CSLA.NET (shudders).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-240673535362565417?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/240673535362565417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=240673535362565417' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/240673535362565417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/240673535362565417'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/07/listento-and-sarp.html' title='ListenTo and s#arp.'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-7825886107664890746</id><published>2008-03-11T11:01:00.002Z</published><updated>2008-03-11T11:02:22.940Z</updated><title type='text'>Your companies product....</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://img.ffffound.com/static-data/assets/6/d82d2d4dc9018df0901e5c2441d0afc309c31f5d_m.png"&gt;&lt;img style="cursor: pointer; width: 320px;" src="http://img.ffffound.com/static-data/assets/6/d82d2d4dc9018df0901e5c2441d0afc309c31f5d_m.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Via &lt;a href="http://ffffound.com/image/d82d2d4dc9018df0901e5c2441d0afc309c31f5d"&gt;fffound&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-7825886107664890746?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/7825886107664890746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=7825886107664890746' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/7825886107664890746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/7825886107664890746'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/03/your-companies-product.html' title='Your companies product....'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-5766893197260388698</id><published>2008-03-10T13:58:00.015Z</published><updated>2008-03-10T16:37:46.834Z</updated><title type='text'>.Net developers and why we're crap</title><content type='html'>&lt;a href="http://www.listentomanchester.co.uk/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;ListenToManchester&lt;/span&gt;&lt;/a&gt; is a website designed to help promote bands in Manchester (UK).&lt;br /&gt;&lt;br /&gt;It is now almost 3 years old and recently I decided to have a look at how its being used by our users.&lt;br /&gt;&lt;br /&gt;Our stats have made it clear that key areas of the application just aren't being used. People weren't reviewing music, writing articles and rating music. They are however listening to the music and searching for gigs. Interestingly, a large percentage of our users come from the US.&lt;br /&gt;&lt;br /&gt;When we created the site we had lots of ideas and we tried to use all of them. As a result the many sections of the site aren't &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;particularly&lt;/span&gt; &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;usable&lt;/span&gt; or functional.&lt;br /&gt;&lt;br /&gt;Like many websites, it feels like it was designed by a developer - it &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_3"&gt;doesn't&lt;/span&gt; really solve the problem it was designed to.&lt;br /&gt;&lt;br /&gt;Initially I was considering rebuilding the site using &lt;a href="http://www.rubyonrails.org/"&gt;Ruby on Rails&lt;/a&gt;, but after much thought, we've decided that we &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_4"&gt;don't&lt;/span&gt; &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_5"&gt;particularly&lt;/span&gt; want too invest to much time in the site, but we do want to fix some of its many problems.&lt;br /&gt;&lt;br /&gt;So, 1 hour before me and my co-developer (Tom Adams) were due to play our weekly Power League 5-aside football match, we grabbed a mac laptop &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_6"&gt;opened&lt;/span&gt; the website I decided it was time to cull functionality in order to focus the site on the popular content.&lt;br /&gt;&lt;br /&gt;We decided that since reviews and articles weren't used often, and when they were people &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_7"&gt;didn't&lt;/span&gt; understand the difference between them. More specifically, they &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_8"&gt;didn't&lt;/span&gt; understand our definition of articles and reviews.&lt;br /&gt;&lt;br /&gt;So, we decided that these two sections of the site should be combined and renamed to news.&lt;br /&gt;&lt;br /&gt;On the homepage we decided to drop our music chart, since users weren't rating tracks, which meant that the chart &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_9"&gt;hadn't&lt;/span&gt; really changed in over a year.&lt;br /&gt;&lt;br /&gt;With these &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_10"&gt;decisions&lt;/span&gt; made, we fired up &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_11"&gt;Text Wrangler&lt;/span&gt; and opened up some of the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;usercontrols&lt;/span&gt; and web forms (the site was written with ASP.NET).&lt;br /&gt;&lt;br /&gt;Our aim was to make as many of the changes without having to recompile all the C# since we were working on a mac.&lt;br /&gt;&lt;br /&gt;I was appalled by the code in front of us.&lt;br /&gt;&lt;br /&gt;Almost all the changes we needed to make required re-compilation, when really it should have just been configuration and modification of the HTML and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;CSS&lt;/span&gt;! Almost zero thought had been given to the maintainability of the code!&lt;br /&gt;&lt;br /&gt;No wonder Tom, who is responsible for the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;CSS&lt;/span&gt; and HTML, had a dislike for ASP.NET during the development of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;ListenTo&lt;/span&gt;!&lt;br /&gt;&lt;br /&gt;Worryingly, many designers who have worked alongside &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_16"&gt;developers&lt;/span&gt; who use .NET have faced similar problems.&lt;br /&gt;&lt;br /&gt;.Net &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_17"&gt;isn't&lt;/span&gt; to blame though. In the case of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;ListenTo&lt;/span&gt;, the fault was my own.&lt;br /&gt;&lt;br /&gt;The biggest problem with .NET &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;isnt&lt;/span&gt; with the framework or the languages it supports. The problem is one of education.&lt;br /&gt;&lt;br /&gt;Most "professional .Net developers" when compared with Java developers are little more than &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_20"&gt;hobbyists&lt;/span&gt; (from a technical perspective) who happen to get paid for their work. They &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_21"&gt;don't&lt;/span&gt; architect solutions. They aren't software engineers. Many seem to be adept at &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;ctrl&lt;/span&gt;-c followed by &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;ctrl&lt;/span&gt;-v.&lt;br /&gt;&lt;br /&gt;I've recently been interviewing people for a development role within the company I work for and it scared me how little people seem to know about basic concepts.&lt;br /&gt;&lt;br /&gt;Am I a better developer than they are?&lt;br /&gt;&lt;br /&gt;For the last few years a &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_24"&gt;colleague&lt;/span&gt; of mine ( a Java &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_25"&gt;Dev&lt;/span&gt;)  has pushed me deeper and deeper into the world of open source .NET projects such as &lt;a href="http://www.springframework.net/"&gt;Spring.NET&lt;/a&gt; and introduced me to concepts as  inversion of control, loose coupling, designing &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_26"&gt;immutably&lt;/span&gt;, design patterns etc etc. Using different frameworks such as &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;ROR&lt;/span&gt; has introduced me to entirely new approaches to building web applications (&lt;a href="http://en.wikipedia.org/wiki/Model-view-controller"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;MVC&lt;/span&gt;&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;It's been quite an eye opener and, as a result, I'm now a much better developer.&lt;br /&gt;&lt;br /&gt;Are you a .Net developer? Stop thinking of yourself as a .Net developer! Start developing with other frameworks and languages alongside .Net!&lt;br /&gt;&lt;br /&gt;Our next project is being brought to you using &lt;a href="http://www.rubyonrails.org/"&gt;Ruby on Rails&lt;/a&gt; (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;mmm&lt;/span&gt; bandwagon goodness).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-5766893197260388698?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/5766893197260388698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=5766893197260388698' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/5766893197260388698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/5766893197260388698'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/03/net-developers-and-why-were-crap.html' title='.Net developers and why we&apos;re crap'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-8731209204652904508</id><published>2008-03-05T17:27:00.007Z</published><updated>2008-07-17T17:15:49.122+01:00</updated><title type='text'>Regular expressions, JavaScript and cross browser hell</title><content type='html'>Using regular expressions with JavaScript can be frustrating.&lt;br /&gt;&lt;br /&gt;Specifically, trying to use regular expressions consistently with the different web browsers (Explorer and Firefox) is frustrating.&lt;br /&gt;&lt;br /&gt;For example, using the match function upon a string yields different objects.&lt;br /&gt;&lt;br /&gt;Firefox returns an Array containing the matches and Explorer returns an Array with the additional properties :&lt;ul&gt;&lt;br /&gt;&lt;li&gt;The original string&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The matches (attached to properties 0 to n-1 ( where n = number of matches)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;A bunch of indexes.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;code&gt;var myMatches = mystring.match(myRegEx);&lt;br /&gt;for(var match in matches ) {&lt;br /&gt;alert(matches[match]);&lt;br /&gt;}&lt;/code&gt;So, the code above will alert out just the matches in Firefox.&lt;br /&gt;Explorer will alert out the matches and the values of the additional properties too.&lt;br /&gt;&lt;br /&gt;Which is correct? Time to read the specs (&lt;a href="http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf"&gt;http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Section 15.10.6.2 is pretty explicit. Explorer implements the functionality described in the specs, but the additional properties we mentioned above, are bespoke.&lt;br /&gt;&lt;br /&gt;Damn you Microsoft.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-8731209204652904508?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/8731209204652904508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=8731209204652904508' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/8731209204652904508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/8731209204652904508'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/03/regular-expressions-in-javascript.html' title='Regular expressions, JavaScript and cross browser hell'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-2078182519496951627</id><published>2008-03-04T15:39:00.002Z</published><updated>2008-03-04T16:20:47.423Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='imutable'/><category scheme='http://www.blogger.com/atom/ns#' term='Functional'/><category scheme='http://www.blogger.com/atom/ns#' term='Lisp'/><title type='text'>Coding in functional manner</title><content type='html'>Functional programming languages, such as Lisp (a mathematical notation for computer programs), are very different from procedural languages such as Java and early versions of C#.&lt;br /&gt;&lt;br /&gt;Functional programming is a style of programming that emphasizes the evaluation of expressions, rather than execution of commands. The expressions in these language are formed by using functions to combine basic values.  A functional language is a language that supports and encourages programming in a functional style.&lt;br /&gt;&lt;br /&gt;What is this "functional" style?&lt;br /&gt;&lt;br /&gt;Consider the following quadratic equation:&lt;br /&gt;&lt;br /&gt;x^2 + 5 = y&lt;br /&gt;&lt;br /&gt;Given a specific value for x, we always expect the same value for y.&lt;br /&gt;&lt;br /&gt;So, if x= 2, y= 9.&lt;br /&gt;&lt;br /&gt;This is always true.&lt;br /&gt;&lt;br /&gt;In many cases, particulary in a multi-threaded environment, it is helpful to develop functions that, for a given set of arguments, will always return the same result.&lt;br /&gt;&lt;br /&gt;Why? It helps us develop stateless imutable functions that are thread safe.&lt;br /&gt;&lt;br /&gt;NOTE: Something always has to be mutable otherwise our Lisp application couldnt do" anything!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-2078182519496951627?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/2078182519496951627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=2078182519496951627' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/2078182519496951627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/2078182519496951627'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/03/coding-in-functional-manner.html' title='Coding in functional manner'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-9010865957397136526</id><published>2008-03-04T15:24:00.006Z</published><updated>2008-07-17T17:50:21.223+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><title type='text'>Long running processes and JavaScript</title><content type='html'>Events like mouse clicks and keystrokes are handled in a single dedicated thread.&lt;br /&gt;&lt;br /&gt;If the handling JavaScript, which also runs in its own thread, is unresponsive, the browser remains responsive, but eventually willl inform the user of the problem and give them the option of cancelling the handler!&lt;br /&gt;&lt;br /&gt;This means that long running client side code cannot be executed without implementing a continuation style approach.&lt;br /&gt;&lt;br /&gt;Example 1&lt;br /&gt;&lt;textarea name="code"&gt;function clickHandler() {&lt;br /&gt;process1();&lt;br /&gt;process2();&lt;br /&gt;process3();&lt;br /&gt;}&lt;br /&gt;&lt;/textarea&gt;could be replaced with:&lt;br /&gt;Example 2&lt;br /&gt;&lt;textarea name="code"&gt;function longRunningProcess() {&lt;br /&gt;runProcess1();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function clickHandler() {&lt;br /&gt;process1();&lt;br /&gt;setTimeout(runProcess2(), 10);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function runProcess2() {&lt;br /&gt;process2();&lt;br /&gt;setTimeout(runProcess3(), 10);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function runProcess3() {&lt;br /&gt;process3();&lt;br /&gt;}&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;This is horrible.  However, the javascript library &lt;a href="http://www.neilmix.com/narrativejs/doc/"&gt;Narrative&lt;/a&gt; enables blocking capabilities for asynchronous event callbacks.  This makes asynchronous code more readable.&lt;br /&gt;&lt;br /&gt;So, it will convert the following code into Example 2:&lt;br /&gt;&lt;br /&gt;&lt;textarea name="code"&gt;&lt;br /&gt;function longRunningProcess() {&lt;br /&gt;process1();&lt;br /&gt;sleep(10);&lt;br /&gt;process2();&lt;br /&gt;sleep(10);&lt;br /&gt;process3();&lt;br /&gt;}&lt;br /&gt;&lt;/textarea &gt;&lt;br /&gt;Fortunately, it is rare that the client code should ever have to execute long processes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-9010865957397136526?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/9010865957397136526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=9010865957397136526' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/9010865957397136526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/9010865957397136526'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/03/long-running-processes.html' title='Long running processes and JavaScript'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-5118371215737610219</id><published>2008-03-03T17:32:00.001Z</published><updated>2008-03-04T16:22:30.566Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='queue'/><category scheme='http://www.blogger.com/atom/ns#' term='Asynchronous'/><category scheme='http://www.blogger.com/atom/ns#' term='setTimeout'/><title type='text'>SetTimeout</title><content type='html'>SetTimeout can appear to provide concurrent code execution. While SetTimeout is not part of the  ECMA-262 language specification, it is still implemented within a single threaded environment.&lt;br /&gt;&lt;br /&gt;Here is a test I performed to try and understand whats going on.&lt;br /&gt;&lt;pre&gt;function() test1{&lt;br /&gt;window.setTimeout( function(){alert('TimeOut function');},100);&lt;br /&gt;for(var i=0; i&lt;=10000000;i++) { if(i==10000000) {alert('long running process');} }} window.onload = Test1; &lt;/pre&gt;In this example, the alert 'long running process' always executes before 'TimeOut function'.&lt;br /&gt;&lt;br /&gt;From this test we can conclude that the anonymous function is not guaranteed to be executed when the time period passed to the setTimeout method has elapsed.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;So whats happening?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As I pointed out previously, JavaScript is single threaded and as such can only ever execute one piece of code. This means that if an asynchronous event such as a mouse click or a setTimeout call to anonymous function, occurs during the excution of a code block (not necessarily an atomic call), the event is queued.&lt;br /&gt;&lt;br /&gt;At the next available point during execution the queue will be queried and the next atomic code block executed.&lt;br /&gt;&lt;br /&gt;However, if we remove the "if" statement from the loop in the test we get a different result.&lt;br /&gt;&lt;pre&gt;function() test2 {&lt;br /&gt;window.setTimeout( function(){alert('TimeOut function');},100);&lt;br /&gt;for(var i=0; i&lt;1000000;i++){alert(i);}}&gt;&lt;br /&gt;&lt;br /&gt;window.onload = test2; &lt;/pre&gt;The "TimeOut function" can be alerted before, during and after the alerts within the loop, for example:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="objectBox objectBox-number"&gt;0&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="objectBox objectBox-number"&gt;1&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="objectBox objectBox-number"&gt;2&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="objectBox objectBox-number"&gt;3&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="objectBox objectBox-number"&gt;4&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="objectBox objectBox-number"&gt;5&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="objectBox objectBox-text"&gt;setTimeOutCalled&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="objectBox objectBox-number"&gt;6&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="objectBox objectBox-number"&gt;7&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="objectBox objectBox-number"&gt;8&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="objectBox objectBox-number"&gt;9&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="objectBox objectBox-number"&gt;...&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;         Does this contradict our previous conclusions? No.&lt;br /&gt;&lt;br /&gt;The javascript "alert" method is not responsible for creating the popup box that we see. The browsers UI thread does this. Which means that we have two threads, the javascript (containing our async queue) and the browsers thread for rendering UI. So, we cant guarantee the order we see the alerts, is the order that the javascript executes the alert statement&lt;br /&gt;&lt;br /&gt;So, to truely understand whats going on, we need to try to remove interactions with the UI thread.&lt;br /&gt;&lt;br /&gt;We will place our "alerts" into an array and render  (note that I have used attached an add method to the Array constructor to help with manipulating arrays).&lt;pre&gt;var var messages = [];&lt;br /&gt;function test2_Revisited()  {&lt;br /&gt;window.setTimeout( function(){Array.add(messages,"setTimeOutCalled");},100);&lt;br /&gt;for(var i=0; i&lt;1000000;i++) {Array.add(messages,i);}} &lt;br /&gt;window.onload = test2_Revisited; &lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="objectBox objectBox-number"&gt;0&lt;/span&gt;&lt;/li&gt;&lt;li&gt; &lt;span class="objectBox objectBox-number"&gt;1&lt;/span&gt;&lt;/li&gt;&lt;li&gt; &lt;span class="objectBox objectBox-number"&gt;2&lt;/span&gt;&lt;/li&gt;&lt;li&gt; &lt;span class="objectBox objectBox-number"&gt;3&lt;/span&gt;&lt;/li&gt;&lt;li&gt; &lt;span class="objectBox objectBox-number"&gt;4&lt;/span&gt;&lt;/li&gt;&lt;li&gt; &lt;span class="objectBox objectBox-number"&gt;5&lt;/span&gt;&lt;/li&gt;&lt;li&gt; &lt;span class="objectBox objectBox-number"&gt;6&lt;/span&gt;&lt;/li&gt;&lt;li&gt; &lt;span class="objectBox objectBox-number"&gt;7&lt;/span&gt;&lt;/li&gt;&lt;li&gt; &lt;span class="objectBox objectBox-number"&gt;8&lt;/span&gt;&lt;/li&gt;&lt;li&gt; ...&lt;/li&gt;&lt;li&gt;999999&lt;br /&gt;&lt;/li&gt;&lt;li&gt;setTimeOutCalled&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;Conslusions&lt;br /&gt;&lt;/span&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;We cannot guarantee that the delay requested in a setTimeout will be honoured.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;The seperate UI thread means that alerts and console.logs calls from javascript are not  synchronised with the user experience.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre&gt;For more information  see &lt;a href="http://ejohn.org/blog/how-javascript-timers-work/"&gt;this excellent article written by Jphn Resig &lt;/a&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-5118371215737610219?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/5118371215737610219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=5118371215737610219' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/5118371215737610219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/5118371215737610219'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/03/settimeout.html' title='SetTimeout'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7615243692077612735.post-2827343557489262407</id><published>2008-03-03T14:57:00.001Z</published><updated>2008-03-04T16:24:37.675Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Threading'/><category scheme='http://www.blogger.com/atom/ns#' term='ECMA-262'/><title type='text'>AJAX, Javascript and Threading</title><content type='html'>Javascript and Microsoft's JScript are compliant with the ECMA-262 language specification.&lt;br /&gt;&lt;br /&gt;I looked at the specification available at &lt;a href="http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf"&gt;http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf&lt;/a&gt; and it doesnt mention threading.&lt;br /&gt;&lt;br /&gt;There are no keywords or intrinsic ECMAScript objects available to manage threads, or to provide for thread synchronization.&lt;br /&gt;&lt;br /&gt;So, if threading is available in some or all browsers, the implementation is notcontrolled by this spec.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Javascript Engines&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;I couldnt find any details of the implementation of IE 7s Javascript engine, however, SpiderMonkey, the engine used by Firefox is documented at &lt;a href="http://www.mozilla.org/js/spidermonkey/"&gt;http://www.mozilla.org/js/spidermonkey/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The SpiderMonkey Javascript engine supports native threading!!&lt;br /&gt;&lt;br /&gt;However,  it appears that firefox only uses one JSContext for Javascript.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Without Threading, how does AJAX work?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It seems that many people blogging about AJAX mistake asynchronous requests for threading.&lt;br /&gt;&lt;br /&gt;This is not the case. Consider the following:&lt;br /&gt;&lt;br /&gt;I post an aysnchronous request to a web service. This request is associated with a callback function.&lt;br /&gt;&lt;br /&gt;Since this request is asynchronous and is now being handled by the browser rather than the JavaScript engine, I can execute JavaScript code while this request is being processed by the server.&lt;br /&gt;&lt;br /&gt;The code I choose to execute is a long running process and server will respond before the process is complete.&lt;br /&gt;&lt;br /&gt;Does the asynchronous request and callback function execute in their own thread?&lt;br /&gt;&lt;br /&gt;No. The callback function is not called until the long running process is complete even though the server responded quicker. Javascript queues asynchronous code when it is blocked.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Implementing our own threading model&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There are libraries, written in Javascript, that imitate the programming conventions associated with threading, but these "threads" still cannot execute code concurrently.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.neilmix.com/2007/02/07/threading-in-javascript-17/"&gt;http://www.neilmix.com/2007/02/07/threading-in-javascript-17/&lt;/a&gt; uses "python style" generators introduced in Javascript 1.7&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Conclusions:&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Microsoft need to start documenting the inner workings of their code. No more blackboxes!!!&lt;/li&gt;&lt;li&gt;JavaScript does not support native threading.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Since we cannot guarantee the order of asynchronous events, coding 'functionally' and 'immutabily' is still useful even in this single threaded environment.&lt;br /&gt;&lt;br /&gt;We avoid the use of global variables since asynchronous code mutating the same variable can lead to unwanted "side effects".&lt;br /&gt;&lt;br /&gt;We should always have a good reason to mutate!&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7615243692077612735-2827343557489262407?l=listentorick.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://listentorick.blogspot.com/feeds/2827343557489262407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7615243692077612735&amp;postID=2827343557489262407' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/2827343557489262407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7615243692077612735/posts/default/2827343557489262407'/><link rel='alternate' type='text/html' href='http://listentorick.blogspot.com/2008/03/threading-and-javascript.html' title='AJAX, Javascript and Threading'/><author><name>Rick Walsh</name><uri>http://www.blogger.com/profile/16611966532605072684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>
