<story><title>A farewell note to a programming language</title><url>http://matthiasnehlsen.com/blog/2014/12/04/Farewell-Scala/</url><text></text></story><parent_chain></parent_chain><comment><author>noelwelsh</author><text>On Monday I&amp;#x27;m giving a talk at Scala Exchange on my take on idiomatic Scala. For those of you who can&amp;#x27;t make it, I&amp;#x27;ll give a quick rundown. You basically need four patterns:&lt;p&gt;- algebraic data types&lt;p&gt;- structural recursion&lt;p&gt;- fold, map, and flatMap&lt;p&gt;- type classes&lt;p&gt;That, in my experience, will cover the majority of code you need to write in Scala and give a solid basis for a robust and comprehendible code base.&lt;p&gt;It&amp;#x27;s unfortunate that in Scala algebraic data types and type classes require a bit more code than in most other functional languages.&lt;p&gt;E.g.&lt;p&gt;&lt;pre&gt;&lt;code&gt;   sealed trait Foo
   final case class Bar(...) extends Foo
   final case class Baz(...) extends Foo
&lt;/code&gt;&lt;/pre&gt;
vs something like&lt;p&gt;&lt;pre&gt;&lt;code&gt;   data Foo = Bar ... | Baz ...
&lt;/code&gt;&lt;/pre&gt;
for an algebraic data type, but it&amp;#x27;s really not so onerous to type.&lt;p&gt;These patterns are really truly shockingly simple to use. We teach them in introductory courses and the majority of people get them.&lt;p&gt;It&amp;#x27;s true that Scala has some warts, but as software engineers we ought to make decisions based not on our personal biases but on a consideration of the problem domain and tradeoffs involved. If you want 1) static typing, 2) a modern language, and 3) JVM compatibility then Scala is the best choice at the moment IMO. Remove one of those restrictions and other choices come into the picture.&lt;p&gt;Update: If you&amp;#x27;re interested in learning more about these patterns, on Friday we&amp;#x27;re going to send a free excerpt of our &amp;quot;Essential Scala&amp;quot; book to our mailing list. The excerpt will include material on algebraic data types and structural recursion. You can sign up here: &lt;a href=&quot;http://underscore.io/newsletter.html&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;underscore.io&amp;#x2F;newsletter.html&lt;/a&gt;</text></comment>
<story><title>A farewell note to a programming language</title><url>http://matthiasnehlsen.com/blog/2014/12/04/Farewell-Scala/</url><text></text></story><parent_chain></parent_chain><comment><author>tel</author><text>If you like Scala but find it too scattered then there&amp;#x27;s always Haskell* :)&lt;p&gt;(*) Not that there aren&amp;#x27;t a thousand reasons to not choose Haskell. This is merely obligatory temptation dangling.</text></comment>