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.

Scala – 1 Star Would Not Program Again

83 pointsby theotownover 11 years ago

13 comments

yummyfajitasover 11 years ago
Blogspam, original is here:<p><a href="http://overwatering.org/blog/2013/12/scala-1-star-would-not-program-again/" rel="nofollow">http:&#x2F;&#x2F;overwatering.org&#x2F;blog&#x2F;2013&#x2F;12&#x2F;scala-1-star-would-not-...</a><p>Some thoughts: I&#x27;ve worked on several large scala projects, and I&#x27;ve found that long incremental compile times are often a sign of bad encapsulation. If you change the type signature of a <i>public</i> method then any file using that class needs to be recompiled.<p>I&#x27;ve found that explicit type annotations on method return types help a lot here:<p><pre><code> def getBandit(ref: BanditRef)= { ... ConcreteSimpleBandit(...) } </code></pre> This has type `BanditRef =&gt; ConcreteSimpleBandit`. If I change the implementation and return a ConcreteNonSimpleBandit, the inferred type signature changes to `BanditRef =&gt; ConcreteNonSimpleBandit`. If I use an if-statement and return one or the other, the return type will be the nearest superclass of both (say a ConcreteBandit).<p>However, if I explicitly annotate it to return a BanditLike<p><pre><code> def getBandit(ref: BanditRef): BanditLike = { ... ConcreteSimpleBandit(...) } </code></pre> then only the class in question needs to be recompiled.<p>The author is spot on about the use of infix methods. These are nearly always evil. What would be great if Scala gave you a way to <i>explicitly declare</i> certain functions as infix, and everything else uses the java-style calling convention. For a monoid, a |+| b |+| c makes perfect sense. However, consider:<p><pre><code> optionalResult map (x =&gt; x*x) filter (_ % 2 == 1) getOrElse -1 </code></pre> Yeah, you need to do work to figure out what&#x27;s going on. Compare to:<p><pre><code> optionalResult.map(x =&gt; x*x).filter(_ % 2 == 1).getOrElse(-1) </code></pre> But I suppose the former will save some bits (&#x27;.&#x27; and &#x27;(&#x27; take more bytes than &#x27; &#x27;, right?).
评论 #7058244 未加载
评论 #7058260 未加载
评论 #7058345 未加载
blakesmithover 11 years ago
More of these &quot;This language sucks&quot; blog posts need to focus on the problem domains actually being solved and less on the aesthetics of the tools. My team uses Scala as one of our primary backend languages and have been extremely productive with it. We&#x27;re building large distributed systems that store and manage large quantities of sensor data and push Scala pretty hard. Are there warts? Yes, just as with any other tool. But the important part is that we create value quickly for our customers, and Scala has fit our problem domain quite well.<p>I&#x27;ve also seen too many consultants who get caught up in technology for its own sake, because that&#x27;s what many of them sell (We use this new development methodology, with this hot new framework, hire us!).<p>Let&#x27;s all spend less time worrying about what tools we&#x27;re using and more time worrying about whether we&#x27;re solving the right problems.
michaelwwwover 11 years ago
The Co-Founder of Typesafe, Paul Phillips, hates Scala too. Working on the compiler seems to have driven him mad (he says this, not me, but I don&#x27;t disagree based on this performance.)<p><a href="http://parleys.com/play/528cbfc3e4b084eb60ac78f2/about" rel="nofollow">http:&#x2F;&#x2F;parleys.com&#x2F;play&#x2F;528cbfc3e4b084eb60ac78f2&#x2F;about</a>
评论 #7058323 未加载
评论 #7058371 未加载
评论 #7058263 未加载
评论 #7058429 未加载
评论 #7059308 未加载
评论 #7059128 未加载
评论 #7060306 未加载
lemmsjidover 11 years ago
It&#x27;s sad that this particular blog post is getting double the attention because it&#x27;s not a strong critique of Scala, which, like any good technology, is imminently critique-able. The extant HN thread got much more interesting Scala critiques than the blog post:<p><a href="https://news.ycombinator.com/item?id=6829725" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6829725</a><p>That said, I would add the following meta-commentary, which has nothing to do with Scala in particular:<p>Don&#x27;t be scared away from Scala by the negativity. In fact, use said commentary as evidence that Scala has hit a maturity point that makes it worth exploring. When Rails first could come out, it could do no wrong, and I would get regular queries from less experienced techies as to why we weren&#x27;t rewriting our code to use Rails, as though the hype made it a given that any web application should be in Rails from now on. Now that Rails is more mature, it gets regular negative articles. Using negativity around a mature technology has some underlying theme that is valid (performance for Rails, overly complex libraries for Scala), but not something that would or should scare someone away if they are eyes-open assessing the needs of their final product against the capabilities of the technology.<p>Really, we are in the infancy of software development. All languages are incredibly oblique to their runtime environments, especially in distributed scenarios. Any language that gets little but praise is simply not sufficiently understood by enough people to be critiqued, or for said critiques to get up-voted on news sites.<p>I am not, by the way, arguing that all languages are therefore equal in quality. What I am arguing against is this: often when there&#x27;s a vote-up negative article about technology X, there&#x27;s people who respond, &quot;Aww shucks, I was about to use X for my next project, what should I use instead?&quot; And the responses are, &quot;Well, use Y instead&quot;, where Y is currently on the zenith of its hype machine. This is a bad strategy for assessing technology, because it&#x27;s simply inevitable that Y will eventually receive a hailstorm of similarly valid critiques. Consider it a given that any technology in use today will look stodgy in forty years.<p>Instead, use the existence of critiques as a marker that a language is fairly well known and mature. It&#x27;s rather like the appropriate way to use Yelp reviews: assume most of them are fake, assume nothing but positivity or negativity is wrong, and instead look for volume and breadth of tone.
tenpoundhammerover 11 years ago
I have written Scala on several large projects( and Play framework)<p>One of the problems with Scala is that there are a thousand ways to do everything, which is often insanely confusing to a lot of people. And another I think is that people try to teach scala like they teach other OO languages and it just doesn&#x27;t work.<p>Scala is not that hard once you boil it down the set of features that your team wants to use.<p>After learning Scala and then teaching it to several java developers, I believe I could get someone productive in Scala in 5-10 hours.<p>There are a couple of cognitive hurdles, and a few difficult to implement features in the super deep realm of coding, but it&#x27;s really not that hard.
评论 #7059022 未加载
评论 #7059048 未加载
评论 #7059466 未加载
quantumpotato_over 11 years ago
I&#x27;m learning Scala (coursera, twitter) to write game servers that can handle lots of request simultaneously. What&#x27;s another good language for this? So far, Scala seems rather powerful.
评论 #7059247 未加载
评论 #7058824 未加载
评论 #7058668 未加载
评论 #7077807 未加载
评论 #7059233 未加载
评论 #7058782 未加载
评论 #7060394 未加载
评论 #7059272 未加载
Pxtlover 11 years ago
I think the key-value pairs vs typed objects for something like an HTTP header is a holy war we&#x27;ll <i>never</i> hear the end of.
farginayover 11 years ago
This post reinforces my sense that Scala is the new C++.
icedchaiover 11 years ago
I was at a job where I programmed in Scala for about 6 months. This was almost 3 years ago: immature tools (awful IDE support), slow compilers, long build times (this was partially due to Maven project with literally 50+ modules and too many unit tests), and inexperienced developers. Scala is too complicated a language.<p>I&#x27;m sure it&#x27;s a little better now... but, it&#x27;s not for me.
mortyseinfeldover 11 years ago
<i>With Scala you feel smart having just got something to work in a beautiful way but when you look around the room to tell your clojure colleague how clever you are, you notice he left 3 hours ago and there is a post-it saying use a Map</i><p>So he was making reference to Clojure here. That&#x27;s fine, but you don&#x27;t have to make things complicated in Scala if you don&#x27;t want to.<p>I love the semantics of Clojure, but until you get some optional typing and possibly another syntax baked in forget about it for a whole class of devs.
评论 #7058365 未加载
评论 #7058525 未加载
评论 #7058484 未加载
frowaway001over 11 years ago
<p><pre><code> I also work in the same company as the poster. We are currently running a huge Scala&#x2F;Play project where the team is a mix of many young developers (&lt; 5 yrs) and a few seniors. Overall it is a very pleasant experience. There are multiple other projects using Scala which share this positive feeling. It is difficult to explain these reactions, but they are common among my colleagues. These are senior programmers who are generally very good with any programming language&#x2F;task. They will pickup something new and be productive in just a few days. They usually end up liking Ruby, Javascript, Clojure and for good reasons. Scala on the other hand requires a lot of attention and work to get mastery. One can get started in days but to exploit the real power and appreciate design choices takes months if not years. In my opinion this is an important factor why these smart developers react so badly to Scala which for them is just another tool which takes too much time to grasp. There is little Scala can do. Maybe it should become less ambitious. No macros, no compiler plugins, do not challenge FP etc. But then it will not be the Scala we all loved :) Also, it is important to note the blog post does not criticise Scala in isolation. It used Spray DSL for routes and Gradle as a build tool, maybe that particular combination increases the pain. </code></pre> <a href="https://groups.google.com/d/msg/scala-internals/153H3Ya4Nxk/AngkiUE7VUIJ" rel="nofollow">https:&#x2F;&#x2F;groups.google.com&#x2F;d&#x2F;msg&#x2F;scala-internals&#x2F;153H3Ya4Nxk&#x2F;...</a>
tallesover 11 years ago
thats a creative title
adricnetover 11 years ago
I somehow misread this as Scalia (Supreme Court Justice) and thought this was about one of the recent announcements from SCOTUS...
评论 #7058947 未加载