TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Transitioning to Scala

29 点作者 jlward4th大约 11 年前

4 条评论

zenbowman大约 11 年前
I think this is a well-thought out article. We use Scala quite extensively at Hulu, and it is important to use its more powerful features only when they really make sense. You can do quite amazing things with the language, but it doesn&#x27;t mean you should.<p>I think a classic example of going overboard with Scala is a dispatch library - even as someone who writes Scala extensively, it is incomprehensible to me. On the other hand, for certain tasks, being able to craft an internal DSL is a great thing. For a hobby project I once wrote a DSL for a simplex solver in Scala, turned out pretty neat: <a href="https://github.com/ZenBowman/AIMA/blob/master/src/test/scala/org.zenbowman.linearprogramming/LPLangTest.scala" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ZenBowman&#x2F;AIMA&#x2F;blob&#x2F;master&#x2F;src&#x2F;test&#x2F;scala...</a><p>And then there&#x27;s a great version of embedded BASIC in Scala: <a href="https://github.com/fogus/baysick" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;fogus&#x2F;baysick</a><p>With great power comes great responsibility, and it is important to remember the Perlis rule: Syntactic sugar causes cancer of the semicolon
ludicast大约 11 年前
Good article.<p>Reminds me of the fact that though Thoughtworks has Scala listed as a language to adopt, they narrow it down to &quot;the good parts&quot;: <a href="http://www.thoughtworks.com/radar/#/languages-and-frameworks/257" rel="nofollow">http:&#x2F;&#x2F;www.thoughtworks.com&#x2F;radar&#x2F;#&#x2F;languages-and-frameworks...</a><p>I really wish the language was less like C++ in that you need to know 1000 things to read other people&#x27;s code. But other than that, a really wild future for Scala.
the_af大约 11 年前
Interesting article. I&#x27;m puzzled by one example, though. When the author says he favors the signature:<p><pre><code> def reverse[A]: List[A] =&gt; List[A] </code></pre> while Tony Morris would argue for:<p><pre><code> def &lt;-:[A, B](f: A =&gt; B): List[A] =&gt; List[B] </code></pre> I&#x27;m puzzled. They are not two different styles of writing the type signature for the same function! You can tell at a glance that the type signature for &quot;&lt;-&quot; allows functions more general than &quot;reverse&quot;. So he is not talking about the same function.<p>Or did I misunderstand something?
评论 #7535317 未加载
elwell大约 11 年前
&gt; That’s the beauty of Scala. Tony is right. I am right. There’s no wrong, there’s simply a matter of personal and team preference.<p>That&#x27;s not really a good thing; at least not for maintainability. You have to learn a new grammar for every codebase.
评论 #7535257 未加载