您如何说服您的经理您的项目需要进行大量重构? [英] How do you convince your manager that your project needs a huge refactoring?

查看:46
本文介绍了您如何说服您的经理您的项目需要进行大量重构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我作为承包商加入了 Rails 项目.该项目已经进行了一年多.代码由大约 10 个不同的开发人员编写,其中大多数也是承包商.他们有不同的代码风格.其中一些来自Java.该代码的 metric_fu 得分很糟糕.许多函数非常长(100 - 300 行).一些函数有大量的逻辑分支、循环和递归.每个请求都会生成大量的 sql 查询.性能非常糟糕.许多从未使用过但从未有机会清理的过时代码.核心架构明显错误或过度设计.代码覆盖率只有 25% 左右.视图和部分是混乱和可怕的阅读和理解.

I have joined a rails project as a contractor. The project has been going for more than a year. The code is written by about 10 different developers and most of them are contractors as well. They have different code style. Some of them came from Java. The code has horrible scores with metric_fu. Many functions are very long (100 - 300 lines). Some functions have insane amount of logical branches, loops, and recursions. Each request generates a ton of sql queries. Performance is very bad. Many obsolete code that are never used but never got the chance to be cleaned up. The core architecture is plain wrong or over engineered. Code coverage is only about 25%. Views and partials are chaotic and terrible to read and understand.

经理可以通过不断添加新功能来满足 CEO 的需求,但是越来越难以正确实施新功能而不破坏其他功能.他知道代码很糟糕,但不想花太多精力来修复它们,因为重构需要很长时间.

The manager is in a position trying to satisfy the CEO by continuously adding new features, however newer features are increasingly hard to get implemented correctly without breaking something else. He knows the code is bad, but doesn't want to put too much effort in fixing them as refactoring will take too long.

作为承包商/开发商,有什么好方法可以清除这种情况并方便经理或 CEO 分配一些时间进行重构?

As a contractor / developer, what is a good way to clear this situation and convenience the Manager or CEO to partition some time for refactoring?

相关问题

我该怎么办说服持怀疑态度的管理层和同事允许重构糟糕的代码?

如何重构预算

与不合逻辑的经理打交道

推荐答案

在我有限的经验中:

  1. 让经理相信有必要留出时间进行重构是不可能的.你可以让他意识到这一点,并在每次你因为糟糕的代码遇到问题时强调这一点.然后继续前进.希望你的老板能解决这个问题.

  1. It's impossible to convince a manager that it's necessary to set aside time to refactor. You can make him aware of it, and reinforce the point every time that you run into an issue because of bad code. Then just move on. Hopefully your boss will figure it out.

进入一个正在运行的项目并认为这完全是垃圾"是很常见的.给它一些时间.您可能会开始在疯狂中看到一种模式.

It's quite common to get in on a running project and think "this is total junk". Give it some time. You might begin to see a pattern in the madness.

这篇关于您如何说服您的经理您的项目需要进行大量重构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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