Scala作为新的Java? [英] Scala as the new Java?

查看:119
本文介绍了Scala作为新的Java?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始在空闲时间探索Scala。

I just started exploring Scala in my free time.

我不得不说到目前为止我印象非常深刻。 Scala位于JVM之上,与现有Java代码无缝集成,并具有Java不具备的许多功能。

I have to say that so far I'm very impressed. Scala sits on top of the JVM, seamlessly integrates with existing Java code and has many features that Java doesn't.

除了学习一门新语言之外,切换到Scala有什么缺点?

Beyond learning a new language, what's the downside to switching over to Scala?

推荐答案

嗯,不足之处在于你必须为Scala做好准备,让它有点粗糙:

Well, the downside is that you have to be prepared for Scala to be a bit rough around the edges:


  • 你将得到奇怪的神秘Scala编译器内部错误

  • IDE支持不如Java(也不是调试支持)

  • 在将来的版本中会有向后兼容性的中断(尽管这些将是有限的)

你还必须承担Scala的风险一种语言就会消失。

You also have to take some risk that Scala as a language will fizzle out.

那就是说,我认为你不会回头看!我的经历总体上是积极的; IDE是可用的,你习惯了神秘的编译器错误意味着什么,虽然你的Scala代码库很小,但向后兼容性中断不是一个主要的麻烦。

That said, I don't think you'll look back! My experiences are positive overall; the IDE's are useable, you get used to what the cryptic compiler errors mean and, whilst your Scala codebase is small, a backwards-compatibility break is not a major hassle.

值得的是 Option ,集合的 monad 功能,闭包 actors 模型,提取器,协变类型等。这是一种很棒的语言。

It's worth it for Option, the monad functionality of the collections, closures, the actors model, extractors, covariant types etc. It's an awesome language.

能够从一个方法来解决问题也是一个很好的个人好处不同的角度,上述结构允许和鼓励的东西。

It's also of great personal benefit to be able to approach problems from a different angle, something that the above constructs allow and encourage.

这篇关于Scala作为新的Java?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆