继承的代码:要格式化还是不格式化? [英] Inherited code: To format or not to format?

查看:110
本文介绍了继承的代码:要格式化还是不格式化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的团队最近继承了极其混乱的代码。

Our team has recently inherited code which is extremely disorganized.

因此,我的团队负责人决定在保存文件之前实施自动格式化代码的策略。我们甚至在E​​clipse(我们选择的IDE)中找到了一个选项,可以在每次保存操作之前自动对代码进行自动格式化。

As a result, my team leader has decided to enforce a policy of auto-formating of code prior to saving a file. We have even found an option in Eclipse (The IDE of our choice) that auto-formats the code automatically before each save action.

我个人反对,因为我认为正确的编码可以防止混乱的代码(大多数情况下),而自动格式化并不意味着正确的编码。

Personally I am against it because I think that proper coding prevents messy code (most of the time) whereas auto-formating does not mean proper coding.

您有何意见?

推荐答案

仅对格式化的代码进行一次自动格式化,然后继续进行而不进行自动格式化。

Auto-format the inherited code just once, and then proceed without auto-formatting.

这篇关于继承的代码:要格式化还是不格式化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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