<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>james mckay dot net</title>
	<atom:link href="http://www.jamesmckay.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://jamesmckay.net</link>
	<description>because there are few things that are less logical than business logic</description>
	<pubDate>Fri, 21 Nov 2008 08:00:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>What to drink when you don’t drink</title>
		<link>http://feeds.feedburner.com/~r/jamesmckay/~3/460510973/</link>
		<comments>http://jamesmckay.net/2008/11/what-to-drink-when-you-dont-drink/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 08:00:42 +0000</pubDate>
		<dc:creator>James</dc:creator>
		
		<category><![CDATA[Miscellany]]></category>

		<guid isPermaLink="false">http://jamesmckay.net/2008/11/what-to-drink-when-you-dont-drink/</guid>
		<description><![CDATA[Although I don&#8217;t drink alcohol, I am not averse to socialising in a pub from time to time, especially now that smoking in enclosed public places is illegal. However, you naturally expect a few raised eyebrows when you order something non-alcoholic, if not outright peer pressure to go for something inebriating.
Surprisingly, I find that almost [...]]]></description>
			<content:encoded><![CDATA[<p>Although I don&#8217;t drink alcohol, I am not averse to socialising in a pub from time to time, especially now that smoking in enclosed public places is illegal. However, you naturally expect a few raised eyebrows when you order something non-alcoholic, if not outright peer pressure to go for something inebriating.</p>
<p>Surprisingly, I find that almost nobody ever bats an eyelid, and I suspect that it&#8217;s because I always order a Diet Coke. It helps if you insist on Diet Coke rather than normal Coke, with ice cubes and a slice of lemon: the embellishments have a somewhat distracting effect that makes it easier to overlook the fact that none of them contain C<sub>2</sub>H<sub>5</sub>OH.</p>
<p>On the other hand, I don&#8217;t recommend orange juice, unless you want to draw attention to the fact that you intend to remain sober for the entire evening. In situations like that, it makes you look like a stereotype.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/jamesmckay?a=nl8LN"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=nl8LN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=hLz3n"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=hLz3n" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=Bc3gn"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=Bc3gn" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/jamesmckay/~4/460510973" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jamesmckay.net/2008/11/what-to-drink-when-you-dont-drink/feed/</wfw:commentRss>
		<feedburner:origLink>http://jamesmckay.net/2008/11/what-to-drink-when-you-dont-drink/</feedburner:origLink></item>
		<item>
		<title>An XSLT sweetener</title>
		<link>http://feeds.feedburner.com/~r/jamesmckay/~3/455672985/</link>
		<comments>http://jamesmckay.net/2008/11/an-xslt-sweetener/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 07:00:37 +0000</pubDate>
		<dc:creator>James</dc:creator>
		
		<category><![CDATA[Miscellany]]></category>

		<guid isPermaLink="false">http://jamesmckay.net/?p=461</guid>
		<description><![CDATA[If you&#8217;ve ever done anything with XSLT, you&#8217;ll no doubt be wondering why anyone would want to use such a verbose programming language, given that you need to churn out code such as this all over the place:

&#60;xsl:element name="foo"&#62;
  &#60;xsl:attribute name="bar"&#62;
    &#60;xsl:value-of select="/some/xpath/@expression" /&#62;
  &#60;/xsl:attribute&#62;
&#60;/xsl:element&#62;

However, did you know that you [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever done anything with XSLT, you&#8217;ll no doubt be wondering why anyone would want to use such a verbose programming language, given that you need to churn out code such as this all over the place:</p>
<pre name="code" class="xml">
&lt;xsl:element name="foo"&gt;
  &lt;xsl:attribute name="bar"&gt;
    &lt;xsl:value-of select="/some/xpath/@expression" /&gt;
  &lt;/xsl:attribute&gt;
&lt;/xsl:element&gt;
</pre>
<p>However, did you know that you can do this instead? Much cleaner and easier to read:</p>
<pre name="code" class="xml">
&lt;foo bar="{/some/xpath/@expression}" /&gt;
</pre>
<p>(Hat tip: <a href="http://nedbatchelder.com/blog/200309/streamlined_xslt.html">Ned Batchelder</a>)</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/jamesmckay?a=197hN"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=197hN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=y25sn"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=y25sn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=1fGen"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=1fGen" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/jamesmckay/~4/455672985" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jamesmckay.net/2008/11/an-xslt-sweetener/feed/</wfw:commentRss>
		<feedburner:origLink>http://jamesmckay.net/2008/11/an-xslt-sweetener/</feedburner:origLink></item>
		<item>
		<title>A train of thought</title>
		<link>http://feeds.feedburner.com/~r/jamesmckay/~3/449293567/</link>
		<comments>http://jamesmckay.net/2008/11/a-train-of-thought/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 08:00:37 +0000</pubDate>
		<dc:creator>James</dc:creator>
		
		<category><![CDATA[Miscellany]]></category>

		<guid isPermaLink="false">http://jamesmckay.net/2008/11/a-train-of-thought/</guid>
		<description><![CDATA[I&#8217;ve made a few observations after ten weeks of daily commuting to London.
The unpleasantries of the rush hour can be alleviated somewhat by choosing your train carefully and getting on at the right place. I always catch the 07:25 train to London Victoria at Horsham and go for the rearmost carriage, and so far I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made a few observations after ten weeks of daily commuting to London.</p>
<p>The unpleasantries of the rush hour can be alleviated somewhat by choosing your train carefully and getting on at the right place. I always catch the 07:25 train to London Victoria at Horsham and go for the rearmost carriage, and so far I have had a 100% success rate at getting a window seat. Most of the stations between Bognor Regis and Crawley have short platforms, and consequently the front of the train is generally much more packed out than the rear. I do not recommend getting on at Littlehaven: its platform is only four coaches long, but more people get on the train there than at Horsham, and it can be a bit of a crush at times. Then you have to jostle past people through several coaches in order to get a seat.</p>
<p>This effect is even more pronounced on the way home in the evenings. On Thursday I made the mistake of going for one of the front four coaches, and even though I had a seat, it was not a pleasant experience. The entire Littlehaven crowd pile in to the front four coaches right from the word go, rather than spreading themselves more evenly through the train and moving forward once we get to Crawley. This means that the back of the train is definitely the place to be if you are disembarking elsewhere.</p>
<p>I avoid the Underground like the plague. London buses may be a bit of a lottery in terms of overcrowding &#8212; I&#8217;ve had both good and bad experiences on the 507 &#8212; but at rush hour, the Underground is guaranteed to be so packed out that it makes a <a href="http://www.glpinc.org/Classroom%20Activities/Kenya%20Articles/Riding%20in%20a%20Matatu.htm">Kenyan matatu</a> look like an <a rel="nofollow" href="http://en.wikipedia.org/wiki/Bo%C3%B6tes_void">intergalactic void</a>. However, as I am working just under a mile from Victoria, it is cheaper, less crowded and more healthy to walk, as well as giving you a good bit more elbow room at only minimal cost in terms of time.</p>
<p>Finally, the best place to sit in a train is near the middle of a carriage. You get a pretty smooth ride there, whereas by contrast you get jolted about quite a lot near the ends of the carriage. It&#8217;s much the same reason as why the middle of a boat is where you&#8217;re least likely to be seasick: the carriage acts a bit like a lever, so the ends tend to wiggle about a lot more. Another thing about the ends of the carriage is that they can be a lot noisier if the doors at the end get jammed open.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/jamesmckay?a=0E0bN"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=0E0bN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=MqCZn"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=MqCZn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=NpJpn"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=NpJpn" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/jamesmckay/~4/449293567" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jamesmckay.net/2008/11/a-train-of-thought/feed/</wfw:commentRss>
		<feedburner:origLink>http://jamesmckay.net/2008/11/a-train-of-thought/</feedburner:origLink></item>
		<item>
		<title>Unit testing URL generation and Html.ActionLink in ASP.NET MVC</title>
		<link>http://feeds.feedburner.com/~r/jamesmckay/~3/433293621/</link>
		<comments>http://jamesmckay.net/2008/10/unit-testing-url-generation-and-htmlactionlink-in-aspnet-mvc/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 07:00:54 +0000</pubDate>
		<dc:creator>James</dc:creator>
		
		<category><![CDATA[ASP.NET MVC]]></category>

		<category><![CDATA[Unit testing]]></category>

		<guid isPermaLink="false">http://jamesmckay.net/?p=444</guid>
		<description><![CDATA[As I&#8217;ve been working with ASP.NET MVC lately on a couple of websites, the one thing I&#8217;ve found the hardest to get used to is the routing engine. Getting it set up to parse your URL to give you a route is straightforward enough &#8212; the hard, and often confusing, part is the helper functions [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;ve been working with ASP.NET MVC lately on a couple of websites, the one thing I&#8217;ve found the hardest to get used to is the routing engine. Getting it set up to parse your URL to give you a route is straightforward enough &#8212; the hard, and often confusing, part is the helper functions such as <code>Html.ActionLink</code> that generate URLs from route data. Sometimes the URLs look different to what you expect, but they work nonetheless; at other times, they are just plain wrong, especially if you have a complex routing table set up.</p>
<p>The logic behind constructing the URLs is fairly complex, and depends not only on the route data that you pass into the <code>ActionLink</code> method, but also on the route data that comes from the original URL that you used to access the page in the first place. If you have routes that are any more complex than the fairly trivial examples that come in the out of the box application templates, it can quickly get pretty confusing. Furthermore, chopping and changing the order in which you register your routes can get things totally out of kilter, so you really need a comprehensive suite of unit tests to be able to tackle it with any hope of retaining your sanity whatsoever.</p>
<p>The subject of unit testing your routes to make sure that you are getting the correct route data out of them has been covered by <a href="http://haacked.com/archive/2007/12/17/testing-routes-in-asp.net-mvc.aspx">Phil Haack</a> and <a href="http://weblogs.asp.net/stephenwalther/archive/2008/07/02/asp-net-mvc-tip-13-unit-test-your-custom-routes.aspx">Stephen Walther</a>, so I won&#8217;t go into any further detail about that aspect here. However, I&#8217;m going to expand a bit on Phil&#8217;s methods to show how to test things the other way round: making sure that when you pass some route data in to <code>Html.ActionLink</code>, it gives you the URL that you expect.</p>
<p>As with Phil&#8217;s sample code, I&#8217;ve used <a href="http://code.google.com/p/moq/">Moq</a> to mock the context, request and response, and I&#8217;m using Eilon Lipton&#8217;s technique of <a href="http://weblogs.asp.net/leftslipper/archive/2007/09/24/using-c-3-0-anonymous-types-as-dictionaries.aspx">using an anonymous class as a dictionary literal</a>. You can <a href="http://jamesmckay.net/wp-content/uploads/2008/10/routetesting.zip">download the code as a Visual Studio solution</a> if you want to get up and running with it straight away. Here&#8217;s a quick look at the methods that do all the work:</p>
<pre name="code" class="c#">
string FindUrlToRoute(string currentPage, object routeData)
{
	var mockContext = new Mock&lt;HttpContextBase&gt;();
	var mockRequest = new Mock&lt;HttpRequestBase&gt;();
	var mockResponse = new Mock&lt;HttpResponseBase&gt;();

	mockContext.Expect(c =&gt; c.Request).Returns(mockRequest.Object);
	mockContext.Expect(c =&gt; c.Response).Returns(mockResponse.Object);
	mockRequest.Expect(c =&gt; c.AppRelativeCurrentExecutionFilePath)
		.Returns(currentPage);
	mockResponse
		.Expect(c =&gt; c.ApplyAppPathModifier(It.IsAny&lt;string&gt;()))
		.Returns((string s) =&gt; s);

	var route = routes.GetRouteData(mockContext.Object);

	var requestContext 
		= new RequestContext(mockContext.Object, route);
	var url = new UrlHelper(requestContext);
	var dict = new RouteValueDictionary();

	foreach (PropertyValue property in GetProperties(routeData)) {
		dict[property.Name] = property.Value;
	}

	var path = routes.GetVirtualPath(requestContext, dict);
	return (path != null ? path.VirtualPath : null);
}

protected void AssertRouteUrl(string currentPage, string expectedUrl, 
	object routeData)
{
	var str = FindUrlToRoute(currentPage, routeData);
	Assert.AreEqual(expectedUrl, str, "URL was wrong!");
}
</pre>
<p>The sharp eyed among you will note that I am not actually calling <code>Html.ActionLink()</code> itself, but a different method, <code>routes.GetVirtualPath</code>. When you construct an action link, or when you use <code>Url.Action(...)</code> in your views, ASP.NET MVC ends up one way or another running your data through the <code>GetVirtualPath</code> method of your route table. You have to mock the <code>Response.ApplyAppPathModifier</code> method &#8212; a fact that wasn&#8217;t immediately obvious, and it took a bit of digging around in the <code>System.Web.Routing</code> assembly with Reflector to find out exactly what needed to be done.</p>
<p>You can then check to see whether you are getting the correct URL out by calling in to the <code>AssertRouteUrl</code> method as follows:</p>
<pre name="code" class="c#">
[Test]
public void TestBlogPath()
{
	AssertRouteUrl(
		/*
		 * currentPage is an app-relative URL, so it must be
		 * prefixed with a tilde (~). Note that this is required
		 * and must point to a valid route.
		 */
		"~/blog/2008/10/25",
		/*
		 * expectedUrl, on the other hand, is an absolute path,
		 * so it shouldn't.
		 */
		"/blog/2008/10/10",
		/*
		 * The route data. Note that you specify your controller and
		 * action here as the controller and action properties 
		 * respectively.
		 */
		new { 
			controller = "blog",
			action = "index",
			year = "2008",
			month = "10",
			day = "10"
		}
	);
}
</pre>
<p>Download: <a href="http://jamesmckay.net/wp-content/uploads/2008/10/routetesting.zip">Unit testing route URL generation - Visual Studio solution</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/jamesmckay?a=CFq7M"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=CFq7M" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=3rN1m"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=3rN1m" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=iG3sm"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=iG3sm" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/jamesmckay/~4/433293621" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jamesmckay.net/2008/10/unit-testing-url-generation-and-htmlactionlink-in-aspnet-mvc/feed/</wfw:commentRss>
		<feedburner:origLink>http://jamesmckay.net/2008/10/unit-testing-url-generation-and-htmlactionlink-in-aspnet-mvc/</feedburner:origLink></item>
		<item>
		<title>In defence of 24 hours</title>
		<link>http://feeds.feedburner.com/~r/jamesmckay/~3/423455198/</link>
		<comments>http://jamesmckay.net/2008/10/in-defence-of-24-hours/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 07:00:21 +0000</pubDate>
		<dc:creator>James</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[books]]></category>

		<guid isPermaLink="false">http://jamesmckay.net/2008/10/in-defence-of-24-hours/</guid>
		<description><![CDATA[The Sams Teach Yourself &#8230; in 24 hours series gets a bit of a bashing from some people. The criticism is that you can&#8217;t learn to be a programmer, let alone a good one, in only 24 hours, and by publishing books with titles such as these, they cheapen our craft. People wander into a [...]]]></description>
			<content:encoded><![CDATA[<p>The Sams <em>Teach Yourself &#8230; in 24 hours</em> series <a href="http://stackoverflow.com/questions/184118/what-programming-book-would-you-not-recommend-to-developers#184159">gets a bit of a bashing from some people</a>. The criticism is that <a href="http://norvig.com/21-days.html">you can&#8217;t learn to be a programmer</a>, let alone a good one, in only 24 hours, and by publishing books with titles such as these, <a href="http://www.codinghorror.com/blog/archives/000560.html">they cheapen our craft</a>. People wander into a bookshop, pick up a copy of <em>Teach Yourself PHP in 24 hours</em> or something, and the next day they are copying and pasting SQL injection vulnerabilities from all over the web into what they hope will be The Next Facebook. Or so the thinking goes.</p>
<p>Now people who say this kind of thing have a valid point. You can&#8217;t learn to be a good programmer overnight &#8212; it takes years of experience, trial and error, constantly honing your skills, and so on, and I don&#8217;t think you&#8217;ll ever reach a point where you stop learning. However, I don&#8217;t think it&#8217;s fair to turn this point into a criticism of books such as the <em>24 hours </em>series. To be sure, these books won&#8217;t turn you into an expert programmer in a weekend, but if you think that&#8217;s what they&#8217;re all about, you&#8217;ve completely misunderstood the title. Their aim is to give you enough knowledge to bootstrap your understanding of the subject in that period of time to a point where you can actually start to Get Things Done, and then give you a platform to build on.</p>
<p><img style="border-right: 0px; border-top: 0px; margin: 0px 0px 10px 10px; border-left: 0px; border-bottom: 0px" src="http://jamesmckay.net/wp-content/uploads/2008/10/067232797x01mzzzzzzz.jpg" border="0" alt="Teach Yourself XML in 24 hours" width="127" height="164" align="right" />In that respect, I think they play a very important role. Whenever I come to a completely new technology, I see a mysterious black box, with everything hidden away behind a facade of whatever user interface you have, and if that happens to me as a particularly techno-savvy type, it&#8217;s certainly going to happen to lesser mortals as well. However, I often find that it just takes a little bit of an idea of what&#8217;s going on under the hood for me to get started finding my way around it in earnest. Somehow, the first part of the learning curve often seems the steepest.</p>
<p>There&#8217;s another reason why they&#8217;re important too. Computer programming these days &#8212; certainly, programming in the Real World &#8212; often requires you to get a handle on new technologies and languages very quickly. It&#8217;s a fast paced world, with new technologies coming out left, right and centre, and if you don&#8217;t keep up you&#8217;ll fall behind. Add a few over-enthusiastic sales guys into the mix, convincing the clients that you&#8217;re the world&#8217;s greatest SharePoint expert on the basis of the fact that you threw a default installation of MOSS 2007 onto a server and set up a couple of custom lists, and things get all the more interesting. Very often, you <em>need</em> to get up to speed with something in only 24 hours.</p>
<p>In this respect, I&#8217;ve found the <em>24 hours</em> books to be some of the best introductory texts on computer programming related subjects that you can get. I originally learned XML from Michael Morrison&#8217;s <em>Teach Yourself XML in 24 hours</em>. I have two books on UML: Martin Fowler&#8217;s <em>UML Distilled</em> and Joseph Schmuller&#8217;s <em>Teach Yourself UML in 24 hours</em>, and I find Schmuller&#8217;s book the easier and clearer of the two to follow. It doesn&#8217;t particularly dumb the subject down either &#8212; both books cover the same material in similar depth. Given that Martin Fowler is one of the best tech writers around today, that speaks quite favourably for Joseph Schmuller.</p>
<p>I somehow wonder if there&#8217;s an element of snobbery involved in criticising books such as these. It seems to me that most of the criticism comes from very experienced and knowledgeable computer science-y types &#8212; the kind of people who think that Scheme is the best language to start with for teaching programming to ten year olds. It&#8217;s a bit like the world of church music: some traditionalist classical musicians get very dismissive of modern Charismatic worship albums. You can easily understand why: if you&#8217;ve spent several years studying for multiple degrees in music or computer science, no doubt working up a massive student loan in the process, you aren&#8217;t going to take too kindly to the idea that someone can be just as successful in your field without having gone to the same amount of expense and trouble.</p>
<p>So don&#8217;t be embarrassed about reading books in the <em>24 hours</em> series. Everyone has to start somewhere with new technologies, and for getting started, these books are every bit as good as any.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/jamesmckay?a=569ZM"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=569ZM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=LgzVm"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=LgzVm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=qvLjm"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=qvLjm" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/jamesmckay/~4/423455198" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jamesmckay.net/2008/10/in-defence-of-24-hours/feed/</wfw:commentRss>
		<feedburner:origLink>http://jamesmckay.net/2008/10/in-defence-of-24-hours/</feedburner:origLink></item>
		<item>
		<title>ASP.NET MVC + jQuery - can things get any better for web developers?</title>
		<link>http://feeds.feedburner.com/~r/jamesmckay/~3/407992684/</link>
		<comments>http://jamesmckay.net/2008/10/aspnet-mvc-jquery-can-things-get-any-better-for-web-developers/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 07:00:45 +0000</pubDate>
		<dc:creator>James</dc:creator>
		
		<category><![CDATA[ASP.NET MVC]]></category>

		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://jamesmckay.net/2008/10/aspnet-mvc-jquery-can-things-get-any-better-for-web-developers/</guid>
		<description><![CDATA[Microsoft&#8217;s recent decision to include jQuery in the ASP.NET development stack is pretty exciting news. I&#8217;ve been using jQuery for a while now, and all I can say about it is that it makes JavaScript fun. You can use it to add some pretty impressive effects to your web pages with only a couple of [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft&#8217;s recent decision to <a href="http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx">include jQuery in the ASP.NET development stack</a> is pretty exciting news. I&#8217;ve been using jQuery for a while now, and all I can say about it is that it makes JavaScript <em>fun</em>. You can use it to add some pretty impressive effects to your web pages with only a couple of lines of code, and you have less to worry about as far as the idiosyncrasies of cross-browser detection are concerned. In the past year or so it&#8217;s become pretty popular and even something of a de facto standard in many ways, probably best described as JavaScript&#8217;s answer to Linq. If you&#8217;re a web developer and you haven&#8217;t yet come across it, I really would encourage you to <a href="http://jquery.com/">check it out</a> &#8212; you&#8217;ll love it, even if you <a href="http://jamesmckay.net/2007/12/volta-gwt-and-leaky-abstractions/">hate JavaScript</a>.</p>
<p>Hopefully this will attract some more talent back to the .NET platform. It&#8217;s been the case for a while now that the best, most passionate web developers &#8212; the ones who come up with the all-singing, all-dancing Ajax-y websites and eye candy &#8212; have generally been <a href="http://jamesmckay.net/2008/05/where-are-all-the-passionate-net-developers/">shunning the Microsoft stack</a> in favour of PHP, Django and Ruby on Rails. You can easily understand why &#8212; the web forms postback model may be good for simple, fairly generic things, but if you really want to make your website sing, it has restrictions and leaky abstractions that get in the way a lot, such as the limitation of one server-side form per page, or the convoluted id attributes that it sticks in all over the place making CSS and DOM manipulation a major headache, or the monster that is view state.</p>
<p>However, with the ASP.NET MVC framework on the go, we have finally got back the control over our HTML that we need, and now with jQuery forming an official part of it, ASP.NET is becoming an even more exciting prospect again. It&#8217;s especially so since in many ways you can really push the boundaries with .NET a lot further than with most other frameworks. Languages such as PHP or Ruby are good in themselves, but they do have their limitations, and it&#8217;s not a good idea to try to use them for image manipulation, or genetic algorithms, or Bayesian spam filtering, for instance &#8212; they are just too slow for computationally intensive stuff such as that, and in those cases you would need to drop down to C++. On the other hand, in C#, you can do it all in one integrated end-to-end framework, and with Visual Studio, you have what is probably the best IDE on the market to help you on your way.</p>
<p>I&#8217;m looking forward to seeing a lot more all-singing, all-dancing websites written in ASP.NET.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/jamesmckay?a=hvkbM"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=hvkbM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=DuuPm"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=DuuPm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=TsC7m"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=TsC7m" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/jamesmckay/~4/407992684" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jamesmckay.net/2008/10/aspnet-mvc-jquery-can-things-get-any-better-for-web-developers/feed/</wfw:commentRss>
		<feedburner:origLink>http://jamesmckay.net/2008/10/aspnet-mvc-jquery-can-things-get-any-better-for-web-developers/</feedburner:origLink></item>
		<item>
		<title>Why Stack Overflow’s reputation system is broken</title>
		<link>http://feeds.feedburner.com/~r/jamesmckay/~3/404603102/</link>
		<comments>http://jamesmckay.net/2008/09/why-stack-overflows-reputation-system-is-broken/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 11:30:21 +0000</pubDate>
		<dc:creator>James</dc:creator>
		
		<category><![CDATA[Miscellany]]></category>

		<guid isPermaLink="false">http://jamesmckay.net/2008/09/why-stack-overflows-reputation-system-is-broken/</guid>
		<description><![CDATA[I find it rather ironic that the author of the blog entry from which this excerpt is taken:
It seems like any time you try to measure the performance of knowledge workers, things rapidly disintegrate, and you get what Robert D. Austin calls measurement dysfunction. His book Measuring and Managing Performance in Organizations is an excellent [...]]]></description>
			<content:encoded><![CDATA[<p>I find it rather ironic that the author of <a href="http://www.joelonsoftware.com/news/20020715.html">the blog entry from which this excerpt is taken</a>:</p>
<blockquote><p>It seems like any time you try to measure the performance of knowledge workers, things rapidly disintegrate, and you get what <a href="http://www.cutter.com/consultants/austinr.html">Robert D. Austin</a> calls measurement dysfunction. His book <em><a href="http://www.amazon.com/exec/obidos/ASIN/0932633366/ref=nosim/joelonsoftware"><em>Measuring and Managing Performance in Organizations</em></a></em> is an excellent and thorough survey of the subject. Managers like to implement measurement systems, and they like to tie compensation to performance based on these measurement systems. But in the absence of 100% supervision, workers have an incentive to &#8220;work to the measurement,&#8221; concerning themselves solely with the measurement and not with the actual value or quality of their work.</p>
</blockquote>
<p>is also <a href="http://stackoverflow.com/about">one of the faces</a> behind a programmer website which does <em>exactly</em> what he is railing against.</p>
<p>I&#8217;m talking about the Stack Overflow reputation and badge system. Granted, it was more Jeff Atwood&#8217;s idea than Joel&#8217;s &#8212; <a href="http://blog.stackoverflow.com/2008/07/podcast-13/">he took his inspiration for it from the Xbox 360</a> &#8212; but the big problem is that when you try to turn a serious system that is supposed to be all about Getting Things Done into a game, people just game the system and turn it into an unusable mess that is not fit for purpose.</p>
<p>If you want to see what I mean, just take a look at <a href="http://stackoverflow.com/questions/140236/what-is-a-good-issue-tracker-for-both-project-managers-and-developers">this question</a>, which I asked yesterday afternoon. I&#8217;ve been looking for a bug tracker system which can work as an integrated system for both developers and project managers for a while now, and none of the ones I&#8217;ve looked at so far have the particular feature I&#8217;m asking for.</p>
<p>The first so-called answer came within seconds and didn&#8217;t answer the question properly, which isn&#8217;t surprising since you would need at least 2-3 minutes just to read the question in the first place. It was followed by a string of about ten or so responses over the next half hour, again, very few of which made much effort to read the question, let alone answer it. Most people seemed to treat it as saying &#8220;What is your favourite issue tracker?&#8221; and one busybody even tagged it as &#8220;subjective&#8221; when I was asking for something very specific. And <em>nobody</em> so far has reported any success or otherwise with using an issue tracker of any description to integrate both the developer&#8217;s-eye view and the project manager&#8217;s-eye view.</p>
<p>This is a BIG problem with Stack Overflow, and I&#8217;ve seen it to an extent on other questions too. The system doesn&#8217;t favour good answers or correct answers or answers that actually make any attempt to answer the question, it favours quick answers. Being the first off the mark with something that at least looks like it could plausibly be an answer to the question means you&#8217;re most likely to get voted up. Getting voted up means appearing at the top of the list of answers, and it&#8217;s kind of self perpetuating because then you get more votes, and each vote means that you get ten reputation points, and if you get enough reputation points, you automatically become the Stack Overflow equivalent of a Wikipedia administrator.</p>
<p>The result is that you get a whole lot of knuckleheads gaming the system trying to pimp their reputation. They put up a response that looks fairly plausible and seems right to other knuckleheads but which either (a) doesn&#8217;t answer the question, or (b) is plain wrong. If the person asking the question is also a knucklehead, their answer gets marked as the accepted answer, which means even more reputation points. In the meantime, someone who arrives several days or weeks later with the correct answer doesn&#8217;t get any attention because their answer gets buried in all the other zeros. It&#8217;s particularly worrying because it&#8217;ll be the knuckleheads who end up running the show and deciding what goes and what doesn&#8217;t.</p>
<p>It&#8217;s as broken as lines of code per day, and it really <em>really</em> annoys me.</p>
<p>It really annoys a lot of other <a href="http://stackoverflow.com/questions/88947/what-should-visitors-to-stackoverflow-be-called">Stackers</a> too &#8212; <a href="http://stackoverflow.uservoice.com/pages/general/suggestions/24695">a request to fix it</a> is the most popular user request on the Stack Overflow uservoice forums, though the problem is that there is no consensus about what needs to be done to stop it. I do hope they come up with some fix for it, otherwise the site could end up with no more value than its arch-nemesis, expertsexchange.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/jamesmckay?a=RtXxL"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=RtXxL" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=b0sfl"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=b0sfl" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=6Pfwl"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=6Pfwl" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/jamesmckay/~4/404603102" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jamesmckay.net/2008/09/why-stack-overflows-reputation-system-is-broken/feed/</wfw:commentRss>
		<feedburner:origLink>http://jamesmckay.net/2008/09/why-stack-overflows-reputation-system-is-broken/</feedburner:origLink></item>
		<item>
		<title>Colemak redux</title>
		<link>http://feeds.feedburner.com/~r/jamesmckay/~3/403525970/</link>
		<comments>http://jamesmckay.net/2008/09/colemak-redux/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 07:00:49 +0000</pubDate>
		<dc:creator>James</dc:creator>
		
		<category><![CDATA[Typing]]></category>

		<guid isPermaLink="false">http://jamesmckay.net/2008/09/colemak-redux/</guid>
		<description><![CDATA[It came as no surprise to me when I decided to revert to qwerty that my blog was inundated with spirited comments from the Colemak crowd. After all, some of them seem to think that the aforementioned layout could triple your typing speed, cure cancer, and stop global warming, and for me to admit that [...]]]></description>
			<content:encoded><![CDATA[<p>It came as no surprise to me when <a href="http://jamesmckay.net/2008/06/alternative-keyboard-layouts-a-waste-of-time/">I decided to revert to qwerty</a> that my blog was inundated with spirited comments from the Colemak crowd. After all, some of them seem to think that the aforementioned layout could triple your typing speed, cure cancer, and stop global warming, and for me to admit that I&#8217;d failed to reach my qwerty speed after four months was nothing short of heresy for which I should be burned at the stake.</p>
<p>Well perhaps I was a bit too hard on it, and no doubt I&#8217;ll get another firestorm of comments from the fanboys here, because I&#8217;ve started using it again.</p>
<p>I&#8217;m not using it all the time, mind you. I tend to use my laptop at home, and in my experience, Colemak and laptop keyboards simply do not mix. But I&#8217;ve been using it increasingly at work with my Microsoft Natural 4000 keyboard, and the two of them seem to go together fairly well. I really can&#8217;t emphasise this strongly enough: <strong>if you want to get the most out of Colemak, get a split ergonomic keyboard.</strong></p>
<p>Switching between the two layouts also seems more comfortable in the long run, once you get used to it. They exercise different muscles in your hands and arms, so I find that when I get tired working with one, switching to the other helps a lot. I also seem to be picking up a bit of speed with it too, and though I haven&#8217;t got round to testing myself again, I wouldn&#8217;t be surprised if I&#8217;m managing to hit 70 a bit more consistently.</p>
<p>Now if only someone would treat me to an <a href="http://www.aeronchair.co.uk/">Aeron chair</a>&#8230;</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/jamesmckay?a=Jm2KL"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=Jm2KL" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=MXIQl"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=MXIQl" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=dlwMl"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=dlwMl" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/jamesmckay/~4/403525970" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jamesmckay.net/2008/09/colemak-redux/feed/</wfw:commentRss>
		<feedburner:origLink>http://jamesmckay.net/2008/09/colemak-redux/</feedburner:origLink></item>
		<item>
		<title>The leaf!</title>
		<link>http://feeds.feedburner.com/~r/jamesmckay/~3/388600231/</link>
		<comments>http://jamesmckay.net/2008/09/the-leaf/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 12:00:21 +0000</pubDate>
		<dc:creator>James</dc:creator>
		
		<category><![CDATA[Miscellany]]></category>

		<guid isPermaLink="false">http://jamesmckay.net/2008/09/the-leaf/</guid>
		<description><![CDATA[I was delighted to learn last week that I have been accepted as a member of 9rules. If you&#8217;ve never heard of it before, it&#8217;s an exclusive network of quality blogs run by Paul Scrivens, Mike Rundle and Tyme White. They don&#8217;t just accept anyone and everyone &#8212; only blogs with consistently good quality, design [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://9rules.com/"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 10px; border-right-width: 0px" height="145" alt="green_leaf" src="http://jamesmckay.net/wp-content/uploads/2008/09/green-leaf.gif" width="121" align="right" border="0"/></a>I was delighted to learn last week that <a href="http://blog.9rules.com/2008/09/round-7-accepted-sites/">I have been accepted as a member of 9rules</a>. If you&#8217;ve never heard of it before, it&#8217;s an exclusive network of quality blogs run by Paul Scrivens, Mike Rundle and Tyme White. They don&#8217;t just accept anyone and everyone &#8212; only blogs with consistently good quality, design and content get accepted, so it was heartening to know that someone thinks I&#8217;m doing something right. They set the bar fairly high &#8212; you need to have been blogging consistently for at least six months, and they look for well thought out, thoroughly researched posts, and a good, consistent, easy to navigate design that is appropriate to what you&#8217;re writing about. So if you are one of those types who writes detritus like &#8220;omg lol chk out this youtube vid lmao rotfl&#8221; or posts those inane quizzes that tell you which Star Wars character you are, forget it.</p>
<p>There are some pretty interesting people in the network, such as <a href="http://joeanderson.co.uk/blog/">Joe Anderson</a>, who writes about a variety of issues related to general technology, Web 2.0 and &#8220;<a href="http://jamesmckay.net/2007/09/on-leaving-wikipedia/#comment-1836">the</a>&#8221; Wikipedia, and <a href="http://lorelle.wordpress.com/">Lorelle van Fossen</a>, whose blog about blogging is very well regarded within the WordPress community. Check out <a href="http://www.neverhappen.com/">neverhappen.com</a> too &#8212; it&#8217;s a daily photoblog with some absolutely stunning photography.</p>
<p>Needless to say, this will keep the pressure on me to come up with good quality content. The fact that I&#8217;m working in London for one of our <a href="http://www.parliament.uk/">Very Important Clients</a> for the next three months puts even more pressure on my time as well &#8212; I have to set my alarm for half past five in the morning in order to catch the 07:25 train. However, a 55 minute commute each way does give me an opportunity to jot down some ideas for interesting content, even though the train can be pretty full and elbow room can be at a premium sometimes.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/jamesmckay?a=iAvsL"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=iAvsL" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=e5kzl"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=e5kzl" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=4dhsl"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=4dhsl" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/jamesmckay/~4/388600231" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jamesmckay.net/2008/09/the-leaf/feed/</wfw:commentRss>
		<feedburner:origLink>http://jamesmckay.net/2008/09/the-leaf/</feedburner:origLink></item>
		<item>
		<title>Paths and file locations in ASP.NET</title>
		<link>http://feeds.feedburner.com/~r/jamesmckay/~3/386453574/</link>
		<comments>http://jamesmckay.net/2008/09/paths-and-file-locations-in-aspnet/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 07:30:04 +0000</pubDate>
		<dc:creator>James</dc:creator>
		
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://jamesmckay.net/?p=399</guid>
		<description><![CDATA[There are loads of ways to find the path &#8212; either the URL or the physical path &#8212; to a page, user control or other file in an ASP.NET application. Unfortunately, however, the documentation doesn&#8217;t do a brilliant job of explaining them to you. There are also several different scenarios, depending on whether you are [...]]]></description>
			<content:encoded><![CDATA[<p>There are loads of ways to find the path &#8212; either the URL or the physical path &#8212; to a page, user control or other file in an ASP.NET application. Unfortunately, however, the documentation doesn&#8217;t do a brilliant job of explaining them to you. There are also several different scenarios, depending on whether you are using conventional web forms, or URL rewriting, or <code>Server.Transfer</code>, or ASP.NET MVC. So I thought I&#8217;d better write down an overview of some of them for reference.</p>
<p><strong>Scenario 1: direct request for a web form.</strong></p>
<p>Just suppose for a minute that you have been contracted to rewrite Wikipedia in ASP.NET. So, for instance, you may end up with the page &#8220;<a rel="nofollow" href="http://en.wikipedia.org/wiki/WP:NOT">What Wikipedia is Not</a>&#8221; (aka &#8220;WP:NOT&#8221; or &#8220;Wikipedia&#8217;s attempt to get into the Guinness Book of Records for the most lies per kilobyte on a web page&#8221;) at http://en.wikipedia.org/wiki.aspx/WP:NOT.</p>
<p>In this case, you have several different properties of HttpContext.Current.Request containing different representations of it.</p>
<ul>
<li><code>Request.RawUrl = "/wiki.aspx/WP:NOT"</code> represents the path and query string parts of the URL. In this case, of course, there is no query string, but if there were, you might see it set to something like <code>"/wiki.aspx/WP:NOT?mode=edit"</code>. </li>
<li><code>Request.Path = "/wiki.aspx/WP:NOT"</code> represents the path part of the URL. </li>
<li><code>Request.FilePath = "/wiki.aspx"</code> represents the part of the path to the file (in this case wiki.aspx) that is handling the request. </li>
<li><code>Request.PathInfo = "/WP:NOT"</code> is a diff of <code>Request.Path</code> and <code>Request.FilePath</code>, giving the extraneous bit of the path that does not refer to a file in the file system. </li>
<li><code>Request.PhysicalPath = "c:\inetpub\wwwroot\wiki.aspx"</code> is the physical path to the file that is servicing the request.</li>
</ul>
<p><strong>Case 2: Server.Transfer() and Server.Execute()</strong></p>
<p>Sometimes, you may want to transfer control from one file to another. Let us suppose, for instance, that you decide to use several Web forms: one for articles, one for special pages, and one for article history. You do a few simple checks in wiki.aspx and decide to transfer control to another file, say, article.aspx, using <code>Server.Transfer()</code>. Then, another property of <code>Request</code> comes into play.</p>
<ul>
<li><code>Request.CurrentExecutionFilePath = "/article.aspx"</code> represents the path to the file that is currently handling the current part of the request.</li>
<li><code>Request.FilePath = "/wiki.aspx"</code>, however, remains unchanged.</li>
<li><code>Request.PhysicalPath = "c:\inetpub\wwwroot\wiki.aspx"</code> also remains unchanged.</li>
<li><code>Request.AppRelativeCurrentExecutionFilePath = "~/article.aspx"</code> is the same as <code>Request.CurrentExecutionFilePath</code>, but relative to the root of the web application, as defined in IIS. If your application were rooted at, say, <code>"/wiki"</code> then <code>Request.CurrentExecutionFilePath</code> would be <code>"/wiki/article.aspx"</code>.</li>
<li>Everything else remains unchanged.</li>
</ul>
<p>Note that <code>Request.CurrentExecutionFilePath</code> is always in use: if there has been no call to <code>Server.Transfer</code> it will be the same as <code>Request.FilePath</code>.</p>
<p><strong>Case 3: URL rewriting</strong></p>
<p>So you have this lovely new ASP.NET version of Wikipedia up and running, it works much more smoothly, has much less downtime, and runs on only a dozen or so servers rather than a hundred. Then, you start getting hate mail from irate Wikipedians, many of whom are open source zealots who are <a rel="nofollow" href="http://en.wikipedia.org/wiki/Criticism_of_Microsoft">definitely not NPOV on Microsoft Windows</a>. Jimbo and the Arbitration Committee get involved and demand you rewrite those URLs to cover up the fact that the Wikimedia Foundation has gone over to the Dark Side.</p>
<p>So, you take the original URL <a rel="nofollow" href="http://en.wikipedia.org/wiki/WP:NOT">http://en.wikipedia.org/wiki/WP:NOT</a> and transmogrify it into <a rel="nofollow" href="http://en.wikipedia.org/wiki.aspx?ns=Wikipedia&amp;pg=What_Wikipedia_is_Not">http://en.wikipedia.org/wiki.aspx?ns=Wikipedia&amp;pg=What_Wikipedia_is_Not</a> using a discreet call to <code>Context.RewritePath</code>.</p>
<p>Suddenly, everything changes!</p>
<ul>
<li><code>Request.RawUrl = "/wiki/WP:NOT"</code> represents the original path and query string parts of the URL. In actual fact, <code>Request.RawUrl</code> <em>always</em> represents exactly what you typed into your browser. </li>
<li><code>Request.Path = "/wiki.aspx"</code> represents the path part of the URL.  </li>
<li><code>Request.FilePath = "/wiki.aspx"</code> represents the part of the path to the file (in this case wiki.aspx) that is handling the request.  </li>
<li><code>Request.PathInfo</code> is blank. When you use URL rewriting you have to point to a real file: you can&#8217;t use a <code>PathInfo</code> &#8212; that&#8217;s why you need to use a query string instead.</li>
<li><code>Request.CurrentExecutionFilePath = "/wiki.aspx"</code> until you call <code>Server.Transfer</code>, when it changes.</li>
<li><code>Request.QueryString = "ns=Wikipedia&amp;amp;pg=What_Wikipedia_is_Not"</code> is of course changed after the URL rewrite.</li>
<li><code>Request.PhysicalPath = "c:\inetpub\wwwroot\wiki.aspx"</code> is, again, the physical path to the file that is servicing the request.</li>
</ul>
<p><strong>Case 4: ASP.NET MVC</strong></p>
<p>So how on earth, you may be asking, does all this work with ASP.NET MVC? After all, it doesn&#8217;t use Web forms in the same way &#8212; URLs map to controllers, which then decide which views to render themselves.</p>
<p>Well here&#8217;s the skinny:</p>
<ul>
<li><code>Request.RawUrl = "/wiki/WP:NOT"</code> contains the raw URL (path and query string) as before.</li>
<li><code>Request.Path</code>, <code>Request.FilePath</code>, and <code>Request.CurrentExecutionFilePath</code>, all contain the &#8220;path&#8221; part of the URL without the query string. They will all be set to <code>"/wiki/WP:NOT"</code></li>
<li><code>Request.PathInfo</code> is blank. ASP.NET MVC handles path info through the routing engine and passes it in the parameters for your controller.</li>
<li><code>Request.PhysicalPath = "c:\inetpub\wwwroot\wiki\WP:NOT"</code> is NOT the physical path to the file that is servicing the request. Controllers may decide to render one of any number of views or other results, and they need not even be Web forms &#8212; they could be raw text content (from a <code>ContentResult</code>), or a redirect (from a <code>RedirectResult</code> or a <code>RedirectToRouteResult</code>) or a JSON string (from a <code>JsonResult</code>) and they aren&#8217;t associated with a physical file on the filesystem at all.</li>
</ul>
<p><strong>Case 5: ASP.NET MVC with URL rewriting and/or Server.Transfer</strong></p>
<p>I shall leave this one as an exercise for the reader. No doubt there is someone, somewhere, who is doing this, for reasons that completely befuddle me. After all, I&#8217;d have thought that the whole MVC pattern renders URL rewriting and Server.Transfer pretty much redundant.</p>
<p><strong>Case 6: Requests for a directory&#8217;s home page</strong></p>
<p>This is much the same as the above, except that ASP.NET inserts the name of the home page &#8212; typically default.aspx &#8212; into <code>Request.RawUrl</code>, and, by extension, everything else. Obviously, this does not apply to ASP.NET MVC.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/jamesmckay?a=CyBsL"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=CyBsL" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=C9WTl"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=C9WTl" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jamesmckay?a=LdPLl"><img src="http://feeds.feedburner.com/~f/jamesmckay?i=LdPLl" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/jamesmckay/~4/386453574" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jamesmckay.net/2008/09/paths-and-file-locations-in-aspnet/feed/</wfw:commentRss>
		<feedburner:origLink>http://jamesmckay.net/2008/09/paths-and-file-locations-in-aspnet/</feedburner:origLink></item>
	</channel>
</rss>
