问题描述
我是Scala的忠实粉丝,并且很多概念性工作都投入了打字系统和库。
I am a big fan of Scala aesthetically, and of a lot of the conceptual work put into things like its typing system and libraries.
但是,我有开始修补Scala(看到我的一些同事修补它)我发现自己不得不挖掘越来越多的Java知识(尤其是图书馆的方式)。
However, as I have begun tinkering with Scala (and seen some of my coworkers tinker with it) i find myself having to dig for more and more Java knowledge (especially in the way of libraries).
这给我带来了一些问题:
This presents me with a few problems:
- 从未成为Java程序员,我对Java标准库不熟悉或不熟悉或其他受欢迎的库(如Apache Commons)。
- 我在Java领域的google-fu很弱。很难知道要搜索什么 - 这个问题因为大量无关紧要或基本的Java编程新手编写教程而加剧。
但是,在这一点上,我不确定我是否应该咬紧牙关并尝试通过Java找到最快最全面的游览来吸引自己20年的Java开发,或者是否合理继续尝试逐步修补我的Java知识,因为我在斯卡拉附近闲逛。
At this point though, i'm not sure whether i should bite the bullet and try and find the quickest and most comprehensive tour through Java to catch myself up on 20 years of Java developments, or whether its reasonable to continue trying to incrementally patch my knowledge as i wander around scala.
我们非常感谢scala领导我们提供的任何智慧。
Any wisdom that scala heads amongst us could offer would be greatly appreciated.
PS
我毫不怀疑我能够熟悉Scala语法,并且我对scala社区中的函数式编程和范例非常满意。但是程序员的能力不仅仅基于一个人自学的能力,还有一个人的学习能力,并采用其他人的工具和技能。
P.S.I have no doubt in my ability to familiarize myself with Scala syntax, and i'm perfectly comfortable and happy with functional programming and the paradigms in the scala community. But a programmer's competence is not just based on one's ability to teach oneself, but also one's ability to learn from, and adopt tools and skills from other people.
推荐答案
您应该采用 lazy
方法来学习Java。在需要时学习它。
You should take a lazy
approach to learning Java. Learn it when you need it.
在我看来,许多旧的Java知识已经过时,许多新教程都是多余的。例如,您肯定不想用Java的过时的集合
来打扰自己。可以安全地忽略许多基于Java的框架。并且可以安全地绕过重量级的JavaEE堆栈,直到你被迫使用它的一部分。
In my opinion, much of the old Java knowledge is out of date, much of the new tutorials are redundant. You certainly don't want to bother yourself with Java's antiquated Collections
, for example. Many Java-based frameworks can be safely ignored. And the heavyweight JavaEE stack can be safely bypassed until you were forced to use a part of it.
Java中的许多常见模式在Scala中更简单,前者是带有很多样板代码。核心逻辑应始终在Scala中实现。我相信你可以直接在Scala中完成你的大部分工作,只需要在构建像Swing或与Spring集成等东西时使用Java。
Many common patterns in Java are much simpler in Scala, with the former being burdened with much boilerplate code. Core logic should always be implemented in Scala. I believe you can do most of your work directly in Scala and only need to dip down into Java when building things like Swing or integrating with Spring, etc.
关于选择和使用Java库,我的个人指导原则是:
In regard to choosing and using Java libraries, my personal guidelines are:
- 如果Spring可以这样做,请使用Spring
- 如果Spring太重了,请使用Spring使用的。
- 如果Spring无法做到,请检查github项目
- 如果没有任何内容github,检查Apache项目
- 如果Apache没有任何内容,请检查sourceforge(t)。
- 最后,Google随机或自行构建。
- If Spring can do it, use Spring
- If Spring is too heavyweight, use what Spring uses.
- If Spring can't do it, check github projects
- If there's nothing on github, check Apache projects
- If there's nothing from Apache, check sourceforge(t).
- Finally, Google randomly or just build it yourself.
这有点狡猾,但是我对完成Java后第三方库的成熟度和稳定性的印象过去12年。
That's a bit tounge-in-cheek, but is the impression I get about the maturity and stability of third party libraries after having done Java for the last 12 years.
这篇关于成为一名称职的scala程序员是否需要你成为一名称职的java程序员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!