Comments (4)
记不住说明代码写的不够好,就该重构了,变量名字改的通俗一点,该封装的方法封装起来,参考:重构
from coding2017.
变量名命名应尽量能表达其真实意义,不要怕名字太长
加上有效的 javadoc 注释,
from coding2017.
除了名字需要起的通俗易懂,读别人代码的时候要做做笔记,好记性不如烂笔头。
from coding2017.
个人理解,首先规范的编码,良好的命名规范 能帮助我们省去很多精力,其次,有一些小技巧,整个系统里面变量会很多,如果都要记住确实不可能,我们应该记住全局的一些变量,我们只需要记住一些大概,IDE会帮我们自动补全,个人理解需要下点功夫记住的变量
1.常量类
2.工具类
3.bean 开发中需要用到各种bean来进行数据的传递,里面的属性大多和数据库的字段对应
4.各个模块的接口和dao ,这个每个系统都有一些自己的规范,例如常用的 userService userDao 等。
这些都是常用的一些东西,如果在用到的时候能根据IDE提示直接写出来会加快我们的开发效率。
局部变量我们并不需要去关心,在方法内部的是局部变量,而方法就是提供服务的。我们不需要关心这个方法具体实现细节,它内部有可能 使用很多变量来实现一些业务逻辑或者算法之类。我们只需要调用它给我提供服务即可。
from coding2017.
Related Issues (20)
- 通过看源码,大家学到了什么? HOT 5
- How to get into the habit of using Git and Github? HOT 1
- 查询分页的问题 HOT 2
- 线上内存泄漏问题排查 HOT 2
- 大家有没有研究过Go语言,觉得它有哪些应用场景是比较适合的?
- 聚集索引与非聚集索引区别
- 多台机跑Job的问题 HOT 7
- 有没有类似于Junit的“小目标”
- volatile 关键字的可见性问题 HOT 1
- Java中的异常对性能影响大么?如果是,为什么会造成这样的?
- 薪水支付系统有没有完整版的,能运行的,或者包括数据库的,我想参考一下
- 学Java该如何尝试写博文呢? HOT 4
- 关于计算机基础一些理解混乱问题 求解
- SVN分支、合并在实际开发中的应用
- 如何测试Web并发量 HOT 2
- Java 中在泛型中 extends 与super的区别 HOT 1
- 关于java线程抢占式调度的几个问题。
- 【关于就业】应届生出去之后第一家应该去什么公司? HOT 2
- SpringMVC配置多个模板视图问题 HOT 1
- elasticsearch问题:一个索引index对应几个分片好呢?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coding2017.