你如何处理冗余代码? [英] What do you do with redundant code?

查看:73
本文介绍了你如何处理冗余代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个类,它是为不再需要的特定目的而编写的代码库项目的一部分.所以问题是你如何处理这样的代码?您是简单地删除它,还是记住它,未来的开发人员可能会遇到它而没有意识到他们可以忽略它,或者您是否有某种存档系统,是否存在公认的模式"?使用...

I have a class, which is part of a code library project that was written for a particular purpose that is no longer required. So the question is what do you do with code like this? Do you simply delete it, or do you leave it in bearing in mind that future developers may come across it and not realise that they can disregard it or do you have some sort of archive system, is there a recognised "pattern" that is in use...

推荐答案

删除它.您以后可以随时从版本控制系统取回它.你确实有版本控制,不是吗?

Delete it. You can always get it back from the version control system later. You do have version control, don't you?

这篇关于你如何处理冗余代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆