TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A farewell note to a programming language

104 pointsby fogusover 10 years ago

11 comments

noelwelshover 10 years ago
On Monday I&#x27;m giving a talk at Scala Exchange on my take on idiomatic Scala. For those of you who can&#x27;t make it, I&#x27;ll give a quick rundown. You basically need four patterns:<p>- algebraic data types<p>- structural recursion<p>- fold, map, and flatMap<p>- type classes<p>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.<p>It&#x27;s unfortunate that in Scala algebraic data types and type classes require a bit more code than in most other functional languages.<p>E.g.<p><pre><code> sealed trait Foo final case class Bar(...) extends Foo final case class Baz(...) extends Foo </code></pre> vs something like<p><pre><code> data Foo = Bar ... | Baz ... </code></pre> for an algebraic data type, but it&#x27;s really not so onerous to type.<p>These patterns are really truly shockingly simple to use. We teach them in introductory courses and the majority of people get them.<p>It&#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.<p>Update: If you&#x27;re interested in learning more about these patterns, on Friday we&#x27;re going to send a free excerpt of our &quot;Essential Scala&quot; book to our mailing list. The excerpt will include material on algebraic data types and structural recursion. You can sign up here: <a href="http://underscore.io/newsletter.html" rel="nofollow">http:&#x2F;&#x2F;underscore.io&#x2F;newsletter.html</a>
评论 #8701162 未加载
saosebastiaoover 10 years ago
Interesting. I&#x27;ve followed Matthias&#x27; project as I&#x27;ve tried learning the Play framework as well as front end development, and it has been incredibly useful. Incidentally, I learned Scala after I knew Clojure reasonably well, and I feel like I could apply the same arguments in the reverse direction.<p>When it comes to the back end, I&#x27;ll likely choose Scala 100% of the time. I really believe there is no substitute for a strongly typed ML-derivative for that type of environment. Additionally, there are a strong set of robust scala libraries (Typesafe mostly) that are completely production ready, and java interop is much more natural when you need it.<p>For the front end, I&#x27;m currently using Javascript, but I have toyed with the idea of both Scala.js and Clojurescript. This is where Clojure really makes me mad. I feel as though the dynamically typed Clojurescript should be a better fit as a compile-to-javascript language, but in every instance I&#x27;ve tried, Scala.js just works better. It compiles correctly, error messages make sense, much better documented, and there are fewer deviations from the core language. And the clojurescript libraries are mostly terrible in this regard...even the super-hyped ones like Om. My biggest pet peeve are the tutorials that force you to learn unrelated things (like Datomic, Emacs, Ring, etc) to be able to walk through them. I really feel like Clojurescript had a chance to shine here, but I find it far less inspiring than the relatively immature Scala.js. Oh well.
telover 10 years ago
If you like Scala but find it too scattered then there&#x27;s always Haskell* :)<p>(*) Not that there aren&#x27;t a thousand reasons to not choose Haskell. This is merely obligatory temptation dangling.
评论 #8700699 未加载
评论 #8700322 未加载
评论 #8700363 未加载
speedkillsover 10 years ago
I found your experience closely mirrors mine with scala. At my current shop we write mostly ruby and scala. The ruby code between developers looks much more uniform than the scala code I believe due to the fact that while trying to please everyone scala hasn&#x27;t yet developed much of &quot;the scala way&quot;. I do hope this changes as I really enjoy scala. Currently my team is experimenting with style&#x2F;punting tools like stylecop to try to bring a little consistency to our code. Too early to say how it will work out but I would love to hear from others how you try to bring a team style to a code base that will happily let a fully functional developer, a fully object oriented developer, a straight imperative developer, and someone who believes in mixing these things all work side by side. Mentally by giving up the possibility of nothing you have to learn everything which means loading a lot of the scala compiler up into your brain before even trying to read a bit of anyone else&#x27;s code.
评论 #8700145 未加载
emcrazyoneover 10 years ago
I think the article is fundamentally flawed from this comment alone:<p>&quot;In well over a year of working in Scala teams there hasn’t been a single day where I felt that there was a shared mindset about how to develop a system or even approach a problem.&quot;<p>So this guy expects a programming language to create a shared mindset?<p>I&#x27;ve been developing software for close to 17 years in more languages than you can shake a stick at and none of them do this for you. It&#x27;s always about picking the right tool for the job and&#x2F;or team.<p>A shared mindset comes from other planning type activities like use cases, function&#x2F;non-functional specifications, and general architecture type planning before you write code. Especially for larger projects.<p>I think software patterns tend to help drive synergy in a team environment. It&#x27;s not perfect but my experience has shown me and the folks I work with at least, that adopting patterns helps to bring us together but those patterns are usually fleshed out during architecture planning activities.
评论 #8700327 未加载
评论 #8700397 未加载
评论 #8700837 未加载
wapsover 10 years ago
A programmer complains that different programmers have different styles of programming in Scala ...<p>and ... switches to a lisp. You know, languages that execute code by rewriting the syntax tree of the running program ...<p>This ought to be good.<p>This is not meant to be disparaging against LISPs. I&#x27;m just alluding to the fact that while there are 5-10 ways to do the same thing in Scala, all looking very different, working subtly different, there&#x27;s 5000 different ways to do the same thing in LISPs.
评论 #8700077 未加载
评论 #8700128 未加载
评论 #8700378 未加载
评论 #8700380 未加载
评论 #8700740 未加载
评论 #8700369 未加载
swahover 10 years ago
His Clojure implementation is here: <a href="https://github.com/matthiasn/BirdWatch/tree/master/Clojure-Websockets" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;matthiasn&#x2F;BirdWatch&#x2F;tree&#x2F;master&#x2F;Clojure-W...</a>
swahover 10 years ago
fogus, what should I read nowadays? BOOKS???<p><a href="http://blog.fogus.me/2011/03/27/the-long-lost-art-of-thoughtfulness-in-blogging/" rel="nofollow">http:&#x2F;&#x2F;blog.fogus.me&#x2F;2011&#x2F;03&#x2F;27&#x2F;the-long-lost-art-of-thought...</a>
评论 #8700398 未加载
serve_yayover 10 years ago
Well, OK.
coviover 10 years ago
There are three and only three vague points conveyed in the article: (1) Scala has &quot;immense&quot; syntax, (2) Scala tries to support too many paradigms, and (3) the Iteratee library is hard to grasp.<p>For (1): I disagree -- Scala&#x27;s syntax is relatively easy to grasp. Perhaps the author meant constructs.<p>For (2): people keep saying this but why not just stick with the way you are comfortable with?<p>For (3): I don&#x27;t see how this is a language issue; at the very least it shows that the author is unable to grasp a particular functional programming abstraction.
评论 #8702410 未加载
kev6168over 10 years ago
No offense to the author, but this reads like a 16 old claiming he finally find the girl who is &#x27;the one&#x27; for life. __only two years later__, that Another girl shows up and OMG the new chick definitely is the &#x27;true&#x27; one.<p>To put it another way, under extreme circumstances, Mr. Martin Odesky can use even the $&amp;<i>^%$#</i>$ PHP to write safe and efficient airplane flying control software.<p>The point is the language is hardly matter as much as your kids think. There are far more important things for good software. But language is not only a tool but also a toy and a passion, so I can appreciate the urge to talk about it. :-)
评论 #8700396 未加载