<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Perl And Type Checking</title>
	<atom:link href="http://curiousprogrammer.wordpress.com/2010/10/20/perl-and-type-checking/feed/" rel="self" type="application/rss+xml" />
	<link>http://curiousprogrammer.wordpress.com/2010/10/20/perl-and-type-checking/</link>
	<description>Leveraging Perl and Emacs</description>
	<lastBuildDate>Tue, 07 May 2013 11:25:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Jared</title>
		<link>http://curiousprogrammer.wordpress.com/2010/10/20/perl-and-type-checking/#comment-8430</link>
		<dc:creator><![CDATA[Jared]]></dc:creator>
		<pubDate>Wed, 20 Oct 2010 20:26:54 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=1325#comment-8430</guid>
		<description><![CDATA[@Roman - a couple of points on your points... firstly, I agree with you that modules used by more people (usually more generic modules), in general should have better argument checking.

Secondly, often if I pass the wrong time of argument into a function, it gets picked up when I try to use it.  For example, if I call prepare on an argument that isn&#039;t a database handle, I get a fatal error at that line.  As my functions are usually pretty small, I can immediately see what I&#039;ve done wrong without an additional sanity check on the argument list.

@Dave - Hmmm... this kind of typeful programming is available even to mainstream languages like Java and C++.  It isn&#039;t the preserve of the Haskell-using elite.

And sanitising an age argument to ensure it is a positive number is hardly defensive.  It doesn&#039;t protect against argument inversion if I&#039;m passing a couple of non-numbers, one of which isn&#039;t an age.  But wouldn&#039;t it have been great if Ada had won and we could easily specify restricted subtypes of primitives that were checked by the compiler?

@Michael - I&#039;m not sure whether you&#039;re agreeing with me or not.  My point is not that you shouldn&#039;t sanitise arguments (whether that be in the defensive way I&#039;ve illustrated here, or the soft way that Dave advocates above).  I don&#039;t really care how you code.  What I do care about is when people say stuff like if you don&#039;t sanitise your arguments, I don&#039;t want to work with you.

Having said that, if you are specifying all your types precisely as I&#039;ve indicated here, why wouldn&#039;t you use Java and get greater speed, better tools, and in general support from the compiler for this style of programming?]]></description>
		<content:encoded><![CDATA[<p>@Roman &#8211; a couple of points on your points&#8230; firstly, I agree with you that modules used by more people (usually more generic modules), in general should have better argument checking.</p>
<p>Secondly, often if I pass the wrong time of argument into a function, it gets picked up when I try to use it.  For example, if I call prepare on an argument that isn&#8217;t a database handle, I get a fatal error at that line.  As my functions are usually pretty small, I can immediately see what I&#8217;ve done wrong without an additional sanity check on the argument list.</p>
<p>@Dave &#8211; Hmmm&#8230; this kind of typeful programming is available even to mainstream languages like Java and C++.  It isn&#8217;t the preserve of the Haskell-using elite.</p>
<p>And sanitising an age argument to ensure it is a positive number is hardly defensive.  It doesn&#8217;t protect against argument inversion if I&#8217;m passing a couple of non-numbers, one of which isn&#8217;t an age.  But wouldn&#8217;t it have been great if Ada had won and we could easily specify restricted subtypes of primitives that were checked by the compiler?</p>
<p>@Michael &#8211; I&#8217;m not sure whether you&#8217;re agreeing with me or not.  My point is not that you shouldn&#8217;t sanitise arguments (whether that be in the defensive way I&#8217;ve illustrated here, or the soft way that Dave advocates above).  I don&#8217;t really care how you code.  What I do care about is when people say stuff like if you don&#8217;t sanitise your arguments, I don&#8217;t want to work with you.</p>
<p>Having said that, if you are specifying all your types precisely as I&#8217;ve indicated here, why wouldn&#8217;t you use Java and get greater speed, better tools, and in general support from the compiler for this style of programming?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Peters</title>
		<link>http://curiousprogrammer.wordpress.com/2010/10/20/perl-and-type-checking/#comment-8428</link>
		<dc:creator><![CDATA[Michael Peters]]></dc:creator>
		<pubDate>Wed, 20 Oct 2010 14:42:03 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=1325#comment-8428</guid>
		<description><![CDATA[I don&#039;t like how lots of people see type checking as an all or nothing affair. Why should I use a static language when I want to do thorough type checking at my boundaries (public facing functions)? I should be able to provide my library users with good error messages as early as possible without being accused of trying to turn Perl into Java or Haskell.]]></description>
		<content:encoded><![CDATA[<p>I don&#8217;t like how lots of people see type checking as an all or nothing affair. Why should I use a static language when I want to do thorough type checking at my boundaries (public facing functions)? I should be able to provide my library users with good error messages as early as possible without being accused of trying to turn Perl into Java or Haskell.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Rolsky</title>
		<link>http://curiousprogrammer.wordpress.com/2010/10/20/perl-and-type-checking/#comment-8426</link>
		<dc:creator><![CDATA[Dave Rolsky]]></dc:creator>
		<pubDate>Wed, 20 Oct 2010 14:04:43 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=1325#comment-8426</guid>
		<description><![CDATA[I said &quot;[i]f you don’t care about defensive programming&quot;, which is not the same as saying &quot;turn Perl into Haskell&quot; (though Haskell&#039;s type system is pretty cool).

In the case of age, I&#039;d check for a *positive* number (maybe an integer). That&#039;s good enough in a language like Perl 5.]]></description>
		<content:encoded><![CDATA[<p>I said &#8220;[i]f you don’t care about defensive programming&#8221;, which is not the same as saying &#8220;turn Perl into Haskell&#8221; (though Haskell&#8217;s type system is pretty cool).</p>
<p>In the case of age, I&#8217;d check for a *positive* number (maybe an integer). That&#8217;s good enough in a language like Perl 5.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roman</title>
		<link>http://curiousprogrammer.wordpress.com/2010/10/20/perl-and-type-checking/#comment-8424</link>
		<dc:creator><![CDATA[Roman]]></dc:creator>
		<pubDate>Wed, 20 Oct 2010 11:12:11 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=1325#comment-8424</guid>
		<description><![CDATA[Hi Jared,

my take on this is that sanity checks are trading development time for debugging time. Since latter usually takes more effort, it seems to be logical to favor sanity checks.  

However on every job I&#039;ve been so far there was great push to develop on time, typically in almost impossible schedule. Bug fixing was always taken much less strict and kind of second plan.

So I end up making those sanity checks only in code for other people (general library or module) and on few places where I or my coworkers got bitten. It also means very often that interface is not very intuitive then.

-- Roman]]></description>
		<content:encoded><![CDATA[<p>Hi Jared,</p>
<p>my take on this is that sanity checks are trading development time for debugging time. Since latter usually takes more effort, it seems to be logical to favor sanity checks.  </p>
<p>However on every job I&#8217;ve been so far there was great push to develop on time, typically in almost impossible schedule. Bug fixing was always taken much less strict and kind of second plan.</p>
<p>So I end up making those sanity checks only in code for other people (general library or module) and on few places where I or my coworkers got bitten. It also means very often that interface is not very intuitive then.</p>
<p>&#8211; Roman</p>
]]></content:encoded>
	</item>
</channel>
</rss>
