博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
paip.提升效率--僵尸代码的迷思
阅读量:4466 次
发布时间:2019-06-08

本文共 2264 字,大约阅读时间需要 7 分钟。

paip.提升效率--僵尸代码的迷思
僵尸代码是指你的代码库里被注释掉的那部分代码, 很少去使用它,就像僵尸一样,
看雷kill-the-zombies-in-your-code
================如下是保存僵尸代码的原因..和优点
==a.永远不要信任版本控制系统
svn也许常常crash..或者需要更改地址..或者没网络..网络并不是始终连接的..实际上,大部分时间网络是不好的..
 ((原文:缺乏对版本控制系统作用的信任。有版本控制系统在,删除的代码永远不会真正的死掉。它们被埋到棺材里但却活着。所以,注释代码的方法没有多大实际效用。))
 ==b.今天代码不会真正地死去,,,也许俄们要赞马就要恢复它..
 ==c.使用给注释...many "zombie code"" is not zombie code. It’s inline documentation
 ==d.代码历史..
 ==e。code with doc  ..no code frag..
 
 作者 老哇的爪子 Attilax 艾龙,  EMAIL:1466519819@qq.com
来源: http://blog.csdn.net/attilax
===========disadvantage僵尸代码的缺点
a.关键词搜索--它们就存在我们的代码库中。程序员在维护和重构代码时会和它们遭遇,通常是滚动屏幕时和它们擦肩而过,或是在进行关键词搜索时和它们撞个满怀。但这些代码也确实是死的,
b.增加信噪比,这能够增进理解和快速阅读,并且可以帮助我们免于因误解而写出充满bug的代码。僵尸代码刚好起反作用。它阻碍了代码阅读和维护,因为它减少了屏幕上有意义的内容比例。这是视觉噪音,因为你不能确定自己是否
c.歧义妨碍了调试
d.关键字搜索优化
=============结论:
僵尸代码的好处儿远远大于祸患..所以, 大部分情形哈,还是保存为好...
You make some good points,  in Keyword Search, zombie code will be noise ,is  a disadvance..
in most time ,we should use the ZombieCode..   follow is  same reason to leave  zombie code  ..
==1.network yet not always can connect..or it's more slowly than we need...
if we use svn/git in remote server,,the network is big problem..many place is has no network yet...
and the speed is slowly yet..in the year 2000,many peaple think Net OS will instead of MS Windows OS..but 14 years past, now is year 2014,but where is the NOS??? the NetOS yet can't to use... maybe the netword speed never to fast as  we need...
==2.hardDisk speed never fast as we need ...rebuilt the VCS too trouble..
if we install Version Control System in we local pc ..it maybe slow my pc .and the backup VCS file is bigger than we think..
if we often chang PC or change  harddisk . the restore Backup VCS file is diffuct than think..and rebuilt the VCS too trouble..
==3.Keyword Search:    in this condition ,zombie code is noise,,,but we has many tools to auto clear the "zombieCode" ,then can Keyword Search will be a clearly good result...       but ,we have not a Tool to auto complete the  "zombieCode"  into code file..
==4. sumup::: so, zombieCode is simple,quick,little..  in most time( 80%)  ,we should use the ZombieCode..  only same time (20%),can clear the ZombCode..
原文地址http://www.bitnative.com/2012/10/22/kill-the-zombies-in-your-code/

转载于:https://www.cnblogs.com/attilax/p/5964020.html

你可能感兴趣的文章
Jsp通过JDBC连接到SQL Server2008数据库遇到的几个问题
查看>>
idea 不能编译生成class文件
查看>>
javascript原生百叶窗
查看>>
单播组播和广播
查看>>
JSPatch - iOS 动态补丁
查看>>
eclipse设置和优化
查看>>
WinFrom玩转config配置文件
查看>>
IIS服务中五种身份验证
查看>>
c#网络编程-第一章
查看>>
paip.提升效率--僵尸代码的迷思
查看>>
Atitit 自动化gui 与 发帖机 技术
查看>>
Atitit.研发团队与公司绩效管理的原理概论的attilax总结
查看>>
编程模式之装饰模式(Decorator)
查看>>
MVC中关于 使用后台代码 检查 用户名是否已经被清册
查看>>
匿名函数
查看>>
nginx相关
查看>>
(各个公司面试原题)在线做了一套CC++综合測试题,也来測一下你的水平吧(二)...
查看>>
多种选择(Switch)
查看>>
[设计模式] .NET设计模式笔记 - 有多少种设计模式
查看>>
笔记52 Mybatis快速入门(三)
查看>>