<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-3718956085911858962.post6478747728829537405..comments</id><updated>2009-04-23T12:00:21.772+05:30</updated><category term='barcamp'/><category term='continuous integration'/><category term='news'/><category term='quirks'/><category term='web'/><category term='books'/><category term='bug'/><category term='recruiting'/><category term='registry'/><category term='spawn'/><category term='gwt'/><category term='methodology'/><category term='symlinks'/><category term='innovative'/><category term='dzone'/><category term='DCB1'/><category term='junction'/><category term='css'/><category term='evolving'/><category term='devcampbangalore'/><category term='utf8'/><category term='rails'/><category term='video'/><category term='c42'/><category term='.net'/><category term='performance'/><category term='cc.rb'/><category term='xp'/><category term='training'/><category term='rant'/><category term='undernet'/><category term='resharper'/><category term='JSNI'/><category term='scala'/><category term='java'/><category term='refactoring'/><category term='activ'/><category term='anti-pattern'/><category term='security'/><category term='intro'/><category term='humour'/><category term='thoughtworks'/><category term='intellij'/><category term='india'/><category term='barcampbangalore5'/><category term='hackdayindia'/><category term='django'/><category term='links'/><category term='mochikit'/><category term='hiring'/><category term='mvc'/><category term='leisure'/><category term='interview'/><category term='photo'/><category term='brug'/><category term='twb'/><category term='opinion'/><category term='content repository'/><category term='digg'/><category term='practices'/><category term='mongrel'/><category term='mac'/><category term='offshore'/><category term='darkness'/><category term='OOP'/><category term='quality'/><category term='fun'/><category term='feedburner'/><category term='testing'/><category term='release'/><category term='architecture'/><category term='musings'/><category term='nasscom'/><category term='gotcha'/><category term='prototype'/><category term='ide'/><category term='ruby'/><category term='rdt'/><category term='dragdrop'/><category term='jcr'/><category term='skills'/><category term='javascript'/><category term='bangpypers'/><category term='tomcat'/><category term='event'/><category term='conference'/><category term='osx'/><category term='sysinternals'/><category term='announcement'/><category term='GI'/><category term='bangalore'/><category term='unconference'/><category term='agile'/><category term='python'/><category term='plugin'/><category term='analysis'/><category term='javaone'/><category term='browser'/><category term='enterprise'/><category term='ci'/><category term='barcampbangalore4'/><category term='windows'/><category term='irc'/><category term='tdd'/><category term='tweak'/><category term='recruitment'/><category term='rubyconf'/><category term='jackrabbit'/><category term='hack'/><category term='dcb2'/><category term='oss'/><category term='cycle'/><category term='tool'/><category term='feedflare'/><category term='REST'/><category term='feedflareunit'/><category term='ajax'/><category term='howto'/><category term='programming'/><category term='bcb4'/><category term='startup'/><category term='deployment'/><category term='tw'/><category term='lucene'/><category term='metaprogramming'/><category term='2010'/><category term='noob'/><category term='dining table'/><category term='YUI'/><category term='tibco'/><category term='versioning'/><category term='literature'/><category term='jquery'/><category term='activeresource'/><category term='cool'/><category term='rubyconf2011'/><category term='blogger'/><category term='call'/><category term='twitter'/><category term='functional programming'/><category term='search'/><category term='mingle'/><category term='microsoft'/><category term='book review verdict:read'/><category term='jruby'/><category term='goldberg'/><category term='wrest'/><title type='text'>Comments on Electric Sheep Blog: Twitter on Ruby and Scala</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.sidu.in/feeds/6478747728829537405/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html'/><author><name>Sidu</name><uri>http://www.blogger.com/profile/11938300811286150164</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.flickr.com/74/186326016_765e6e2222_s.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-5843998255887144766</id><published>2009-04-23T12:00:00.000+05:30</published><updated>2009-04-23T12:00:00.000+05:30</updated><title type='text'>Sidu,

This is how you will do it in Scala. 

def ...</title><content type='html'>Sidu,&lt;br /&gt;&lt;br /&gt;This is how you will do it in Scala. &lt;br /&gt;&lt;br /&gt;def firstElement[T](l: List[T]) = l match {&lt;br /&gt;  case x :: xs =&amp;gt; Some(x)&lt;br /&gt;  case _ =&amp;gt; None&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Scala pattern matching is interesting because it marries OO with pattern matching. For pattern matching you need to expose the object composition. This in general goes against encapsulation principal of OO. But Scala enables this exposure in controlled ways:&lt;br /&gt;&lt;br /&gt;1. Constructor signature is exposed for only those classes marked as &amp;#39;case classes&amp;#39;&lt;br /&gt;2. Provides unapply method for more control on what you want to expose&lt;br /&gt;&lt;br /&gt;The latter is called &amp;quot;Extractors&amp;quot; and is considered fundamental contribution of Scala. I think pattern matching is still a small part of the whole Scala phenomenon which is trying to bring so many academic ideas to the mainstream.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/5843998255887144766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/5843998255887144766'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html?showComment=1240468200000#c5843998255887144766' title=''/><author><name>Mushtaq</name><uri>http://www.blogger.com/profile/02791717326706388056</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-814827597'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-2181141835654667856</id><published>2009-04-22T15:13:00.000+05:30</published><updated>2009-04-22T15:13:00.000+05:30</updated><title type='text'>Sure, I understand what you&amp;#39;re saying about th...</title><content type='html'>Sure, I understand what you&amp;#39;re saying about the exhaustive check, no problem there. In an OO language, preventing this kind of problem lies in the hands of the developer (encapsulated, unit tested blah blah). No arguments from me on the exhaustiveness checking front. I would disagree with your assertion that polymorphic dispatch isn&amp;#39;t that important, but that could just be my ignorance talking (see below for a sample illustrating what I mean).&lt;br /&gt;&lt;br /&gt;Option types seem to be syntactic sugar *in Scala* I should have said. In a functional language they make a lot of sense (which is why I mentioned the Maybe monad, which is what I&amp;#39;m more familiar with from Haskell). In Scala, the syntactic sugar saves you from the problem that you just described - having a ton of NullThis/NullThat classes, no doubt about that.&lt;br /&gt;&lt;br /&gt;My confusion stems from the fact that in Scala seems to be offering pattern matching on nominative types as an alternative to polymorphic OO based invocation, but *both* are available though they are equivalent (in fact I suspect the latter is implemented by using the former).&lt;br /&gt;&lt;br /&gt;Let me illustrate with a Haskell sample from the free Haskell guide (and it uses option types :)):&lt;br /&gt;&lt;br /&gt;firstElement :: [a] -&amp;gt; Maybe a &lt;br /&gt;firstElement [] = Nothing &lt;br /&gt;firstElement (x:xs) = Just x&lt;br /&gt; &lt;br /&gt;I&amp;#39;m not sure about how something equivalent would be implemented in Scala?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/2181141835654667856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/2181141835654667856'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html?showComment=1240393380000#c2181141835654667856' title=''/><author><name>Sidu</name><uri>http://www.blogger.com/profile/11938300811286150164</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.flickr.com/74/186326016_765e6e2222_s.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-331438855'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-3595126959260167409</id><published>2009-04-22T01:48:00.000+05:30</published><updated>2009-04-22T01:48:00.000+05:30</updated><title type='text'>The examples above were shamelessly ripped off fro...</title><content type='html'>The examples above were shamelessly ripped off from Practical Foundations for Programming Languages by Robert Harper.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/3595126959260167409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/3595126959260167409'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html?showComment=1240345080000#c3595126959260167409' title=''/><author><name>Darpan</name><uri>http://www.blogger.com/profile/10648261687652482943</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_X0r-B5dOKNA/STL1Dgvaa9I/AAAAAAAABiE/U0DHbcRUOJ4/S220/IMG_4623.JPG'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-944308187'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-2512168531692527853</id><published>2009-04-22T00:33:00.000+05:30</published><updated>2009-04-22T00:33:00.000+05:30</updated><title type='text'>Dispatch on structural types using pattern matchin...</title><content type='html'>Dispatch on structural types using pattern matching maybe an application of pattern matching (although I don't see value since it can be achieved with if instanceof {type defn} else, switch case etc.), but I still think that the real value of pattern matching is exhaustiveness checking, which is a tool for code evolution. Consider (code in ML, but is intuitive enough):&lt;br /&gt;datatype expr = &lt;br /&gt;  Numeral of int | &lt;br /&gt;  Plus of expr * expr | &lt;br /&gt;  Times of expr * expr&lt;br /&gt;&lt;br /&gt;Think of datatype as a union type (its a sum type in ML in jargon), it can be Numeral, or Plus or Times&lt;br /&gt;&lt;br /&gt;and the function:&lt;br /&gt;fun eval (Numeral n) = &lt;br /&gt;    Numeral n &lt;br /&gt;    | eval (Plus (e1, e2)) = &lt;br /&gt;      let &lt;br /&gt;      ...&lt;br /&gt;      end &lt;br /&gt;    | eval (Times (e1, e2)) = &lt;br /&gt;      let &lt;br /&gt;      ...&lt;br /&gt;      end &lt;br /&gt;&lt;br /&gt;If the definition of expr was changed to:&lt;br /&gt;datatype expr = &lt;br /&gt;  Numeral of int &lt;br /&gt;  | Plus of expr * expr &lt;br /&gt;  | Times of expr * expr&lt;br /&gt;  | reciprocal of expr&lt;br /&gt;&lt;br /&gt;The compiler will give you a warning at compile time because the function eval is incomplete -  it doesn't account for exprs of type reciprocal. Hence, you don't accidentally break code that is in another part of the program.&lt;br /&gt;&lt;br /&gt;Options types are not syntactic sugar, they have their own semantics. An option type is defined as&lt;br /&gt;&lt;br /&gt;datatype 'a option = NONE | SOME of &lt;br /&gt;'a&lt;br /&gt;&lt;br /&gt;(also a sum type), and they are not limited to null pointers substitutes. For example they can be used for functions that expect two parameters but one can be optional, in which case the functions evaluates a default value.&lt;br /&gt;&lt;br /&gt;The null object pattern seems unusually unwieldy because with it you may have to define tons of NullMyType classes or inherit all your classes from a Null type.&lt;br /&gt;&lt;br /&gt;As an aside, it is not possible for options types as a whole to be syntactic sugar for an object oriented pattern because they have existed in ML since the 70s.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/2512168531692527853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/2512168531692527853'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html?showComment=1240340580000#c2512168531692527853' title=''/><author><name>Darpan</name><uri>http://www.blogger.com/profile/10648261687652482943</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_X0r-B5dOKNA/STL1Dgvaa9I/AAAAAAAABiE/U0DHbcRUOJ4/S220/IMG_4623.JPG'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-944308187'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-3446138763201183970</id><published>2009-04-21T16:07:00.000+05:30</published><updated>2009-04-21T16:07:00.000+05:30</updated><title type='text'>&amp;gt; Well, in a system that is large 
&amp;gt; enough ...</title><content type='html'>&amp;gt; Well, in a system that is large &lt;br /&gt;&amp;gt; enough it is simply not possible to &lt;br /&gt;&amp;gt; make it completely object oriented &lt;br /&gt;&amp;gt; so that you never have to do an &lt;br /&gt;&amp;gt; instanceof.&lt;br /&gt;There are very special cases (the equals() method for one) where it is acceptable. Otherwise instance_of? indicates bad code at that layer or the layer immediately below it. Basically, it indicates a problem with the people writing the code, not with the language itself.&lt;br /&gt;&lt;br /&gt;Option types in Scala are basically nice syntactic sugar for null objects, which is good, but it is still a nice wrapper over an existing OO pattern, not something radically different. No Java/C# codebase I&amp;#39;ve seen in ThoughtWorks has many nil checks, except at library or input boundaries, and in the latter case they are isolated at the boundaries of the system using null objects.&lt;br /&gt;&lt;br /&gt;However, whether you use null objects or a Maybe monad depends on the mechanism for polymorphism; scala which claims to support both OO and functional code seems odd, because my (limited) understanding tells me that dispatch on structural types rather than nominative types is where the real value of pattern matching lies; Scala&amp;#39;s pattern match on the other hand seems to match nominative types which simply replicates polymorphic OO based method dispatch. Perhaps I&amp;#39;m missing something?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/3446138763201183970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/3446138763201183970'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html?showComment=1240310220000#c3446138763201183970' title=''/><author><name>Sidu</name><uri>http://www.blogger.com/profile/11938300811286150164</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.flickr.com/74/186326016_765e6e2222_s.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-331438855'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-5215998713103699135</id><published>2009-04-21T11:39:00.000+05:30</published><updated>2009-04-21T11:39:00.000+05:30</updated><title type='text'>&lt;b&gt;Disclaimer:&lt;/b&gt;- My rants above are mostly inci...</title><content type='html'>&lt;B&gt;Disclaimer:&lt;/B&gt;- My rants above are mostly incited by Scala. I think it's a platform that's trying to achieve too much in one package. But that's just a personal opinion.&lt;br /&gt;- I like functional programming and pure FP-style pattern matching as it forces you to define specializations of as an atomic whole. Tremendous improvement in readability.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/5215998713103699135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/5215998713103699135'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html?showComment=1240294140000#c5215998713103699135' title=''/><author><name>Saager Mhatre</name><uri>http://www.blogger.com/profile/03869587109666583246</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh4.google.com/saager.mhatre/RwM-4CsYevI/AAAAAAAAArA/YftcTXPgpc8/s144/dexter.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1317165742'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-6739467760939649609</id><published>2009-04-21T11:32:00.000+05:30</published><updated>2009-04-21T11:32:00.000+05:30</updated><title type='text'>@Darpan-

Hmm... interesting. I'd be a whole lot m...</title><content type='html'>@Darpan-&lt;br /&gt;&lt;br /&gt;Hmm... interesting. I'd be a whole lot more appreciative if it were a compile error rather than a warning, though; case analysis should be a fundamental feature.&lt;br /&gt;&lt;br /&gt;Either way, Scala allows you to mark pattern matching on even sealed classes as &lt;A&gt;@unchecked&lt;/A&gt; and apparently Erlang doesn't even give you a warning! (Yikes and Jinkies!!!)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/6739467760939649609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/6739467760939649609'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html?showComment=1240293720000#c6739467760939649609' title=''/><author><name>Saager Mhatre</name><uri>http://www.blogger.com/profile/03869587109666583246</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh4.google.com/saager.mhatre/RwM-4CsYevI/AAAAAAAAArA/YftcTXPgpc8/s144/dexter.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1317165742'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-5414995994987927790</id><published>2009-04-20T21:00:00.000+05:30</published><updated>2009-04-20T21:00:00.000+05:30</updated><title type='text'>The keyword &lt;b&gt;sealed&lt;/b&gt; will force exhaustivenes...</title><content type='html'>The keyword &lt;B&gt;sealed&lt;/B&gt; will force exhaustiveness checking of the cases, and the scala compiler will give you a warning.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/5414995994987927790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/5414995994987927790'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html?showComment=1240241400000#c5414995994987927790' title=''/><author><name>Darpan</name><uri>http://www.blogger.com/profile/10648261687652482943</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_X0r-B5dOKNA/STL1Dgvaa9I/AAAAAAAABiE/U0DHbcRUOJ4/S220/IMG_4623.JPG'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-944308187'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-2043080746915695091</id><published>2009-04-20T19:43:00.000+05:30</published><updated>2009-04-20T19:43:00.000+05:30</updated><title type='text'>Correction: functional languages will give you a n...</title><content type='html'>Correction: functional languages will give you a non-exhaustive match warning.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/2043080746915695091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/2043080746915695091'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html?showComment=1240236780000#c2043080746915695091' title=''/><author><name>Darpan</name><uri>http://www.blogger.com/profile/10648261687652482943</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_X0r-B5dOKNA/STL1Dgvaa9I/AAAAAAAABiE/U0DHbcRUOJ4/S220/IMG_4623.JPG'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-944308187'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-1226811757803169442</id><published>2009-04-20T19:32:00.000+05:30</published><updated>2009-04-20T19:32:00.000+05:30</updated><title type='text'>Functional languages will give you an error you if...</title><content type='html'>Functional languages will give you an error you if you miss a case.&lt;br /&gt;&lt;br /&gt;My comment was general about pattern matching, not particularly for Scala. I will have to read what Scala provides but I'd be surprised if it doesn't give a warning or error or mandate a default case. Because exhaustiveness checking is one of the points of pattern matching.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/1226811757803169442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/1226811757803169442'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html?showComment=1240236120000#c1226811757803169442' title=''/><author><name>Darpan</name><uri>http://www.blogger.com/profile/10648261687652482943</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_X0r-B5dOKNA/STL1Dgvaa9I/AAAAAAAABiE/U0DHbcRUOJ4/S220/IMG_4623.JPG'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-944308187'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-6739304851918183492</id><published>2009-04-20T18:48:00.000+05:30</published><updated>2009-04-20T18:48:00.000+05:30</updated><title type='text'>@Darpan, not sure what you're hinting at, but AFAI...</title><content type='html'>@Darpan, not sure what you're hinting at, but AFAIK you can write 'match'es in Scala that don't cover all the 'case's. (PS- that comment was very Scala specific)&lt;br /&gt;&lt;br /&gt;I agree that pattern matching in pure functional languages such as Erlang and Haskell is much better; flipping the paradigm over from imperative to declarative turns cases into a neat way to specialize problem definitions. Though, I'm not sure if either of them ensures (read enforces) that you cover all cases; but that's probably my inexperience/ignorance speaking.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/6739304851918183492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/6739304851918183492'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html?showComment=1240233480000#c6739304851918183492' title=''/><author><name>Saager Mhatre</name><uri>http://www.blogger.com/profile/03869587109666583246</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh4.google.com/saager.mhatre/RwM-4CsYevI/AAAAAAAAArA/YftcTXPgpc8/s144/dexter.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1317165742'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-8152719976413985201</id><published>2009-04-20T18:08:00.000+05:30</published><updated>2009-04-20T18:08:00.000+05:30</updated><title type='text'>Pattern matching is not a glorified switch case li...</title><content type='html'>Pattern matching is not a glorified switch case like mentioned here by Saager Mhatre. It is a way of making sure you cover all cases which without pattern matching is simply not possible. In the example mentioned, are you sure that there isn't a Baz case you should cover?&lt;br /&gt;&lt;br /&gt;As for your object oriented suggestion of never using is_a or instanceof (I am more familiar with this). Well, in a system that is large enough it is simply not possible to make it completely object oriented so that you never have to do an instanceof. And not everyone can code or design like some folks from Thoughtworks (or refactor :) ).&lt;br /&gt;&lt;br /&gt;For your null pointer discussion, you should google Tony Hoare and his billion dollar mistake on null pointers. Having option types guarantees not having a null through the type system which is not only a big software engineering advantage but also an efficiency improvement.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/8152719976413985201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/8152719976413985201'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html?showComment=1240231080000#c8152719976413985201' title=''/><author><name>Darpan</name><uri>http://www.blogger.com/profile/10648261687652482943</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/_X0r-B5dOKNA/STL1Dgvaa9I/AAAAAAAABiE/U0DHbcRUOJ4/S220/IMG_4623.JPG'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-944308187'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-6519816599176069262</id><published>2009-04-07T13:05:00.000+05:30</published><updated>2009-04-07T13:05:00.000+05:30</updated><title type='text'>Yikes! &lt;a href="http://www.haskell.org/haskellwiki...</title><content type='html'>Yikes! &lt;A HREF="http://www.haskell.org/haskellwiki/Foldr_Foldl_Foldl'" REL="nofollow"&gt;foldr&lt;/A&gt;!! Haskell!!!&lt;BR/&gt;You just went waay beyond my circle of knowledge. Haskell's still on my 'to pick up ' list. But I was talking about &lt;A HREF="http://www.scala-lang.org/docu/files/ScalaByExample.pdf" REL="nofollow"&gt;Scala-style-case-class-based-pattern-matching&lt;/A&gt;.&lt;BR/&gt;&lt;BR/&gt;Oh, and as for the 'is_a?', why even start by repeating their mistakes?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/6519816599176069262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/6519816599176069262'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html?showComment=1239089700000#c6519816599176069262' title=''/><author><name>Saager Mhatre</name><uri>http://www.blogger.com/profile/03869587109666583246</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh4.google.com/saager.mhatre/RwM-4CsYevI/AAAAAAAAArA/YftcTXPgpc8/s144/dexter.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1317165742'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-5356360544426179303</id><published>2009-04-07T12:49:00.000+05:30</published><updated>2009-04-07T12:49:00.000+05:30</updated><title type='text'>Isn't &lt;br&gt;&lt;br&gt;foldr f z [] = z&lt;br&gt;foldr f z (x:xs)...</title><content type='html'>Isn't &lt;BR/&gt;&lt;BR/&gt;foldr f z [] = z&lt;BR/&gt;foldr f z (x:xs) = f x (foldr f z xs)&lt;BR/&gt;&lt;BR/&gt;an aesthetically pleasing use of that switch case? When there are objects involved though, I would tend to agree with you.&lt;BR/&gt;&lt;BR/&gt;About the is_a? allegation, see &lt;A HREF="http://github.com/rails/rails/blob/0e9efae4745e232b1c778fda69ee110e42a223a7/activeresource/lib/active_resource/connection.rb" REL="nofollow"&gt;Connection#http&lt;/A&gt;; looks familiar? &lt;BR/&gt;&lt;BR/&gt;My Net::Http code is taken from there because I know they have handled more edge cases than I care to tackle now. But I have my eye on it and it will be gone soon. This kind of code is one of the reasons why ActiveResource annoys me and I'm writing Wrest ;)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/5356360544426179303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/5356360544426179303'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html?showComment=1239088740000#c5356360544426179303' title=''/><author><name>Sidu</name><uri>http://www.blogger.com/profile/11938300811286150164</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://static.flickr.com/74/186326016_765e6e2222_s.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-331438855'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-2551277941533917752</id><published>2009-04-07T03:36:00.000+05:30</published><updated>2009-04-07T03:36:00.000+05:30</updated><title type='text'>Hmm... intewesting! An 'is_a?' hater who writes 'i...</title><content type='html'>Hmm... intewesting! An 'is_a?' hater who writes 'is_a?' code...&lt;BR/&gt;&lt;A HREF="http://github.com/kaiwren/wrest/blob/6f4977486a475abcc1fa652d3abc0438840bc92f/lib/wrest/uri.rb" REL="nofollow"&gt;Uri#https?&lt;/A&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/2551277941533917752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/2551277941533917752'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html?showComment=1239055560000#c2551277941533917752' title=''/><author><name>Saager Mhatre</name><uri>http://www.blogger.com/profile/03869587109666583246</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh4.google.com/saager.mhatre/RwM-4CsYevI/AAAAAAAAArA/YftcTXPgpc8/s144/dexter.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1317165742'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-6876360095086097686</id><published>2009-04-07T03:10:00.000+05:30</published><updated>2009-04-07T03:10:00.000+05:30</updated><title type='text'>Somehow pattern matching always seems like a glori...</title><content type='html'>Somehow pattern matching always seems like a glorified switch-case to me; the eyesore of a linguistically concealed if-else is only exacerbated by the fact that the conditionals are based on the Type of the object being matched. Wait, did I just describe a really cute way of writing...&lt;BR/&gt;&lt;B&gt;&lt;BR/&gt;swith(object.class) {&lt;BR/&gt;case Foo: ...&lt;BR/&gt;case Bar: ...&lt;BR/&gt;...&lt;BR/&gt;}&lt;BR/&gt;&lt;/B&gt;&lt;BR/&gt;... ?&lt;BR/&gt;&lt;BR/&gt;Egads! @-}</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/6876360095086097686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/6876360095086097686'/><link rel='alternate' type='text/html' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html?showComment=1239054000000#c6876360095086097686' title=''/><author><name>Saager Mhatre</name><uri>http://www.blogger.com/profile/03869587109666583246</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh4.google.com/saager.mhatre/RwM-4CsYevI/AAAAAAAAArA/YftcTXPgpc8/s144/dexter.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1317165742'/></entry><entry><id>tag:blogger.com,1999:blog-3718956085911858962.post-2065757201824361732</id><published>2009-04-07T03:09:00.000+05:30</published><updated>2009-04-07T03:09:00.000+05:30</updated><title type='text'></title><content type='html'>This comment has been removed by the author.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/2065757201824361732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3718956085911858962/6478747728829537405/comments/default/2065757201824361732'/><author><name>Saager Mhatre</name><uri>http://www.blogger.com/profile/03869587109666583246</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh4.google.com/saager.mhatre/RwM-4CsYevI/AAAAAAAAArA/YftcTXPgpc8/s144/dexter.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sidu.in/2009/04/twitter-on-ruby-and-scala.html' ref='tag:blogger.com,1999:blog-3718956085911858962.post-6478747728829537405' source='http://www.blogger.com/feeds/3718956085911858962/posts/default/6478747728829537405' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.contentRemoved' value='true'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1317165742'/></entry></feed>
