java - 为什么Android代码风格不遵循google java代码风格

标签 java android coding-style

<分区>

我是一名 java 开发人员,有一段时间遵循 Google 的 java 代码风格,我是 Android 编程的新手。

我对为什么 Android Java 代码风格与 Google 的 Java 代码风格不同很感兴趣。

比如android的字段命名约定

Follow Field Naming Conventions

Non-public, non-static field names start with m. Static field names start with s. Other fields start with a lower case letter. Public static final fields (constants) are ALL_CAPS_WITH_UNDERSCORES.

http://source.android.com/source/code-style.html#follow-field-naming-conventions

但在 Google 代码风格中,不需要 ms

In Google Style special prefixes or suffixes, like those seen in the examples name_, mName, s_name and kName, are not used.

http://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s5.1-identifier-names

所以我想知道android有自己的命名风格有什么好处。

既然它也是一个 Google 开源项目,为什么不遵循 Google 代码风格呢?

最佳答案

Android 平台风格指南在 Google 开发之前就已存在。

关于java - 为什么Android代码风格不遵循google java代码风格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26387905/

相关文章:

java - Spring Data MongoDB 集合聚合

java - 如何像在 Cocos2d 中那样在 Libgdx 中将子图像添加到 Sprite 中?

android - Simon Ics 日期选择器对话框抛出 android.view.InflateException : Binary XML file line #20: Error inflating class net. simonvt.widget.DatePicker

android - 有没有办法强制通过 4G 网络连接,即使启用并连接了 WiFi?

c - 你认为这种糟糕的编码风格吗?

java - mXn 矩阵从左上角到右下角的所有可能路径

java - Dropwizard的CheckCommand有什么用途?

java - ReentrantLock 与 CPU 级别上的同步?

coding-style - 文件名的定义?

c++ - 您是否将信息添加到每个 .hpp/.cpp 文件的顶部?