当前位置:网站首页>六石编程学:关于代码,有六个得意
六石编程学:关于代码,有六个得意
2022-07-04 18:37:00 【柳鲲鹏】
吾常常为自己的代码而得意。为什么得意?当然是自己都觉得好。自己觉得好,其实也是对比出来的。于是仔细思考了一下,总结了六个得意:
- 清理了无用代码
这些代码(含注释)放着也没有人用,留着完全是浪费精力。
有人问,哪一天需要参考怎么办?现在有版本管理,检出即可。
- 规范命名
通过命名,准确清楚的表达出含义,其实并不容易。得益于本人的语言用词专长,在这一点上吾是远超他人。
- 对齐
对齐代码,是六石编程学的独特主张。通过对齐,代码变得整齐漂亮,赏心悦目。
- 去掉了怪异代码
什么叫怪异代码?就是没有任何根据、来源,没有道理,可能是解决某个问题的代码。比如:莫名其妙的加上了一个值(如0.25),或者乘上了一个系数,或者一段代码专门应付某种情况。
- 合并代码
吾常常通过加参数,把类似代码进行合并。这样代码量能减少一些,感觉很多,实际上比预计的要少。关键是能避免怪异错误,一处修改全部正确。
- 运用技巧
为了解决问题,运用了别人几乎想不到(指或者参与相关工作的人)的技巧。当然是非常得意的。
边栏推荐
- ACM组合计数入门
- Kotlin basic data type
- BCG 使用之CBCGPProgressDlgCtrl進度條使用
- 解密函数计算异步任务能力之「任务的状态及生命周期管理」
- Decryption function calculates "task state and lifecycle management" of asynchronous task capability
- Introduction to ACM combination counting
- Neural network IOT platform construction (IOT platform construction practical tutorial)
- BCG 使用之CBCGPTabWnd控件(相当于MFC TabControl)
- Educational Codeforces Round 22 E. Army Creation
- Actual combat simulation │ JWT login authentication
猜你喜欢
Detailed explanation of Audi EDI invoice message
c# .net mvc 使用百度Ueditor富文本框上传文件(图片,视频等)
CANN算子:利用迭代器高效实现Tensor数据切割分块处理
Decryption function calculates "task state and lifecycle management" of asynchronous task capability
In operation (i.e. included in) usage of SSRs filter
"Only one trip", active recommendation and exploration of community installation and maintenance tasks
输入的查询SQL语句,是如何执行的?
Actual combat simulation │ JWT login authentication
Cbcgptabwnd control used by BCG (equivalent to MFC TabControl)
Mysql database basic operation -ddl | dark horse programmer
随机推荐
Jetpack compose tutorial
1007 maximum subsequence sum (25 points) (PAT class a)
92.(cesium篇)cesium楼栋分层
In the first month of its launch, the tourist praise rate of this campsite was as high as 99.9%! How did he do it?
In operation (i.e. included in) usage of SSRs filter
Key rendering paths for performance optimization
Mysql database basic operation -ddl | dark horse programmer
Educational Codeforces Round 22 E. Army Creation
HDU 1097 A hard puzzle
C language - Introduction - Foundation - grammar - process control (VII)
Niuke Xiaobai month race 7 F question
CANN算子:利用迭代器高效实现Tensor数据切割分块处理
The explain statement in MySQL queries whether SQL is indexed, and several types in extra collate and summarize
[graduation season] green ant new fermented grains wine, red mud small stove. If it snows late, can you drink a cup?
Cbcgpprogressdlgctrl progress bar used by BCG
Delete the characters with the least number of occurrences in the string [JS, map sorting, regular]
abc229 总结(区间最长连续字符 图的联通分量计数)
Optimize if code with policy mode [policy mode]
Neural network IOT platform construction (IOT platform construction practical tutorial)
实战模拟│JWT 登录认证