[Code Review Series] - Value Not Used [坑爹的代码] - 变量未使用
I thought it will be nice to share some code-review experience from time to time. A code-review is important and necessary for PR (Pull Requests) to merge to the development/release branch. But sometimes, a minimal 2 reviewers are not sufficient e.g. once, a PR with irrelevant change has been merged to development branch even with 2 reviewers 'Approved'. Later... these reviewers were 'punished' by bringing in donuts!
The feeling when you care so much to not break something and then you find out later that the value is not used. PS: It is strange that the R# has not identified these as useless code.
工作中代码审核是非常重要的,我觉得有时候分享这些坑是件很有意义的事情。有一次,有一个PR(代码提交)被2个工程师成功审核了,但是之后发现那个PR带了一些不该带的改动,结果就是那两个评审被惩罚带些吃的(甜甜圈)给大家分享。
每次你都很小心,生怕把功能给改错了(即使有少量的单元测试,但是你还是不放心), 后来你发现,这代码绝B是个坑,浪费了你大好的时间,结果这变量声明了根本就没有用到..
很奇怪的是, 像 Resharper这样的代码质量工具竟然没有把无用的代码给标灰。。。
Originally published at https://steemit.com Thank you for reading my post, feel free to FOLLOW and Upvote @justyy which motivates me to create more quality posts.
原创首发于 https://steemit.com 非常感谢阅读, 欢迎FOLLOW和Upvote @justyy 能激励我创作更多更好的内容.
近期热贴 Recent Popular Posts
- 第一次打肿脸充胖子 - 花了200STEEM租1万SP四周!
- 别让SteemIt毁了你原本的生活 (新老用户都应该看一看) Don’t Let SteemIt Ruin Your Life!
- Technically Images can be Stored on BlockChain 差一点 SteemIt 就可以把图片也存在区块链上了
- 从互联网广告(Adsense)来谈谈 影响 SteemIt 的收入因素
- [机器学习] 用 MySQL 来演示 KNN算法 The K Nearest Neighbor Algorithm (Prediction) Demonstration by MySQL
- XY + XY = YZZ 大白 + 大白 = 白胖胖
- The Fox 英式午餐
- Early Autumn 2017, Cambridge, UK (Photography) 英国慢节奏的村庄生活 – 每日散步村口溜娃
- Software Engineer Interview Question – How to Improve Dynamic Programming Space Complexity? 进一步改进动态规化的空间复杂度
- 24 Poker Game 24点扑克游戏
i upvoted your post plz upvote me back !!
Congratulations @justyy! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
Award for the total payout received
Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here
If you no longer want to receive notifications, reply to this comment with the word
STOP
total payout received? so how much is that?
没看懂,看不懂。
我以前写代码时,那时候用类似editPlus,变量都是在用到时才声明,否则很容易出现声明了但却一直未用到的。后来的编辑器都自带了这种检查,好多了。
@justyy got you a $1.59 @minnowbooster upgoat, nice! (Image: pixabay.com)
Want a boost? Click here to read more!