<?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>biotext.org.uk &#187; Rants</title>
	<atom:link href="http://biotext.org.uk/category/rants/feed/" rel="self" type="application/rss+xml" />
	<link>http://biotext.org.uk</link>
	<description>Not a typewriter</description>
	<lastBuildDate>Mon, 06 Sep 2010 12:44:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>On the importance of testing in research software</title>
		<link>http://biotext.org.uk/on-the-importance-of-testing-in-research-software/</link>
		<comments>http://biotext.org.uk/on-the-importance-of-testing-in-research-software/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 13:44:22 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[bioinformatics]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=195</guid>
		<description><![CDATA[Michael Barton at Bioinformatics Zen recently posted an interesting article entitled &#8220;why write good software&#8220;. He makes an important point, but I think he underplays the importance of testing somewhat.
I used to code (as a lot of bioinformatics people do) like this: write a huge pile of code, run it, see if it works. If [...]]]></description>
			<content:encoded><![CDATA[<p>Michael Barton at Bioinformatics Zen recently posted an interesting article entitled &#8220;<a href="http://www.bioinformaticszen.com/software/why_write_good_software">why write good software</a>&#8220;. He makes an important point, but I think he underplays the importance of testing somewhat.</p>
<p>I used to code (as a lot of bioinformatics people do) like this: write a huge pile of code, run it, see if it works. If it crashes, spend hours debugging. If not, see if the results look &#8216;kinda right&#8217;. Now obviously unit testing reduces (almost eliminates) those tedious hours of debugging, but more importantly, it also gives you some assurance that the results you&#8217;ve submitted for publication are <strong>more likely to be correct</strong>.</p>
<p>I&#8217;ve suffered the embarrassment of publishing a paper with incorrect scores in (thankfully only half a percent) due to a bug not even in my algorithm itself but in the scoring routines I&#8217;d written to benchmark it. If I&#8217;d grokked unit testing at that point, this probably wouldn&#8217;t have happened. Who knows how many published papers do have incorrect scores in them because of undiscovered bugs in the code &#8212; little things like off-by-one errors or rounding errors that you wouldn&#8217;t even notice, if inspecting the output of an algorithm by eye.</p>
<p>Michael says that &#8220;statistical tests for significance outweigh software testing for reliability&#8221; in the eyes of bioinformaticians, but there are important parallels, and one of the parallels is that coding bugs can subtlely shaft your results just as surely as arithmetic errors or picking the wrong statistical test. Fortunately in software development, there are automated ways to catch such bugs before you publish, and to make sure that any changes you make later don&#8217;t introduce new ones. Test, test, test some more.</p>
<p>Andrew.</p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/on-the-importance-of-testing-in-research-software/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What&#8217;s wrong with peer review</title>
		<link>http://biotext.org.uk/whats-wrong-with-peer-review/</link>
		<comments>http://biotext.org.uk/whats-wrong-with-peer-review/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 12:21:26 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[peer_review]]></category>
		<category><![CDATA[publishing]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=117</guid>
		<description><![CDATA[Michael Nielsen has posted a longish article entitled &#8220;Three myths about scientific peer review&#8221;. It&#8217;s thought-provoking reading and will strike a chord with most researchers. He uses various examples from 20th-century science and before to question our assumptions about how the system works (and how well). There&#8217;s apparently a follow-up about the future of peer [...]]]></description>
			<content:encoded><![CDATA[<p>Michael Nielsen has posted a longish article entitled <a href="http://michaelnielsen.org/blog/?p=531">&#8220;Three myths about scientific peer review&#8221;</a>. It&#8217;s thought-provoking reading and will strike a chord with most researchers. He uses various examples from 20th-century science and before to question our assumptions about how the system works (and how well). There&#8217;s apparently a follow-up about the future of peer review, and a book, on the way.</p>
<p>Interestingly, many scientists will be happy to use the rigourous nature of peer review to defend science against its critics, or to demarcate &#8216;real&#8217; science from its fringe elements and impersonators, yet almost all will also have stories of the peer review system letting them down, or not being all it&#8217;s cracked up to be.¹ Perhaps it&#8217;s like adversarial party democracy &#8212; the least bad of all the current alternatives.</p>
<p>Andrew.</p>
<p>¹ N.B. I have no figures whatsoever to back up these claims.</p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/whats-wrong-with-peer-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SOAP vs REST &#8212; a common misconception?</title>
		<link>http://biotext.org.uk/soap-vs-rest-a-common-misconception/</link>
		<comments>http://biotext.org.uk/soap-vs-rest-a-common-misconception/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 14:38:02 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[webservices]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=85</guid>
		<description><![CDATA[Update (1-Nov-09): Since writing this post nearly a year ago, I&#8217;ve come to realise that I was labouring under quite a few misconceptions myself, about REST. Spotting them all is left as an exercise for the reader. But I&#8217;d rather leave it here with this caveat, than remove it and pretend I knew better all [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update (1-Nov-09): Since writing this post nearly a year ago, I&#8217;ve come to realise that I was labouring under quite a few misconceptions myself, about REST. Spotting them all is left as an exercise for the reader. But I&#8217;d rather leave it here with this caveat, than remove it and pretend I knew better all along&#8230;</strong></p>
<p>Michael Little at Fliquid Studios recently posted <a href="http://www.fliquidstudios.com/2008/12/17/soap_vs_rest_api/">an interesting comparison of SOAP vs REST</a> which may have accidentally perpetuated a misconception about SOAP that I believe is fairly common. This post is a response to that and a expanded version of a comment I left on Michael&#8217;s site.</p>
<p>The confusion arises from the difference between the communication layer (SOAP) and the databinding layer (aka marshalling/unmarshalling) which is responsible for mediating between language-native data structures and XML. Michael is writing from a PHP point of view, and I&#8217;m not sure what PHP SOAP toolkits are like in this regard, but fortunately in the Java world the distinction between the two is made clear, and we have various options for each &#8212; although JAX-WS for SOAP and JAXB for databinding are the <a href="http://java.sun.com/webservices/technologies/index.jsp">industry standard specifications</a>.</p>
<p><span id="more-85"></span></p>
<p>For example, Michael says:</p>
<blockquote><p>&#8230; the way the PHP SoapServer class handles arrays of data is (or was last time I checked) incompatible with the way an ASP.NET SOAP client handles them&#8230;</p></blockquote>
<p>While this may well be true, it&#8217;s also somewhat tangential to a general discussion of the differences between SOAP and REST, and seems to chime with a sentiment I&#8217;ve detected elsewhere that REST is easier because it&#8217;s &#8216;just XML&#8217; &#8212; or whatever other method for structuring the data you choose to use instead. The translation of XML data into arrays is the responsibility of the databinding layer, and nothing to do with SOAP <em>per se</em>. Incompatibilities between different approaches to marshalling and unmarshalling would also be an issue if one wanted to use a databinding layer over REST.</p>
<p>Databinding is not part of the SOAP spec. At their heart, SOAP messages are also just XML documents, exactly like REST, and there&#8217;s always the option of parsing the XML yourself, exactly as you would with REST. We do this extensively in the <a href="http://funcnet.eu/">FuncNet</a> project, for performance reasons. It can also be useful, as Michael&#8217;s article indirectly suggests, for sidestepping compatibility issues &#8212; because every language can read/write XML.</p>
<p>You can even use SOAP to send/receive arbitrary non-XML data, e.g. via attachments or CDATA or large strings&#8230; e.g. plain text, JSON etc. <a href="http://soaplab.sourceforge.net/soaplab2/">Soaplab2</a> for example sends the results of SOAP-wrapped programs as-is, as large chunks of text.</p>
<p>Michael replied to me that his article &#8220;is intended to be related to the practical implementation of SOAP/REST in PHP&#8221;, but I thought it worth expanding on this point nonetheless, as he does also mention at the start that the content is hopefully useful to developers of other languages. Any decent SOAP service toolkit should give you the option to receive the whole request as XML, and/or generate raw XML for the response yourself. The same is true (in reverse obviously) for SOAP clients. These features are something worth checking for before committing to one stack or another, where a &#8217;stack&#8217; includes not just the SOAP libraries themselves but the language and environment that they&#8217;re built on. Tight coupling between a communication layer and a databinding layer isn&#8217;t a good sign and might, as Michael&#8217;s note about of SoapServer shows, reduce your interoperability options.</p>
<p>So if you are developing services that parse and generate XML directly, what advantage is there to using SOAP and WSDL over the simpler REST approach? Well, many SOAP/WSDL features are unrelated to databinding, for example mature tool support, schema validation, formally-defined contracts with documentation right down to the level of individual parameters, automatic service discovery via registries, and semantic annotation with extensions like SAWSDL. But more importantly, just because you may not be using databinding on the server side, doesn&#8217;t mean your consumers can&#8217;t.</p>
<p>Of course there are benefits to REST too, primarily ease of development, simplicity and elegance, and lower overhead &#8212; important if you&#8217;re sending/receiving lots of small messages. And there&#8217;s nothing to stop you using databinding technology to marshal or unmarshal REST messages too. It&#8217;s important to remember REST and SOAP are both essentially protocols for sending and/or receiving documents, and in that sense, they aren&#8217;t really all that different.</p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/soap-vs-rest-a-common-misconception/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>What&#8217;s wrong with Hibernate, #4</title>
		<link>http://biotext.org.uk/whats-wrong-with-hibernate-4/</link>
		<comments>http://biotext.org.uk/whats-wrong-with-hibernate-4/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 16:04:23 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=25</guid>
		<description><![CDATA[Hibernate is supposed to allow you to write queries and manipulate data in the normal Java idiom. Which is true up to a point, and that point is almost five years in the past, when Java introduced generics.
Generics are absolutely standard practice in Java these days, and have been for two (nearly three) versions. But [...]]]></description>
			<content:encoded><![CDATA[<p>Hibernate is supposed to allow you to write queries and manipulate data in the normal Java idiom. Which is true up to a point, and that point is almost five years in the past, <a title="Understanding generics" href="http://www.javaworld.com/javaworld/jw-06-2004/jw-0607-tiger2.html">when Java introduced generics</a>.</p>
<p>Generics are <em>absolutely</em> standard practice in Java these days, and have been for two (nearly three) versions. But Hibernate still doesn&#8217;t support them, despite lead developer Gavin King <a title="The Scope of Hibernate Three" href="http://blog.hibernate.org/1524.lace">saying at the time</a>:</p>
<blockquote><p>We will also need to support Java generics, which basically boils down to allowing typesafe collections (which is very trivial).</p></blockquote>
<p>Nearly five years later, this still hasn&#8217;t happened, and you still need to manually cast the results of queries and liberally add <code>@SuppressWarnings("unchecked")</code> to demonstrate that you&#8217;re aware you&#8217;re doing things <em>a bit wrong</em>.</p>
<p>Andrew.</p>
<p>There are <a title="Other Hibernate posts" href="/?tag=hibernate">several other posts</a> in this series. Please read the <a title="Disclaimer" href="/index.php/whats-wrong-with-hibernate-1/">disclaimer</a> before you write an angry reply.</p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/whats-wrong-with-hibernate-4/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>What’s wrong with Hibernate, #3</title>
		<link>http://biotext.org.uk/whats-wrong-with-hibernate-3/</link>
		<comments>http://biotext.org.uk/whats-wrong-with-hibernate-3/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 11:00:16 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=20</guid>
		<description><![CDATA[Unfortunately, open-source projects above a certain size seem to become victims of their own success.
Many other excellent OSS products like Guice or CXF have user-centred mailing lists that the developers also read. These developers are generally very willing to help out with problems, and the users &#8212; having been treated kindly when they started out [...]]]></description>
			<content:encoded><![CDATA[<p>Unfortunately, open-source projects above a certain size seem to become victims of their own success.</p>
<p>Many other excellent OSS products like <a title="Google Guice" href="http://code.google.com/p/google-guice/">Guice</a> or <a title="Apache CXF" href="http://cxf.apache.org/">CXF</a> have user-centred mailing lists that the developers also read. These developers are generally very willing to help out with problems, and the users &#8212; having been treated kindly when they started out &#8212; are equally keen to help with the areas that they have experience of.</p>
<p>Hibernate has no user mailing list, just a large forum site that&#8217;s easy to ignore. Mailing lists encourage people to respond because queries drop in their inboxes; forums tend to be visited in times of need, and people are probably less likely to drop by for philanthropic reasons.</p>
<p>As an example, I&#8217;ve posted <a title="Hibernate Forums" href="http://forum.hibernate.org/search.php?search_author=andrewclegg&amp;mode=results">three queries (plus one repost and various followups)</a> in the Hibernate forums over the course of a month, politely and with plenty of information. Despite hundreds of views, and the fact that two of them highlight features which don&#8217;t work as described, not a single reply from anyone else has been forthcoming. Not even a one-liner saying &#8220;bad question, RTFM&#8221; or &#8220;working as designed&#8221; or &#8220;known bug&#8221;.</p>
<p>Maybe this is sour grapes, but the amount of community feedback from other OSS projects puts this to shame.</p>
<p>Andrew.</p>
<p>There are <a title="Other Hibernate posts" href="/?tag=hibernate">several other posts</a> in this series. Please read the <a title="Disclaimer" href="/index.php/whats-wrong-with-hibernate-1/">disclaimer</a> before you write an angry reply.</p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/whats-wrong-with-hibernate-3/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>What&#8217;s wrong with Hibernate, #2</title>
		<link>http://biotext.org.uk/whats-wrong-with-hibernate-2/</link>
		<comments>http://biotext.org.uk/whats-wrong-with-hibernate-2/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 18:25:05 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=5</guid>
		<description><![CDATA[On the Hibernate website (and elsewhere), one of the touted advantages of Hibernate over roll-your-own SQL is:
Hibernate Core for Java generates SQL for you, relieves you from manual JDBC result set handling and object conversion, and keeps your application portable to all SQL databases.
Well, not exactly. Many functions in HQL (Hibernate Query Language) are simply [...]]]></description>
			<content:encoded><![CDATA[<p>On the <a title="Hibernate Core" href="http://hibernate.org/344.html">Hibernate website</a> (and elsewhere), one of the touted advantages of Hibernate over roll-your-own SQL is:</p>
<blockquote><p>Hibernate Core for Java generates SQL for you, relieves you from manual JDBC result set handling and object conversion, and keeps your application portable to all SQL databases.</p></blockquote>
<p>Well, not exactly. Many functions in HQL (Hibernate Query Language) are simply passed through verbatim to the underlying database engine, without any modification.</p>
<p>This is normally fine, but on my first ever HQL query I tried to use a natural-logarithms function &#8212; which is log() in HSQLDB (my testing server) and ln() in PostgreSQL (my production server). Which means that queries written to target the production environment fail with a charming <code>NullPointerException</code> in the test environment. Half a day&#8217;s debugging, right there.</p>
<p>More worryingly, imagine if I had innocently written the query using log(). All my tests would have passed. Then I would have deployed the application to the production environment, and it would still have worked, but <strong>all the queries would have happily returned the wrong answers</strong> &#8212; because log() in PostgreSQL means base-10 logarithms.</p>
<p>Hibernate not only fails to insulate you from dialect differences like these, it also introduces a false sense of safety by pretending that it does.</p>
<p>Andrew.</p>
<p>There are <a title="Other Hibernate posts" href="/?tag=hibernate">several other posts</a> in this series. Please read the <a title="Disclaimer" href="/index.php/whats-wrong-with-hibernate-1/">disclaimer</a> before you write an angry reply.</p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/whats-wrong-with-hibernate-2/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>What&#8217;s wrong with Hibernate, #1</title>
		<link>http://biotext.org.uk/whats-wrong-with-hibernate-1/</link>
		<comments>http://biotext.org.uk/whats-wrong-with-hibernate-1/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 20:25:57 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=53</guid>
		<description><![CDATA[The first in a series of missives on the subject of Hibernate.
Disclaimer: I&#8217;m not out to bash Hibernate, nor do I fundamentally dislike it. In fact I think it&#8217;s an impressive piece of work, which is why I&#8217;m bothering to highlight some of its pitfalls, in the hope that this saves other people the hassles [...]]]></description>
			<content:encoded><![CDATA[<p>The first in a series of missives on the subject of <a title="Hibernate" href="http://hibernate.org/">Hibernate</a>.</p>
<p><em>Disclaimer: I&#8217;m not out to bash Hibernate, nor do I fundamentally dislike it. In fact I think it&#8217;s an impressive piece of work, which is why I&#8217;m bothering to highlight some of its pitfalls, in the hope that this saves other people the hassles I went through, and perhaps gives its maintainers something to think about. If I didn&#8217;t think it was worth investing the time to do this, I&#8217;d just drop it and move on.</em></p>
<p>When there&#8217;s a problem with an HQL query, all the exception says is:</p>
<p>&#8220;Errors in named queries:&#8221; and then the query name.</p>
<p>Gee, thanks. Even &#8216;1970s technology&#8217; RDBMSs give more specific error reports than that. By quite a long way.</p>
<p>Actually, you only get this error if you&#8217;re lucky &#8212; if you&#8217;re unlucky you get something <a title=" Reasons why Hibernate sucks, #2" href="http://biotext.org.uk/?p=5">even less helpful</a>.</p>
<p>Oh, and reason #1a:</p>
<p>An error in a query will often cause <em>all</em> your tests to fail. Not just ones that use that query.</p>
<p>Andrew.</p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/whats-wrong-with-hibernate-1/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
