当前位置:网站首页>六石编程学:关于代码,有六个得意
六石编程学:关于代码,有六个得意
2022-07-04 18:37:00 【柳鲲鹏】
吾常常为自己的代码而得意。为什么得意?当然是自己都觉得好。自己觉得好,其实也是对比出来的。于是仔细思考了一下,总结了六个得意:
- 清理了无用代码
这些代码(含注释)放着也没有人用,留着完全是浪费精力。
有人问,哪一天需要参考怎么办?现在有版本管理,检出即可。
- 规范命名
通过命名,准确清楚的表达出含义,其实并不容易。得益于本人的语言用词专长,在这一点上吾是远超他人。
- 对齐
对齐代码,是六石编程学的独特主张。通过对齐,代码变得整齐漂亮,赏心悦目。
- 去掉了怪异代码
什么叫怪异代码?就是没有任何根据、来源,没有道理,可能是解决某个问题的代码。比如:莫名其妙的加上了一个值(如0.25),或者乘上了一个系数,或者一段代码专门应付某种情况。
- 合并代码
吾常常通过加参数,把类似代码进行合并。这样代码量能减少一些,感觉很多,实际上比预计的要少。关键是能避免怪异错误,一处修改全部正确。
- 运用技巧
为了解决问题,运用了别人几乎想不到(指或者参与相关工作的人)的技巧。当然是非常得意的。
边栏推荐
- Allure of pytest visual test report
- Neural network IOT platform construction (IOT platform construction practical tutorial)
- Pythagorean number law (any three numbers can meet the conditions of Pythagorean theorem)
- Pytoch learning (4)
- Delete the characters with the least number of occurrences in the string [JS, map sorting, regular]
- mysql中explain语句查询sql是否走索引,extra中的几种类型整理汇总
- 1009 product of polynomials (25 points) (PAT class a)
- ACM组合计数入门
- 实战模拟│JWT 登录认证
- kotlin 继承
猜你喜欢
Cbcgpprogressdlg progress bar used by BCG
92.(cesium篇)cesium楼栋分层
node_ Exporter deployment
Neural network IOT platform construction (IOT platform construction practical tutorial)
What should we pay attention to when doing social media marketing? Here is the success secret of shopline sellers!
ACM组合计数入门
多表操作-内连接查询
The explain statement in MySQL queries whether SQL is indexed, and several types in extra collate and summarize
C语言-入门-基础-语法-流程控制(七)
Dark horse programmer - software testing - stage 08 2-linux and database-23-30-process port related, modify file permissions, obtain port number information, program and process related operations, Li
随机推荐
1009 product of polynomials (25 points) (PAT class a)
New wizard effect used by BCG
实战模拟│JWT 登录认证
多表操作-外连接查询
Educational Codeforces Round 22 E. Army Creation
Kotlin classes and objects
Development and construction of DFI ecological NFT mobile mining system
English语法_名词 - 使用
kotlin 循环控制
The explain statement in MySQL queries whether SQL is indexed, and several types in extra collate and summarize
Pointnext: review pointnet through improved model training and scaling strategies++
"Only one trip", active recommendation and exploration of community installation and maintenance tasks
水晶光电:长安深蓝SL03的AR-HUD产品由公司供应
1009 Product of Polynomials(25 分)(PAT甲级)
上线首月,这家露营地游客好评率高达99.9%!他是怎么做到的?
欧拉函数
Siemens HMI download prompts lack of panel image solution
Educational codeforces round 22 E. Army Creation
西门子HMI下载时提示缺少面板映像解决方案
Chrome development tool: what the hell is vmxxx file