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

<channel>
	<title>Tim Martin&#039;s blog &#187; Software Development</title>
	<atom:link href="http://blog.asymptotic.co.uk/category/softwaredev/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.asymptotic.co.uk</link>
	<description>On the human side of software</description>
	<lastBuildDate>Sat, 13 Aug 2011 00:25:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Why I was wrong about Ruby on Rails</title>
		<link>http://blog.asymptotic.co.uk/2011/06/why-i-was-wrong-about-ruby-on-rails/</link>
		<comments>http://blog.asymptotic.co.uk/2011/06/why-i-was-wrong-about-ruby-on-rails/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 21:07:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.asymptotic.co.uk/?p=700</guid>
		<description><![CDATA[" gained a lot of its focus and appeal because I didn’t try to please people who didn’t share
my problems." — David Heinemeier Hansson
I always used to maintain that Ruby on Rails was a blight on the world of software development that wasn't just making individual sites worse, it was making developers worse. Yet ...]]></description>
			<content:encoded><![CDATA[<blockquote><p>&#8220;[Rails] gained a lot of its focus and appeal because I didn’t try to please people who didn’t share<br />
my problems.&#8221; — David Heinemeier Hansson</p></blockquote>
<p>I always used to maintain that <a href="http://www.rubyonrails.org/">Ruby on Rails</a> was a blight on the world of software development that wasn&#8217;t just making individual sites worse, it was making developers worse. Yet here I am a few years on, having chosen to develop my new web application in Ruby on Rails. What gives?</p>
<p>Some of my criticisms still hold up. Rails still encourages beginners to think of every single data-storage requirement as a nail waiting for the hammer of <a href="http://en.wikipedia.org/wiki/Active_record">active record</a>. It&#8217;s still too easy to write code that doesn&#8217;t scale. Above all, while the tutorials are blissfully easy it can still be a hard slog learning what&#8217;s going on under the hood, so that you can do more than just cut and paste tutorial code. I believe Rails has improved on each one of these points, but not yet enough for my liking.</p>
<p>Yet I was wrong about Rails, and part of the reason I was wrong goes back to a truth I&#8217;ve always held to be under-appreciated: when you choose a technology, you inevitably choose a community at the same time. The Rails community may border on the smug from time to time, but it also seems to have an above-average number of developers who are <em>smart</em> and <em>get things done</em>. Developers who aren&#8217;t just happy to do things the same old flawed way, but want to find a better way, and make it work for people. Above all, they deliver solutions that work now, not promising-but-currently-flawed solutions. This was typified by my serendipitous discovery of <a href="https://github.com/jtrupiano/timecop">Timecop</a>, a library that makes testing of time-sensitive code about as easy and effective as it could possibly be. Any language <em>could</em> solve that problem, but in Rails I have a solution right now, with no fuss (yes, I&#8217;m sure this particular example is solved in lots of other web frameworks too).</p>
<p>None of this is about the language <em>per se</em>. Rails isn&#8217;t better than Zend Framework because Ruby is better than PHP (it is, but the differences come up surprisingly rarely). Rails is better than Zend Framework because Rails has a complete suite of solutions for DB schema management, functional testing, unit testing etc., while Zend Framework plays catch-up. As far as I&#8217;ve seen, PHP has nothing to touch Heroku for ease of deployment.</p>
<p>Web development certainly has different challenges from all other development environments. I used to worry that statelessness was a major problem, and I felt that continuation-based frameworks like <a href="http://seaside.st/">Seaside</a> and <a href="http://common-lisp.net/project/ucw/">UnCommon Web</a> held the most promise for resolving this. I was wrong, to the extent that while state is consistently a problem there&#8217;s a &#8220;good enough&#8221; solution in the form of MVC, while streamlined automated functional testing of web apps (which Rails does admirably with a test suite based on CSS selectors) brings massive benefit right here and now, rather than in a utopian future.</p>
<p class="wp-flattr-button"></p> <p><a href="http://blog.asymptotic.co.uk/?flattrss_redirect&amp;id=700&amp;md5=979d4c1ffae0f79f04afe56495361bf1" title="Flattr" target="_blank"><img src="http://blog.asymptotic.co.uk/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.asymptotic.co.uk/2011/06/why-i-was-wrong-about-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Book review: Knowledge for Action: A Guide to Overcoming Barriers to Organizational Change</title>
		<link>http://blog.asymptotic.co.uk/2011/03/book-review-knowledge-for-action-a-guide-to-overcoming-barriers-to-organizational-change/</link>
		<comments>http://blog.asymptotic.co.uk/2011/03/book-review-knowledge-for-action-a-guide-to-overcoming-barriers-to-organizational-change/#comments</comments>
		<pubDate>Sun, 27 Mar 2011 20:53:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.asymptotic.co.uk/?p=657</guid>
		<description><![CDATA[
"The Human Side of Software Development" may just be a tacky slogan I came up with on the spur of the moment to make my Wordpress install just a tad less generic, but the sentiment behind it is genuine, and something that I've always meant to expand more on in this blog. So here ...]]></description>
			<content:encoded><![CDATA[<div style="float: right;"><iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=0000FF&lc1=000000&t=asymptoticcou-20&o=1&p=8&l=as1&m=amazon&f=ifr&asins=1555425194" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></div>
<p>&#8220;The Human Side of Software Development&#8221; may just be a tacky slogan I came up with on the spur of the moment to make my WordPress install just a tad less generic, but the sentiment behind it is genuine, and something that I&#8217;ve always meant to expand more on in this blog. So here goes, with a review of a decidedly non-technical book.</p>
<p>One thing I&#8217;ve been convinced of since I first read <a href="http://www.amazon.com/Peopleware-Productive-Projects-Teams-Second/dp/0932633439?SubscriptionId=0XR4J3F7YGSYWMEMEF02&tag=wp-amazon-associate-20" target="_blank" rel="nofollow" title="" >Peopleware</a> is that human factors are the cause of more of the problems in the average software team than technical issues. It&#8217;s not just that human problems exist in our teams and are difficult to solve, it&#8217;s that we don&#8217;t learn from our mistakes. Dev never talks to marketing. Engineers blame the testers, and testers blame engineers. Management write off all techies as being difficult to manage. These tropes are played out again and again in thousands of teams, and we still don&#8217;t seem to have a really clear idea what the underlying problem is, let alone what to do about it.</p>
<p>Nor is this just a matter of individual learning. Teams and whole organisations need to learn from their mistakes so that we don&#8217;t end up pulling in different directions, or even worse have the lone people who feel they have solutions feeling powerless to influence the herd.</p>
<p>Enter Chris Argyris, Professor Emeritus at Harvard Business School, who has spent a lifetime researching topics like these. His book <a href="http://www.amazon.com/Knowledge-Action-Overcoming-Barriers-Organizational/dp/1555425194?SubscriptionId=0XR4J3F7YGSYWMEMEF02&tag=asymptoticcou-20" target="_blank" rel="nofollow" title="" >Knowledge for Action</a> attempts to tackle one of the most crucial barriers to this sort of organisation learning, namely the defensive habits and routines that make it impossible for organisations to change. Argyris paints an all-too-familiar picture of an organisation where everyone is overtly committed to effecting some change, but politics creeps in, fights break out and people tacitly cooperate in undermining their own efforts.</p>
<p>Argyris&#8217;s main contention is that attempting to change organisations throws up situations of embarrassment or threat, and that people respond to this by avoiding the difficult issues. Moreover, people silently collaborate on this because it&#8217;s in nobody&#8217;s interest to uncover the threatening material. The case study that&#8217;s central to the book develops the author&#8217;s hypothesis that by changing our fundamental internal model of the world (taking the focus off winning / losing and onto objectively verifying our beliefs about others) our individual and team behaviour will naturally follow.</p>
<p>I suspect that two aspects of this book will appeal to those of a technical persuasion. First of all, the book is research-based and as precise in its analysis as the subject matter allows. This is not some faddy airport self-help guide for middle managers. Secondly, the approach is the quintessentially nerdy technique of looking to change the second derivative of the problem: not dealing with things that are bad, or even with how to make them better, but how to improve the &#8216;making better&#8217; process. Hopefully engineers will intuitively see the potential for huge leverage in getting this right.</p>
<p>Unfortunately, I can give this only a qualified recommendation for readers from a technical background. Yes it&#8217;s a good book, and a great contribution to the growing body of knowledge, but ultimately it&#8217;s still a piece of social science research and the author is clearly intending it to be read by other academics with a similar background. I probably read more &#8220;soft&#8221; science research papers than the average techie and I found it pretty hard going at times.</p>
<p>So this is really one for the enthusiasts, or those who&#8217;ve already read <a href="http://www.amazon.com/Fifth-Discipline-Peter-M-Senge/dp/1905211201?SubscriptionId=0XR4J3F7YGSYWMEMEF02&tag=asymptoticcou-20" target="_blank" rel="nofollow" title="" >The Fifth Discipline</a> and want to take it further.</p>
<p class="wp-flattr-button"></p> <p><a href="http://blog.asymptotic.co.uk/?flattrss_redirect&amp;id=657&amp;md5=6d8d71375bd9fbe46e5ba4028fed0a7c" title="Flattr" target="_blank"><img src="http://blog.asymptotic.co.uk/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.asymptotic.co.uk/2011/03/book-review-knowledge-for-action-a-guide-to-overcoming-barriers-to-organizational-change/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to tell if you&#8217;re in a method in C++</title>
		<link>http://blog.asymptotic.co.uk/2011/03/how-to-tell-if-youre-in-a-method-in-c/</link>
		<comments>http://blog.asymptotic.co.uk/2011/03/how-to-tell-if-youre-in-a-method-in-c/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 21:50:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.asymptotic.co.uk/?p=649</guid>
		<description><![CDATA[An issue came up at work that we wanted some generic logging code to be able to report the object it was being called from. The tricky part is that we wanted the same logging macro to work in non-method context as well. Any use of this is impossible because it will cause a ...]]></description>
			<content:encoded><![CDATA[<p>An issue came up at work that we wanted some generic logging code to be able to report the object it was being called from. The tricky part is that we wanted the same logging macro to work in non-method context as well. Any use of <code>this</code> is impossible because it will cause a compile error in the latter case.</p>
<p>In short, both the following instances ought to work, but the one in the class method should automatically know to print some extra gubbins about the object:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1"><span class="kw4">struct</span> Something <span class="br0">&#123;</span>
   <span class="kw4">void</span> someMethod<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
      LOG<span class="br0">&#40;</span><span class="st0">&quot;Some logging message&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span>
   <span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="sy4">;</span>
&nbsp;
<span class="kw4">void</span> someFunction<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
   LOG<span class="br0">&#40;</span><span class="st0">&quot;Some other logging message&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span>
<span class="br0">&#125;</span></pre></div></div></div></div></div></div></div>


<p>I thought this was an interesting case, not so much for the eventual solution as for the thought process involved. One of the big problems with C++ is that although you have no shortage of powerful tools that enable metaprogramming, they were never designed to provide a coherent system. It takes a bit of experience even to know what&#8217;s possible, let alone how to go about finding a way to do something. With most metaprogramming the pattern is to find one language feature that yields the information you need (perhaps a type trait, a typedef, a function return value or whatever) and abuse some language feature (<code>sizeof</code>, SFINAE, template argument deduction etc.) to allow the original feature to indirectly feed through to generate a usable compile-time value such as an enum or typdef.</p>
<p>Obviously macros are going to be involved here: no other tool in C++ allows for code reuse and gives the repeated code access to the scope in which it is invoked. But macros are purely a lexical concept, so we&#8217;ll have to include something else that operates at a syntactic level to discriminate between the cases.</p>
<p>So what&#8217;s different in state between member and non-member functions in C++? There&#8217;s the <code>this</code> pointer, for a start. Also, a different namespace scope is available and potentially different accessibility to private and protected class members. Other than that, there&#8217;s not much else in the ISO standard (compiler extensions like <code>__PRETTY_FUNCTION__</code> might help, though).</p>
<p>Using the <code>this</code> keyword is the most direct route to the information we need, since it pretty much <em>is</em> the information we need. Unfortunately, the definition of <code>this</code> is such that even mentioning it when outside of object context is an instant compile error. Since we can&#8217;t so much as mention it in our macro definition, we&#8217;re going to have to be a bit craftier.</p>
<p>The problem is that using <code>this</code> outside of a method is a syntax error, which will kill our compile immediately. Except there&#8217;s precisely one case where the compiler can recover from a syntax error and take a different path: instantiating a template. If the compiler attempts a template instantiation and gets a compile error, it may discard that template specialisation and try another possibility. This is surprisingly useful and even gets its own name, the rather snappy <a href="http://en.wikipedia.org/wiki/SFINAE">Substitution Failure Is Not An Error</a>.</p>
<p>Unfortunately SFINAE isn&#8217;t going to help us here, because the area of expanded code where an error is allowable is within a different scope than the place we&#8217;re trying to log from: it&#8217;s either always in a free function scope, or always in a method scope (depending on whether we use a template function or a template class for SFINAE), but it will never depend on the calling context.</p>
<p>So we&#8217;re back to the drawing board, except that we know that we can&#8217;t mention <code>this</code> in our macro. This leaves us with two possible ways to discriminate the cases: class member accessibility and function overloads in scope. As an example of the former, consider the following:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1"><span class="co2">#include &lt;iostream&gt;</span>
&nbsp;
<span class="kw2">using</span> <span class="kw2">namespace</span> std<span class="sy4">;</span>
&nbsp;
<span class="kw2">class</span> Something <span class="br0">&#123;</span>
<span class="kw2">public</span><span class="sy4">:</span>
	<span class="kw4">static</span> <span class="kw4">void</span> func<span class="br0">&#40;</span>...<span class="br0">&#41;</span> <span class="br0">&#123;</span>
		<span class="kw3">cout</span> <span class="sy1">&lt;&lt;</span> <span class="st0">&quot;Ordinary function, anyone can see this&quot;</span> <span class="sy1">&lt;&lt;</span> endl<span class="sy4">;</span>
	<span class="br0">&#125;</span>
&nbsp;
	<span class="kw4">void</span> method<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
		Something<span class="sy4">::</span><span class="me2">func</span><span class="br0">&#40;</span><span class="nu0">42</span><span class="br0">&#41;</span><span class="sy4">;</span>
	<span class="br0">&#125;</span>
&nbsp;
<span class="kw2">private</span><span class="sy4">:</span>
	<span class="kw4">static</span> <span class="kw4">void</span> func<span class="br0">&#40;</span><span class="kw4">int</span> n<span class="br0">&#41;</span> <span class="br0">&#123;</span>
		<span class="kw3">cout</span> <span class="sy1">&lt;&lt;</span> <span class="st0">&quot;Private function, you need to be privileged&quot;</span> <span class="sy1">&lt;&lt;</span> endl<span class="sy4">;</span>
	<span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="sy4">;</span>
&nbsp;
<span class="kw4">int</span> main<span class="br0">&#40;</span><span class="kw4">int</span> argc, <span class="kw4">char</span> <span class="sy2">**</span> argv<span class="br0">&#41;</span> <span class="br0">&#123;</span>
	Something<span class="sy4">::</span><span class="me2">func</span><span class="br0">&#40;</span><span class="nu0">42</span><span class="br0">&#41;</span><span class="sy4">;</span>
&nbsp;
	Something something<span class="sy4">;</span>
	something.<span class="me1">method</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy4">;</span>
<span class="br0">&#125;</span></pre></div></div></div></div></div></div></div>


<p>This is how you might like it to work: the call in <code>main()</code> gets the unprivileged overload, and the call in <code>Something::method()</code> gets the more specific overload that it can only see because it&#8217;s in the context of the class. This, by the way, works by a quirk of C++ that varargs functions are always used as a last resort and only if an overload that matches better is not available. Let&#8217;s ignore for the moment the fact that this only detects if we&#8217;re in a special sort of class (namely the one that defines <code>func()</code>, or a friend of it) and not the general distinction between class and non-class.</p>
<p>Unfortunately, we can&#8217;t use accessibility in this way because function overload resolution happens before accessibility is checked. Rather than getting a different result from the overload resolution in each case, you get the same result from overload resolution in each case and a compiler error if the preferred form is not accessible. You may be thinking that SFINAE could save us here, but in fact we have the same problem as before: the call will take place outside of the scope we&#8217;re trying to detect.</p>
<p>So the only thing we have left that distinguishes between free function context and method context is the different set of functions in scope:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1"><span class="co2">#define LOG( x ) cout &lt;&lt; (getThis() ? &quot;In method&quot; : &quot;In function&quot;) \
   &lt;&lt; &quot;: &quot; &lt;&lt; x &lt;&lt; endl;</span>
&nbsp;
<span class="kw4">void</span> <span class="sy2">*</span> getThis<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
   <span class="kw1">return</span> <span class="kw2">NULL</span><span class="sy4">;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="kw4">struct</span> Fish <span class="br0">&#123;</span>
   <span class="kw4">void</span> <span class="sy2">*</span> getThis<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
      <span class="kw1">return</span> <span class="kw3">this</span><span class="sy4">;</span>
   <span class="br0">&#125;</span>
&nbsp;
   <span class="kw4">void</span> method<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
      LOG<span class="br0">&#40;</span><span class="st0">&quot;Log line&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span>
   <span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="sy4">;</span>
&nbsp;
<span class="kw4">void</span> function<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
   LOG<span class="br0">&#40;</span><span class="st0">&quot;Log line&quot;</span><span class="br0">&#41;</span><span class="sy4">;</span>
<span class="br0">&#125;</span></pre></div></div></div></div></div></div></div>


<p>This is promising, actually. In fact, it&#8217;s pretty close to what we want except for the fact that we have to define this log method in every class that we want to be able to log from. This isn&#8217;t as bad as it first seems, since the only reason to get hold of the <code>this</code> pointer in practice is to call methods on it, and we can only do that if all the classes implement a common interface anyway.</p>
<p>In practice, the <code>getThis()</code> construction is a little weak. It only returns a <code>void *</code>, and in order to call any methods we&#8217;ll have to cast it back to the proper type, and we&#8217;re back to the problem of not knowing the type of the class we&#8217;re in (or even if we have a class type). Rather than trying to implement reusable code in a macro definition, any code that needs to know about types will have to be in a method that&#8217;s implemented for every class we care about, and corresponding stubs at global scope. This is pretty horrible, and will probably render this technique useless.</p>
<p>So in the end we don&#8217;t really have a solution, but at least we can be reasonably confident that we&#8217;re not missing anything.</p>
<p>Much of the above code doutless contains errors, as I haven&#8217;t tested a lot of it. Feel free to write in with corrections.</p>
<p class="wp-flattr-button"></p> <p><a href="http://blog.asymptotic.co.uk/?flattrss_redirect&amp;id=649&amp;md5=a924156de17192ec37e5b0d349e25e94" title="Flattr" target="_blank"><img src="http://blog.asymptotic.co.uk/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.asymptotic.co.uk/2011/03/how-to-tell-if-youre-in-a-method-in-c/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Job security</title>
		<link>http://blog.asymptotic.co.uk/2011/03/job-security/</link>
		<comments>http://blog.asymptotic.co.uk/2011/03/job-security/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 10:36:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.asymptotic.co.uk/?p=626</guid>
		<description><![CDATA[A software developer reportedly wrote malicious code to ensure job security:
It wasn't a club but a computer virus that shut down the Whac-A-Mole and  more than 400 other games built by Bob's Space Racers in Holly Hill.  The company traced the problem back to computer programmer Marvin  Wimberly.

Faced with a pay ...]]></description>
			<content:encoded><![CDATA[<p>A software developer <a href="http://www.wftv.com/news/26986709/detail.html">reportedly wrote malicious code to ensure job security</a>:</p>
<blockquote><p>It wasn&#8217;t a club but a computer virus that shut down the Whac-A-Mole and  more than 400 other games built by Bob&#8217;s Space Racers in Holly Hill.  The company traced the problem back to computer programmer Marvin  Wimberly.</p>
<p>Faced with a pay cut, police believe Wimberly programmed games to fail, ensuring he would be needed and keep making money.</p></blockquote>
<blockquote><p>[...]</p></blockquote>
<blockquote><p>Each game,  after turning on and off a certain number of times, sometimes 50,  sometimes 500, would fail. Wimberly would be paid to fix it, and police  reports say, he would insert a new virus with a new countdown.</p></blockquote>
<p>Of course, the big story here isn&#8217;t that the malicious action happened, but that it was discovered and traced back to the allegedly deliberate actions of an employee, and that police have been involved.</p>
<p>My guess would be that this type of thing goes on all the time, and is either not noticed or not taken seriously. I suspect it&#8217;s mostly not a deliberate sin of comission but a subtle sin of omission: developers don&#8217;t refactor, or don&#8217;t document, or don&#8217;t upgrade their design to integrate with new components. Quite probably they come up with ostensible reasons why it can&#8217;t or shouldn&#8217;t be done that are sufficiently convincing.</p>
<p>The irony, of course, is that doing a better job should make you more employable, not less. Even when unemployment was at its peak, the companies I&#8217;ve been working with have been terribly short of quality developers.</p>
<p>Here are some of factors that I think contribute to this:</p>
<ul>
<li>People end up working in software development who don&#8217;t have the necessary interest or aptitude, but carry on with it because giving up would cause them to lose face, or because even a badly-paid software job is better than a great deal of alternatives.</li>
<li>Management in companies where software is only a small component of the business don&#8217;t necessarily understand the software development process, and as a result are overly deferential to the opinions of developers. Furthermore, they overestimate the cost of replacing an incompetent developer with a competent one, and underestimate the long-term benefit.</li>
<li>Bad developers are rewarded too well, and good developers too poorly. The best developers deliver something like 20 times the benefit of the worst developers, but are lucky to get paid twice as much. This blunts the incentive for a mediocre or poor developer to improve themselves, and encourages those at the bottom end of the scale to hang on rather than move to a different career to which they may be more suited.</li>
</ul>
<p class="wp-flattr-button"></p> <p><a href="http://blog.asymptotic.co.uk/?flattrss_redirect&amp;id=626&amp;md5=64478773b684b476272726c9ccf88478" title="Flattr" target="_blank"><img src="http://blog.asymptotic.co.uk/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.asymptotic.co.uk/2011/03/job-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compile-time type identification</title>
		<link>http://blog.asymptotic.co.uk/2011/02/compile-time-type-identification/</link>
		<comments>http://blog.asymptotic.co.uk/2011/02/compile-time-type-identification/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 20:32:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[metaprogramming]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://blog.asymptotic.co.uk/?p=620</guid>
		<description><![CDATA[Yesterday I was working on a class to produce natural-language translations of complex C++ types, and I said that there was no general way to map a fundamental type to a name. Of course, there is:
19ccf3c5e65da454a3f4eb5d7b424050_000003


Of course, not quite everything in the garden is lovely. This provides an implementation-defined string, which as far as ...]]></description>
			<content:encoded><![CDATA[<p>Yesterday I was working on a class to produce natural-language translations of complex C++ types, and I said that there was no general way to map a fundamental type to a name. Of course, there is:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1"><span class="kw2">template</span><span class="sy1">&lt;</span><span class="kw2">typename</span> T<span class="sy1">&gt;</span>
<span class="kw2">class</span> TypeDecryptor <span class="br0">&#123;</span>
<span class="kw2">public</span><span class="sy4">:</span>
    <span class="kw4">static</span> string getName<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="kw1">return</span> <span class="kw2">typeid</span><span class="br0">&#40;</span>T<span class="br0">&#41;</span>.<span class="me1">name</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy4">;</span>
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="sy4">;</span></pre></div></div></div></div></div></div></div>


<p>Of course, not quite everything in the garden is lovely. This provides an implementation-defined string, which as far as I can see is not even required to be unique for a given type. In point of fact, it&#8217;s extremely unlikely an implementation will return a non-unique string since each type has to be mapped to a string for linkage purposes anyway. The problem is that the string isn&#8217;t necessarily human-readable.</p>
<p>I think that on reasonable implementations there should be a function available to unmangle this string back into a human-readable type, which means you can potentially make a completely general type decryptor.</p>
<p class="wp-flattr-button"></p> <p><a href="http://blog.asymptotic.co.uk/?flattrss_redirect&amp;id=620&amp;md5=ffb410321df2a106b3d9173e86b4a0be" title="Flattr" target="_blank"><img src="http://blog.asymptotic.co.uk/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.asymptotic.co.uk/2011/02/compile-time-type-identification/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>C++ type-declaration decoder</title>
		<link>http://blog.asymptotic.co.uk/2011/02/c-type-declaration-decoder/</link>
		<comments>http://blog.asymptotic.co.uk/2011/02/c-type-declaration-decoder/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 01:09:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://blog.asymptotic.co.uk/?p=606</guid>
		<description><![CDATA[Despite the somewhat self-aggrandising title, I have to admit that  by Peter Van Der Linden is the single most beneficial programming book I've ever read. I believe the point that I came across it marked the first step on a road from being an amateurish hacker who was happy with anything as long as ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.co.uk/gp/product/0131774298?ie=UTF8&amp;tag=reviewtfm-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0131774298" rel="nofollow"><img class="alignright size-full wp-image-607" title="Expert C programming front cover" src="http://blog.asymptotic.co.uk/wp-content/uploads/2011/02/expert_c_programming.jpg" alt="expert C programming front cover" width="128" height="160" /></a>Despite the somewhat self-aggrandising title, I have to admit that <a href="http://www.amazon.com/Expert-Programming-Peter-van-Linden/dp/0131774298?SubscriptionId=0XR4J3F7YGSYWMEMEF02&tag=asymptoticcou-20" target="_blank" rel="nofollow" title="" >Expert C Programming: Deep C Secrets</a> by Peter Van Der Linden is the single most beneficial programming book I&#8217;ve ever read. I believe the point that I came across it marked the first step on a road from being an amateurish hacker who was happy with anything as long as it compiled, to being a software professional. Of course, by this point I&#8217;d already long been paid <em>as if</em> I were a software professional, simply because I have a degree in mathematics from a high-ranking university. Such is the way of things.</p>
<p>Anyway, the most useful section of <em>Deep C Secrets</em> is a section that gives a simple algorithm for understanding a complicated C type declaration. You know the kind of thing:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="c"><pre class="de1"><span class="kw4">void</span> <span class="br0">&#40;</span><span class="sy0">*</span>signal<span class="br0">&#40;</span><span class="kw4">int</span> sig<span class="sy0">,</span> <span class="kw4">void</span> <span class="br0">&#40;</span><span class="sy0">*</span>func<span class="br0">&#41;</span> <span class="br0">&#40;</span><span class="kw4">int</span><span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#40;</span><span class="kw4">int</span><span class="br0">&#41;</span> <span class="sy0">;</span></pre></div></div></div></div></div></div></div>


<p>The algorithm, by the way, is given in a section that has the delicious title &#8220;The Piece of Code that Understandeth all Parsing.&#8221; I&#8217;d forgotten how funny that book is.</p>
<p>The main problem with this is that it&#8217;s a run-time operation, and has to take the type declaration as a string. Parsing it involves a whole bunch of logic that already exists in the compiler, but has to be re-implemented. When I was stumbling through some declarations in <a href="http://www.amazon.com/Templates-Complete-Guide-David-Vandevoorde/dp/0201734842?SubscriptionId=0XR4J3F7YGSYWMEMEF02&tag=asymptoticcou-20" target="_blank" rel="nofollow" title="" >C++ Templates: The Complete Guide</a> it dawned on me that maybe C++ can do better.</p>
<p>Understanding any type declaration can be broken down into two parts:</p>
<ul>
<li>Knowing where to start</li>
<li>Knowing which piece to process next</li>
</ul>
<p>The first of these is often rendered difficult by the fact that there are several identifiers in a typedef, and you have to know which is the one being defined (because this is where you start to parse the type). In an anonymous type, there may be no identifiers at all:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1">doStuff<span class="br0">&#40;</span> <span class="kw2">static_cast</span><span class="sy3">&amp;</span>lt<span class="sy4">;</span> <span class="kw4">int</span> <span class="br0">&#40;</span><span class="sy2">*</span><span class="br0">&#41;</span> <span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy3">&amp;</span>gt<span class="sy4">;</span> foobar <span class="br0">&#41;</span><span class="sy4">;</span></pre></div></div></div></div></div></div></div>


<p>In this case you start with the <code>*</code>, but it&#8217;s not easy to see how to know this in general.</p>
<p>The second difficulty (knowing which piece of the type to handle next) is complicated by the fact that you may need to proceed left-to-right or right-to-left, which depends on precedence rules that most people understand only implicitly, and often only by instinct.</p>
<p>Using the C++ rules for template argument deduction, we can ignore most of these issues. The core idea is to declare a template that takes a single compound type and expresses the type in terms of one or more simpler components. For example, we can write a class that deals with a pointer:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1"><span class="kw2">template</span>
<span class="kw2">class</span> TypeDecryptor <span class="br0">&#123;</span>
<span class="kw2">public</span><span class="sy4">:</span>
	<span class="kw4">static</span> string getName<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
		ostringstream output<span class="sy4">;</span>
		output <span class="sy3">&amp;</span>lt<span class="sy4">;</span><span class="sy3">&amp;</span>lt<span class="sy4">;</span> <span class="st0">&quot;pointer to &quot;</span>
                      <span class="sy3">&amp;</span>lt<span class="sy4">;</span><span class="sy3">&amp;</span>lt<span class="sy4">;</span> TypeDecryptor<span class="sy4">::</span><span class="me2">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy4">;</span>
		<span class="kw1">return</span> output.<span class="me1">str</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy4">;</span>
	<span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="sy4">;</span></pre></div></div></div></div></div></div></div>


<p>What this says is that the <code>getName()</code> method on a <code>TypeDecryptor</code> applied to a pointer type will return the string &#8220;pointer to&#8221; followed by whatever the type decryptor tells us the pointed-to type should be called. We can do something very similar for <code>const</code>:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1"><span class="kw2">template</span>
<span class="kw2">class</span> TypeDecryptor <span class="br0">&#123;</span>
<span class="kw2">public</span><span class="sy4">:</span>
	<span class="kw4">static</span> string getName<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
		ostringstream output<span class="sy4">;</span>
		output <span class="sy3">&amp;</span>lt<span class="sy4">;</span><span class="sy3">&amp;</span>lt<span class="sy4">;</span> <span class="st0">&quot;const &quot;</span> <span class="sy3">&amp;</span>lt<span class="sy4">;</span><span class="sy3">&amp;</span>lt<span class="sy4">;</span> TypeDecryptor<span class="sy4">::</span><span class="me2">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy4">;</span>
		<span class="kw1">return</span> output.<span class="me1">str</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy4">;</span>
	<span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="sy4">;</span></pre></div></div></div></div></div></div></div>


<p>We&#8217;ve already got something useful, because it can deal with all that <code>int const * const *</code> stuff that people sometimes have problems with. OK, so you also need a <code>TypeDecryptor</code> specialisation for each of the fundamental types, which just prints out the type name:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1"><span class="kw2">template</span><span class="sy3">&amp;</span>lt<span class="sy4">;</span><span class="sy3">&amp;</span>gt<span class="sy4">;</span>
<span class="kw2">class</span> TypeDecryptor <span class="br0">&#123;</span>
<span class="kw2">public</span><span class="sy4">:</span>
	<span class="kw4">static</span> string getName<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
		<span class="kw1">return</span> <span class="st0">&quot;int&quot;</span><span class="sy4">;</span>
	<span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="sy4">;</span></pre></div></div></div></div></div></div></div>


<p>Annoyingly, I can&#8217;t find any way to generalise this, so you need an explicit specialisation for any fundamental or user-defined class type you want to support. It could be streamlined with a macro, of course.</p>
<p>So at this point, our decryptor can do things like this:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1"><span class="kw3">cout</span> <span class="sy3">&amp;</span>lt<span class="sy4">;</span><span class="sy3">&amp;</span>lt<span class="sy4">;</span> TypeDecryptor<span class="sy4">::</span><span class="me2">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy3">&amp;</span>lt<span class="sy4">;</span><span class="sy3">&amp;</span>lt<span class="sy4">;</span> endl<span class="sy4">;</span>
<span class="co1">// Outputs &quot;pointer to const pointer to const int&quot;</span>
&nbsp;
<span class="kw3">cout</span> <span class="sy3">&amp;</span>lt<span class="sy4">;</span><span class="sy3">&amp;</span>lt<span class="sy4">;</span> TypeDecryptor<span class="sy4">::</span><span class="me2">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy3">&amp;</span>lt<span class="sy4">;</span><span class="sy3">&amp;</span>lt<span class="sy4">;</span> endl<span class="sy4">;</span>
<span class="co1">// Outputs &quot;const pointer to const pointer to int&quot;</span></pre></div></div></div></div></div></div></div>


<p>But this is just getting started. Similar things can be done with function pointers, arrays, references, pointers-to-member, etc. One of the more complex cases is:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1"><span class="kw2">template</span>
<span class="kw2">class</span> TypeDecryptor <span class="br0">&#123;</span>
<span class="kw2">public</span><span class="sy4">:</span>
	<span class="kw4">static</span> string getName<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
		ostringstream output<span class="sy4">;</span>
		output <span class="sy3">&amp;</span>lt<span class="sy4">;</span><span class="sy3">&amp;</span>lt<span class="sy4">;</span> <span class="st0">&quot;pointer to a member function (on type &quot;</span>
			   <span class="sy3">&amp;</span>lt<span class="sy4">;</span><span class="sy3">&amp;</span>lt<span class="sy4">;</span> TypeDecryptor<span class="sy4">::</span><span class="me2">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
			   <span class="sy3">&amp;</span>lt<span class="sy4">;</span><span class="sy3">&amp;</span>lt<span class="sy4">;</span> <span class="st0">&quot;), taking one argument of type &quot;</span>
			   <span class="sy3">&amp;</span>lt<span class="sy4">;</span><span class="sy3">&amp;</span>lt<span class="sy4">;</span> TypeDecryptor<span class="sy4">::</span><span class="me2">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
			   <span class="sy3">&amp;</span>lt<span class="sy4">;</span><span class="sy3">&amp;</span>lt<span class="sy4">;</span> <span class="st0">&quot; and returning &quot;</span>
			   <span class="sy3">&amp;</span>lt<span class="sy4">;</span><span class="sy3">&amp;</span>lt<span class="sy4">;</span> TypeDecryptor<span class="sy4">::</span><span class="me2">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy4">;</span>
		<span class="kw1">return</span> output.<span class="me1">str</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy4">;</span>
	<span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="sy4">;</span></pre></div></div></div></div></div></div></div>


<p>This allows us to deal with pointers-to-member-function with one argument. Annoyingly, you need an explicit specialisation for every different number of function arguments there can be (one for zero-argument functions, one for one-argument functions, etc&#8230;) and also a different specialisation for pointers to data member from pointers to member functions. This means the number of explicit specialisations gets quite large quite quickly.</p>
<p>On the plus side, you don&#8217;t need to know anything about type precedence rules to write this code, nor have to make any decisions about where in the type declaration to start processing. The C++ compiler does all the hard work. Without too much effort I was able to get something that could parse:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1"><span class="kw4">char</span> <span class="br0">&#40;</span>Person<span class="sy4">::</span><span class="sy2">*</span><span class="br0">&#41;</span><span class="br0">&#40;</span><span class="kw4">int</span> <span class="br0">&#40;</span><span class="sy3">&amp;</span>amp<span class="sy4">;</span><span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">42</span><span class="br0">&#93;</span><span class="br0">&#41;</span></pre></div></div></div></div></div></div></div>


<p>into</p>
<blockquote><p>pointer to a member function (on type Person), taking one argument of type reference to array (of size 42) of instances of int and returning char</p></blockquote>
<p class="wp-flattr-button"></p> <p><a href="http://blog.asymptotic.co.uk/?flattrss_redirect&amp;id=606&amp;md5=65e547137752f426004fa43b53aa141b" title="Flattr" target="_blank"><img src="http://blog.asymptotic.co.uk/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.asymptotic.co.uk/2011/02/c-type-declaration-decoder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++ pointer template parameters are weird</title>
		<link>http://blog.asymptotic.co.uk/2011/02/c-pointer-template-parameters-are-weird/</link>
		<comments>http://blog.asymptotic.co.uk/2011/02/c-pointer-template-parameters-are-weird/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 03:06:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.asymptotic.co.uk/?p=597</guid>
		<description><![CDATA[I was browsing through the C++ standard the other day (as you do), and I was surprised to learn that the following are all legal as non-type template parameters:

	integral or enumeration type
	pointer to object or pointer to function
	reference to object or reference to function
	pointer to member

If you've ever done metaprogramming then you'll certainly have ...]]></description>
			<content:encoded><![CDATA[<p>I was browsing through the C++ standard the other day (as you do), and I was surprised to learn that the following are all legal as non-type template parameters:</p>
<ul>
<li>integral or enumeration type</li>
<li>pointer to object or pointer to function</li>
<li>reference to object or reference to function</li>
<li>pointer to member</li>
</ul>
<p>If you&#8217;ve ever done metaprogramming then you&#8217;ll certainly have used integral types as template parameters. And I&#8217;ve already come across pointers to member as template parameters in possibly my gnarliest typedef ever, which for the record was something like:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1"><span class="kw4">typedef</span>
<span class="kw2">template</span><span class="sy1">&lt;</span> <span class="kw2">typename</span> T<span class="sy1">&gt;</span>
boost<span class="sy4">::</span><span class="me2">variant</span><span class="sy1">&lt;</span>T<span class="sy4">::</span><span class="sy2">*</span> <span class="kw4">int</span>, T<span class="sy4">::</span><span class="sy2">*</span> string, T<span class="sy4">::</span><span class="sy2">*</span> <span class="kw4">double</span>, T<span class="sy4">::</span><span class="sy2">*</span> <span class="kw4">bool</span><span class="sy1">&gt;</span>
   any_member<span class="sy4">;</span></pre></div></div></div></div></div></div></div>


<p>You can use this type to refer to any (modulo ramming enough different types in the variant<> list) member on any type at compile time. I had this rigged up into rather a nice compile-time ORM system, where you could define a type and then declare a static instance of</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1">std<span class="sy4">::</span><span class="me2">map</span><span class="sy1">&lt;</span>string, any_member<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> <span class="sy1">&gt;</span></pre></div></div></div></div></div></div></div>


<p>that maps strings to members at compile time. You can then have generic code that pulls data out of a database and then assigns it to instances of a the class. So much of it is done at compile time that it was actually pretty reliable code for something so hairy.</p>
<p>But I digress. The point is, pointers to members act in this context quite a lot like enumerated types: there&#8217;s only a finite (usually very small) number of valid values that is obviously determinable at compile time. Even integral types, in the contexts where they are used, are finite and typically small. Pointers to objects, on the other hand, usually don&#8217;t exist until run time and can take any one of an effectively infinite range of values at run time.</p>
<p>So the declaration</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1"><span class="kw2">template</span><span class="sy1">&lt;</span> <span class="kw4">int</span> <span class="sy2">*</span> Foo <span class="sy1">&gt;</span>
<span class="kw2">class</span> Bar <span class="br0">&#123;</span>
  <span class="kw2">public</span><span class="sy4">:</span>
    <span class="kw4">void</span> doStuff<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
        std<span class="sy4">::</span><span class="kw3">cout</span> <span class="sy1">&lt;&lt;</span> <span class="sy2">*</span>Foo <span class="sy1">&lt;&lt;</span> std<span class="sy4">::</span><span class="me2">endl</span><span class="sy4">;</span>
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span></pre></div></div></div></div></div></div></div>


<p>is perfectly legal. But how can it be used? Remember, each specialisation of <code>Bar</code> is not just a different object but a wholly different class. On the face of it, this might seem to allow creation of types at run time, which is obviously impossible.</p>
<p>It turns out that they&#8217;ve thought of that. When you try to specialise your template it all goes wrong:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1"><span class="kw4">int</span> main<span class="br0">&#40;</span> <span class="kw4">int</span> argc, <span class="kw4">char</span> <span class="sy2">**</span> argv <span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="kw4">int</span> <span class="sy2">*</span> ptr <span class="sy1">=</span> <span class="kw3">new</span> <span class="kw4">int</span><span class="br0">&#40;</span><span class="nu0">42</span><span class="br0">&#41;</span><span class="sy4">;</span>
    Bar<span class="sy1">&lt;</span>ptr<span class="sy1">&gt;</span> myObj<span class="sy4">;</span>
<span class="br0">&#125;</span></pre></div></div></div></div></div></div></div>


<p>This is rejected by g++ with:</p>
<pre>
error: 'ptr' is not a valid template argument of type 'int*' because 'ptr' is a variable, not the address of a variable
</pre>
<p>Full marks to g++ for a good error message here. This immediately prevents the possibility that we can generate an unlimited number of types at run time, since we have only a finite number of variables defined in our program, fixed at compile time. But what about the address of a stack variable? Taking the address of the stack variable doesn&#8217;t return a value fixed at compile time, because it depends how deep we are in the stack when we do it:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1"><span class="kw4">void</span> confuseTheCompiler<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="kw4">int</span> someVar<span class="sy4">;</span>
    Bar<span class="sy1">&lt;</span> <span class="sy3">&amp;</span>someVar <span class="sy1">&gt;</span> myObject<span class="sy4">;</span>
<span class="br0">&#125;</span></pre></div></div></div></div></div></div></div>


<p>Fortunately, they&#8217;ve thought of this as well:</p>
<pre>
error: '&#038; someVar' is not a valid template argument of type 'int*' because 'someVar' does not have external linkage
</pre>
<p>This is made explicit, as you would expect, in the C++ standard. It&#8217;s in 14.3.2 clause 1:</p>
<blockquote><p>
A template-argument for a non-type, non-template template-parameter shall be one of:</p>
<ul>
<li>an integral constant-expression of integral or enumeration type; or</li>
<li>the name of a non-type template-parameter; or</li>
<li>the address of an object or function with external linkage, including function templates and function<br />
template-ids but excluding non-static class members, expressed as &#038; id-expression where the &#038; is<br />
optional if the name refers to a function or array, or if the corresponding template-parameter is a reference;<br />
or</li>
<li>a pointer to member expressed as described in 5.3.1</li>
</blockquote>
<p>So if we restrict ourselves to variables with external linkage then we&#8217;re back to the case where we have a fixed number of possible values at compile time, and everything in the garden is lovely.</p>
<p>I&#8217;m not sure if this would ever be useful. I came up with this toy example:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1"><span class="co2">#include &lt;iostream&gt;</span>
<span class="co2">#include &lt;string&gt;</span>
&nbsp;
<span class="kw2">using</span> <span class="kw2">namespace</span> std<span class="sy4">;</span>
&nbsp;
<span class="kw2">template</span><span class="sy1">&lt;</span> <span class="kw4">int</span> <span class="sy2">*</span> foo <span class="sy1">&gt;</span>
<span class="kw2">class</span> VariableNamer <span class="br0">&#123;</span>
<span class="kw2">public</span><span class="sy4">:</span>
	<span class="kw4">static</span> string name<span class="sy4">;</span>
<span class="br0">&#125;</span><span class="sy4">;</span>
&nbsp;
<span class="kw4">extern</span> <span class="kw4">int</span> baz<span class="sy4">;</span>
&nbsp;
<span class="kw4">int</span> baz <span class="sy1">=</span> <span class="nu0">42</span><span class="sy4">;</span>
&nbsp;
<span class="kw2">template</span><span class="sy1">&lt;&gt;</span>
string VariableNamer<span class="sy1">&lt;</span> <span class="sy3">&amp;</span>baz <span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">name</span> <span class="sy1">=</span> <span class="st0">&quot;baz&quot;</span><span class="sy4">;</span>
&nbsp;
<span class="kw4">int</span> main<span class="br0">&#40;</span> <span class="kw4">int</span> argc, <span class="kw4">char</span> <span class="sy2">**</span> argv <span class="br0">&#41;</span> <span class="br0">&#123;</span>
	<span class="kw3">cout</span> <span class="sy1">&lt;&lt;</span> VariableNamer<span class="sy1">&lt;</span><span class="sy3">&amp;</span>baz<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">name</span> <span class="sy1">&lt;&lt;</span> endl<span class="sy4">;</span>
<span class="br0">&#125;</span></pre></div></div></div></div></div></div></div>


<p>It enables you to associate one and only one name with a variable that has external linkage, at compile time. If you forget to assign a name for the variable you&#8217;ll get a compile-time error, which I suppose makes it better than having a global</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="cpp"><pre class="de1">std<span class="sy4">::</span><span class="me2">map</span><span class="sy1">&lt;</span> <span class="kw4">int</span> <span class="sy2">*</span>, std<span class="sy4">::</span><span class="me2">string</span><span class="sy1">&gt;</span> variable_names<span class="sy4">;</span></pre></div></div></div></div></div></div></div>


<p>I&#8217;m sure with a little extra finesse it could be modified to assign a name to any type of variable, not just ints.</p>
<p class="wp-flattr-button"></p> <p><a href="http://blog.asymptotic.co.uk/?flattrss_redirect&amp;id=597&amp;md5=09fb94c47321c2680e083592c049902a" title="Flattr" target="_blank"><img src="http://blog.asymptotic.co.uk/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.asymptotic.co.uk/2011/02/c-pointer-template-parameters-are-weird/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>No, my password is not too weak</title>
		<link>http://blog.asymptotic.co.uk/2010/09/no-my-password-is-not-too-weak/</link>
		<comments>http://blog.asymptotic.co.uk/2010/09/no-my-password-is-not-too-weak/#comments</comments>
		<pubDate>Sun, 12 Sep 2010 14:54:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://blog.asymptotic.co.uk/?p=533</guid>
		<description><![CDATA[First of all, I must confess: despite dire warnings to the contrary, I use the same password for more than one web login. But I'm sure everyone does, simply because so many sites require logins that having a different password for each site will be less secure by virtue of needing to be written ...]]></description>
			<content:encoded><![CDATA[<p>First of all, I must confess: despite dire warnings to the contrary, I use the same password for more than one web login. But I&#8217;m sure everyone does, simply because so many sites require logins that having a different password for each site will be less secure by virtue of needing to be written down or otherwise stored in plaintext. And really, the consequences of getting an account hacked (and the benefits to any prospective hacker) are so low that it isn&#8217;t worth bothering. So a hacker can tweak my Delicious bookmarks, or see my bit.ly statistics, or whatever. Big deal.</p>
<p>Even worse, my password for such low-value sites is a dictionary word. Admittedly it&#8217;s a dictionary word chosen at random from the <a href="http://en.wikipedia.org/wiki/Shorter_Oxford_English_Dictionary">Shorter OED</a>, which gives a theoretical 500,000 possibilities. Even if we suppose I ignored overly short words and didn&#8217;t choose entirely at random, the odds of someone guessing it have to be one in 200,000 or longer.</p>
<p>This seems reasonable to me, but plenty of sites aren&#8217;t having it. As far as they are concerned, protecting me from the consequences of bad password choice is their problem, not mine, and the way to do that is to ensure that my password has at least one digit in it. Or at least four digits. Or maybe a non-printable character. Or at least 2 capital letters. They don&#8217;t seem to be able to make their minds up.</p>
<p>So I just do what everyone else does in these circumstances: I use the same password, and make minimal tweaks to satisfy the algorithm. I capitalise the first letter. Or I add a standard number on the end of it (hey hackers, I&#8217;ll tell you this for free: I always use the number 12).</p>
<p>Security is always a tradeoff with usability, and the tradeoff here is terrible. Users will always use one of a tiny number of tricks (appending 123, using l33t-sp3ak, etc.) that make minimal increase to the search space. Hackers aren&#8217;t greatly inconvenienced, but the user has to remember exactly what set of requirements they were trying to satisfy when they created their password. Here&#8217;s a hint to designers: if I find myself having to think hard about what combination of capitalisation and numbering I used when I signed up, and I don&#8217;t <em>really</em> like your site, then I just won&#8217;t bother logging in again.</p>
<p>But the really dumb thing is that this is defending against the wrong problem. Passwords aren&#8217;t typically compromised by brute-force attacks across a large search space, they&#8217;re compromised by being human-understandable and relevant to the person that created them (personal names, dates, etc.) Checking the password against common human names and date formats (e.g. 19xx) would be more effective.</p>
<p>And if you&#8217;re worried that the web application you&#8217;re writing will be subject to brute-force attacks, then it&#8217;s  easy to defend: limit the rate of queries to human speeds (no more than 5 incorrect passwords per IP address per day) and use CAPTCHAs. Detect suspicious patterns of activity and take action (block the IP address, warn the user being targetted, whatever). Properly implemented, even brute-forcing a mother&#8217;s maiden name or a birthday (requiring just a couple of hundred attempts) becomes an uninviting task, particularly when the reward for success is non-monetary.</p>
<p>So why do programmers do this? It&#8217;s like the old joke about the drunk who dropped his keys in a dark street and resolved to look for them under a street lamp since the light was better there. Adding rate-limiting isn&#8217;t that hard, but it&#8217;s orders of magnitude hader than writing a regexp to ensure the password has two digits in it. Even if this doesn&#8217;t solve the problem, it gives the impression that we&#8217;re making an effort.</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://blog.asymptotic.co.uk/2010/09/no-my-password-is-not-too-weak/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is the rockstar programmer dead?</title>
		<link>http://blog.asymptotic.co.uk/2010/09/is-the-rockstar-programmer-dead/</link>
		<comments>http://blog.asymptotic.co.uk/2010/09/is-the-rockstar-programmer-dead/#comments</comments>
		<pubDate>Fri, 10 Sep 2010 08:28:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.asymptotic.co.uk/?p=523</guid>
		<description><![CDATA[What is it with technology? We can put men on the moon, but we can't create an airport baggage system that doesn't foul up. Or a word processor that doesn't crash. Or a web application with a consistent user interface.

One explanation could be that there are actually two sources of difficulty in most human ...]]></description>
			<content:encoded><![CDATA[<p>What is it with technology? We can put men on the moon, but we can&#8217;t create an airport baggage system that doesn&#8217;t foul up. Or a word processor that doesn&#8217;t crash. Or a web application with a consistent user interface.</p>
<p>One explanation could be that there are actually two sources of difficulty in most human endeavours: <em>necessary</em> difficulties, where a task is at the limit of or beyond a person&#8217;s capability, and <em>accidental</em> difficulties, where a task is perfectly achievable but we are open to simple human errors. Though the progress of technology, training and specialisation has raised the absolute limits of what is achievable in most disciplines, human error remains stubbornly as a fact of life and little has been done to ameliorate it.</p>
<p><a href="http://www.amazon.co.uk/gp/product/1846683130?ie=UTF8&amp;tag=reviewtfm-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=1846683130&quot;&gt;The Checklist Manifesto: How To Get Things Right&lt;/a&gt;&lt;img src=" rel="nofollow"><img class="alignright size-full wp-image-524" title="The Checklist Manifesto" src="http://blog.asymptotic.co.uk/wp-content/uploads/2010/09/41iDm1wKz+L._SL160_.jpg" alt="Front cover of The Checklist Manifesto" width="101" height="160" /></a>This is an idea that is explored at length in <a href="http://www.amazon.co.uk/gp/product/1846683130?ie=UTF8&amp;tag=reviewtfm-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=1846683130&quot;&gt;The Checklist Manifesto: How To Get Things Right&lt;/a&gt;&lt;img src=" rel="nofollow">The Checklist Manifesto</a>. The author, Atul Gawande, is a surgeon who became suspicious of the number of failures that were happening in surgery that are attributable to human error, often at the cost of grievous injury and death. It would be funny if it wasn&#8217;t tragic, that no amount of training (and surgeons are extraordinarily well-trained) is enough to stop a surgeon cutting off the wrong limb, or forgetting to administer vital drugs.</p>
<p>Gawande pioneered a remarkably simple solution to this in the form of a pre-surgery checklist. The evidence is that this reduces complications by double-digit percentages. The main problem in implementing it seems to be in persuading alpha-male surgeons to admit that they are fallible, and that something as simple as a 30-second checklist can make a difference.</p>
<p>It&#8217;s not just surgery either. Gawande gives examples of checklists being successfully applied to contain human error in other fields such as finance and, of course, air flight. As a software developer, the following commentary caught my eye:</p>
<blockquote><p>Tom Wolfe&#8217;s <em><a href="http://www.amazon.co.uk/gp/product/0099479370?ie=UTF8&amp;tag=reviewtfm-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0099479370" rel="nofollow">The Right Stuff</a> </em>tells the story of our first astronauts and charts the demise of the maverick, Chuck Yeager test pilot culture of the 1950s. It was a culture defined by how unbelievably dangerous the job was. Test pilots strapped themselves into machines of barely controlled power and complexity, and a quarter of them were killed on the job. The pilots had to have focus, daring, wits, and an ability to improvise—the right stuff. But as knowledge of how to control the risks of flying accumulated—as checklists and flight simulators became more prevalent and sophisticated—the danger diminished, values of safety and conscientiousness prevailed, and the rock star status of the test pilots was gone.</p></blockquote>
<p>As a discipline, software is remarkable for the speed at which it has developed from being on the bleeding edge of research to being an integrated part of our lives, and this is something that the well-worn analogies between software engineering and civil engineering inevitably fail to model.  I&#8217;ve often wondered whether this rapid growth, and the small number of generations between the bleeding edge and the current state of the art have distorted our view of what good software engineering should be. This is an idea explored in more detail, and specifically about software, in <a href="&quot;http://www.amazon.co.uk/gp/product/0672326140?ie=UTF8&amp;tag=reviewtfm-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0672326140" rel="nofollow">The Inmates are Running the Asylum</a>, a book I encourage all developers to read.</p>
<p>So, how applicable are the solutions in <em>The Checklist Manifesto</em> to software development? That&#8217;s where it gets difficult. Much as I&#8217;d like to see the discipline mature, the opportunities for checklists <em>per se</em> are small. There are certainly opportunities to ensure best practices in things like code reviews, merging to release branches or building installers. But ideally any purely repetitive task should be automated anyway, and this covers a lot of ground: software development differs from surgery in that while surgery only <em>looks </em>repetitive, software behaviour genuinely is deterministic. Automated tests, continuous integration and 1-click installer builds are probably the closest thing we have to the surgery checklist, and they are already best practices (though like the surgery checklist, often ignored by alpha males who think <em>they</em> know better).</p>
<p>I&#8217;m going to continue investigating the checklist idea and see whether I can integrate any of the spirit of it into my work; I&#8217;ll update here if I have any noteworthy progress. But it would be remiss of me not to emphasise one very important point: this isn&#8217;t about taking away the creativity of the job, it&#8217;s about minimising the cognitive load of routine tasks so that tasks requiring creativity and judgment can be given <em>more</em> effort, not less. There is an art to writing a good checklist, and much of it is in minimising the checklist to give it maximum impact with minimal weight.</p>
<p>If software engineering could become more like flying, perhaps it would be no bad thing. Being a pilot is still a highly technical job that requires great experience and commands great respect. The skill of the pilot is indispensible when something unexpected happens, but that doesn&#8217;t mean they carry out routine takeoffs and landings by the seat of their pants.</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 126px; width: 1px; height: 1px; overflow: hidden;">http://www.amazon.co.uk/gp/product/1846683130?ie=UTF8&amp;tag=reviewtfm-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=1846683130&#8243;&gt;The Checklist Manifesto: How To Get Things Right&lt;/a&gt;&lt;img src=&#8221;http://www.assoc-amazon.co.uk/e/ir?t=reviewtfm-21&amp;l=as2&amp;o=2&amp;a=1846683130</div>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://blog.asymptotic.co.uk/2010/09/is-the-rockstar-programmer-dead/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A nice take on the apples-and-oranges puzzle</title>
		<link>http://blog.asymptotic.co.uk/2010/07/a-nice-take-on-the-apples-and-oranges-puzzle/</link>
		<comments>http://blog.asymptotic.co.uk/2010/07/a-nice-take-on-the-apples-and-oranges-puzzle/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 12:10:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[hiring]]></category>

		<guid isPermaLink="false">http://blog.asymptotic.co.uk/?p=505</guid>
		<description><![CDATA[Richard Wiseman has a nice retelling of the apples-and-oranges puzzle (which incidentally was a regular interview question at a company I used to work for):
Yesterday I saw a drinks machine that had three selections – Tea, Coffee  or Random (Tea or Coffee).  However, the machine was wired up wrongly  so that each ...]]></description>
			<content:encoded><![CDATA[<p>Richard Wiseman has <a href="http://richardwiseman.wordpress.com/2010/07/30/its-the-friday-puzzle-70/">a nice retelling of the apples-and-oranges puzzle</a> (which incidentally was a regular interview question at a company I used to work for):</p>
<blockquote><p>Yesterday I saw a drinks machine that had three selections – Tea, Coffee  or Random (Tea or Coffee).  However, the machine was wired up wrongly  so that each button does not give what it claims. If each drink costs  50p, what is the minimum that you have to put into the machine to work  out which button gives which selection?</p></blockquote>
<p>What I like about this is that it makes more natural several of the constraints of the original puzzle (a crate of apples, a crate of oranges, and a mixed crate):</p>
<ul>
<li>Why can&#8217;t I just peer into the crate and look at the contents?</li>
<li>Why only draw one fruit at a time?</li>
<li>Why do I care how many fruits I have to sample?</li>
</ul>
<p>It also makes more sense of the effectively-unlimited supply of fruit that is implied by the question: if it&#8217;s the <em>wiring</em> that&#8217;s at fault and not the hopper of tea / coffee, you could refill it as many times as you want without affecting the wiring.</p>
<p>The puzzle, of course, hinges on the listener not paying attention to the crucial fact: the wiring for each button (or the labelling on each crate) is <em>known</em> to be wrong, not just <em>unknown</em>. It&#8217;s one of the neat things about this puzzle that an intelligent solver may well mishear it, but can easily prove it&#8217;s impossible if the wiring is entirely unknown. In point of fact, it&#8217;s a fairly simple to show that if it is possible, then the answer must be one: we can&#8217;t necessarily distinguish a random stream from a constant stream with any number of samples. Constructing a proof that one sample will suffice is fairly easy, given that there are only three possibilities of which to sample, and by symmetricity only two possibilities that differ.</p>
<p>Does this make a good interview question for a software developer? I&#8217;m not at all convinced it does. It feels like a meta-puzzle: you reason through it by knowing the implicit rules of the game of puzzle-writing (one obvious one being that the answer can&#8217;t be impossible, and it can&#8217;t rely on luck or &#8220;good enough&#8221; solutions like 1000 random samples). Good software engineering often involves judgment calls where such rules don&#8217;t exist, and great software engineering often involves rethinking the rules of the game entirely.</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://blog.asymptotic.co.uk/2010/07/a-nice-take-on-the-apples-and-oranges-puzzle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: blog.asymptotic.co.uk @ 2012-02-05 10:05:55 by W3 Total Cache -->
