[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 

H2
H3
H4
3 columns
2 columns
1 column
6 Comments