Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
术语“过时代码”和“废弃代码”有什么区别?如果存在差异,哪些方法可以减少?
就我个人而言,我会说过时的代码是存在但不再使用的方法。例如不推荐使用的方法/函数。我将浪费代码定义为仅具有减慢应用程序速度的功能的代码。
过时的代码:
过去可能有用但不再使用的代码,例如使用已弃用协议的代码。
废物代码:
从未听说过这个术语,但我想 - 可能会或可能不会执行的代码可以在不改变应用程序工作方式的情况下删除。我想这将包括过时的代码。
以上任何一个都可以从单个语句到整个库。