You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/05/10 01:27:34 UTC

[GitHub] [flink-web] wuchong commented on a change in pull request #267: [FLINK-13682][docs-zh] Translate "Code Style - Scala Guide" page into Chinese

wuchong commented on a change in pull request #267:
URL: https://github.com/apache/flink-web/pull/267#discussion_r422568916



##########
File path: contributing/code-style-and-quality-scala.zh.md
##########
@@ -8,68 +8,67 @@ title:  "Apache Flink Code Style and Quality Guide  — Scala"
 
 
 
-## Scala Language Features
+## Scala 语言特性
 
-### Where to use (and not use) Scala
+### 在哪儿使用(和不使用) Scala
 
-**We use Scala for Scala APIs or pure Scala Libraries.**
+**我们使用 Scala 的 API 或者纯 Scala 库。**
 
-**We do not use Scala in the core APIs and runtime components. We aim to remove existing Scala use (code and dependencies) from those components.**
+**在 core API 和 运行时的组件中,我们不使用 Scala。我们的目标是从这些组件中删除现有的 Scala 使用(代码和依赖项)。**
 
-⇒ This is not because we do not like Scala, it is a consequence of “the right tool for the right job” approach (see below).
+⇒ 这并不是因为我们不喜欢 Scala,而是考虑到“用正确的工具做正确的事”的结果(见下文)。
 
-For APIs, we develop the foundation in Java, and layer Scala on top.
+对于 API,我们使用 Java 开发基础内容,并在上层使用 Scala。
 
-* This has traditionally given the best interoperability for both Java and Scala
-* It does mean dedicated effort to keep the Scala API up to date
+* 这在传统上为 Java 和 Scala 提供了最佳的互通性
+* 这意味着要致力于保持 Scala API 的更新
 
-Why don’t we use Scala in the core APIs and runtime?
+为什么我们不在 core API 和运行时中使用 Scala ?
 
-* The past has shown that Scala evolves too quickly with tricky changes in functionality. Each Scala version upgrade was a rather big effort process for the Flink community.
-* Scala does not always interact nicely with Java classes, e.g. Scala’s visibility scopes work differently and often expose more to Java consumers than desired
-* Scala adds an additional layer of complexity to artifact/dependency management.
-    * We may want to keep Scala dependent libraries like Akka in the runtime, but abstract them via an interface and load them in a separate classloader, to keep them shielded and avoid version conflicts.
-* Scala makes it very easy for knowledgeable Scala programmers to write code that is very hard to understand for programmers that are less knowledgeable in Scala. That is especially tricky for an open source project with a broad community of diverse experience levels. Working around this means restricting the Scala feature set by a lot, which defeats a good amount of the purpose of using Scala in the first place.
+* 过去的经验显示, Scala 在功能上的变化太快了。对于 Flink 社区来说,每次 Scala 版本升级都是一个需要付出相当大努力的过程。
+* Scala 并不总能很好地与 Java 的类交互,例如 Scala 的可见性范围的工作方式不同,而且常常向 Java 消费者公开的内容比预期的要多。
+* Scala artifact/dependency 的管理增加了一层额外的复杂性。
+    * 我们可能希望在运行时保留像 Akka 这样依赖 Scala 的库,但是要通过接口抽象它们,并在单独的类加载器中加载它们,以保护它们并避免版本冲突。
+* Scala 让懂 Scala 的程序员很容易编写代码,而对于不太懂 Scala 的程序员来说,这些代码很难理解。对于一个拥有不同经验水平的广大社区的开源项目来说,这尤其棘手。解决这个问题意味着大量限制 Scala 特性集,这首先就违背了使用 Scala 的很多目的。
 
 
-### API Parity
+### API 同等

Review comment:
       "API 等价" ?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org