Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you convince your manager that your project needs a huge refactoring? [closed]

Tags:

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.

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.

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?

Related Questions

How can I convince skeptical management and colleagues to allow refactoring of awful code?

How to refactor on a budget

Dealing with illogical managers

like image 947
Aaron Qian Avatar asked Aug 26 '09 08:08

Aaron Qian


People also ask

How do you justify refactoring?

Refactoring is typically justified by delivering value elsewhere; whether through making new features and functionality easier/faster to build or delivering some other benefit, such as easing the upgrade process or minimizing support burden. All of these are very valid reasons to take on a refactoring project.


1 Answers

In my limited experiance:

  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.

  2. 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.

like image 125
Alterlife Avatar answered Sep 23 '22 09:09

Alterlife