gpt4 book ai didi

java - Java 有编码标准吗?

转载 作者:搜寻专家 更新时间:2023-11-01 01:11:41 24 4
gpt4 key购买 nike

我可以开发一个应用程序/项目。但这不是正确的编码标准。它需要很大的内存,其他人不容易理解。编码的通用标准是什么。我有一个问题,例如如何命名变量方法以及打包类的最佳方法是什么。像那样?

为此,是否有任何教程或示例请分享。

提前致谢。

最佳答案

您需要的是最佳实践 (JAVA) 及其工作原理。

我会推荐一个旧的post

作为Macarse说:

Have you read Effective Java? http://java.sun.com/docs/books/effective/

There is a good amount of good code in it.

要了解事情是如何完成的(以最好的方式),我会建议经常检查其他人的代码,尤其是开源项目。

You can always check the jdk source code, there are some good algorithms around it: http://java.sun.com/j2se/1.5.0/source_license.html

Also, sometimes I use to research some good open source apps code...

edited: Also is a good idea to participate in communities like this....

Check this out: http://www.javadb.com/

作为Naiku说:

The best option for you to study good code is to look at some popular open source projects. I think 2 years is good enough time to understand code in these projects. Some of the projects you could look at:

* openjdk
* apache tomcat
* spring framework
* apache commons (very useful)
* Google collections

Enough for you to study and understand a variety of concepts. I frequently study code in JDK catalina(tomcat), spring, jboss, etc.

对于 Java Memory Management看这个Question

关于java - Java 有编码标准吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3615348/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com