How to accept the fact that you can not remove the bad code to the project?

Not so long ago began to work on the project (Beck + front). Faced with low-quality code, which is repeatedly superimposed. If Beck somehow can fix what I don't like, add documentation, then at the front is extremely a lot of GTA V on garage door, nothing documented, and reusable code business as usual. Because of this, the file bloated up to several thousand lines. To correct anything it is impossible, as it works, what to do?
March 23rd 20 at 19:21
9 answers
March 23rd 20 at 19:23
Solution
Well, since you sir, to take and to fix. Ah, you are sir? Well then don't try to be clever.
Prestiti for being rude. Works - don't touch.
Works - don't touch

And somehow the boy scout rule "Leave after itself better than it was before you"? :-) - Rossie.Rosenbaum commented on March 23rd 20 at 19:26
@Rossie.Rosenbaum, +1
No need to rush with his sword and all of them. A little here and there to make corrections. - Estell_Greenho commented on March 23rd 20 at 19:29
especially when they say not to waste time on refactoring and test coverage - there's no time, it's all hands on deck.. but with the current project the same situation - Imani_Bedn commented on March 23rd 20 at 19:32
March 23rd 20 at 19:25
To score and get the cash
March 23rd 20 at 19:27
To accept. Refactoring is rarely included in the roadmap of projects in organizations and the reasons for this are several:
- works don't touch (don't wanna break it to repair will)
- why pay for the same result (hardly anyone except the developers understand why they need refactoring)

If accept fails:
- make an assessment of the changes
- make a list of pros and risks of this event
- put this decision-making people in the organization

If everything is done correctly and expenditure is commensurate to business, but the advantages are enough that the idea of support. If not then see 1.
March 23rd 20 at 19:29
To make a presentation to the business leadership, to draw in the beginning a big scary problem, and graphs of growth of cost of support and service, drop conversion and so on. Next slides listing the benefits of refactoring. For example - the introduction of new features will reduce time and cost on the X-and Y-changes to existing features - on 5X and 5Y. The cost of support and development of the project will go down in X times, the cost of testing will decrease to Y. the Load and the server costs will fall by X, the speed of loading pages will increase by Y, the indices Bounce Rate will decrease to Z, the conversion rate will increase by at least X and so and so. Well, if the presentation along with the business will see marketing - for them these things are important, too. The business understands the actual bad code as a philosophical concept - does not understand.

And most importantly - the presentation should contain a concrete proposal. Something like "on the refactoring will need a Min-Max hours, but not to stop the work we're doing in parallel on the 3rd priority after bug/sekyuriti critical fixes and new features, highlighting it X hours a week."

Decision makers must understand that business will eventually be profitable and the current task is not appreciably affected.

PS: of course this is all slightly exaggerated for clarity, but the essence I think is clear.
Here is too much. So much work is not required to conduct - Juliana_Ritchie69 commented on March 23rd 20 at 19:32
@Juliana_Ritchie69Depends on the specific company and its size, the number of departments up and Lprof, the project size and many more parameters. Shared a personal experience from a large international company where my team and I are the developers of company's website and support them on a long term contract. Talk about the need of refactoring was carried out from our side within 2 years, the effect is zero. One high-quality presentation that has been collected need people in less than an hour allowed to make all the necessary decisions, in pursuit to rewrite and renew the support contract, which was substantially extended and added hours on refactoring. - lamont21 commented on March 23rd 20 at 19:35
@lamont21in a large Enterprise Junior developer for all of the above actions will fire for wasting man-hours - Juliana_Ritchie69 commented on March 23rd 20 at 19:38
@Juliana_Ritchie69, read carefully - I'm not a Junior developer, and external vendors, senior and at the same time, a consultant who helps with problems and get solutions. - lamont21 commented on March 23rd 20 at 19:41
@Juliana_Ritchie69, And Yes, even if you are a Junior developer in enterprise, then all that remains is changing the schema only. First, the idea transfer to the Lido, then to the CTO, and then combined efforts to business. The complexity of this process of course exceeds the limit, the probability of a positive outcome tends to zero, but still. - lamont21 commented on March 23rd 20 at 19:44
@lamont21, I mean the author, not you) the cases are completely different - Juliana_Ritchie69 commented on March 23rd 20 at 19:47
@lamont21,
Ivan Noise, And Yes, even if you are a Junior developer in enterprise, then all that remains is changing the schema only. First, the idea transfer to the Lido, then to the CTO, and then combined efforts to business.


B - bureaucracy - Juliana_Ritchie69 commented on March 23rd 20 at 19:50
@Juliana_Ritchie69, absolutely. And survive / achieve their goals in this environment is possible only in the same way - to develop bureaucratic skills and use. - lamont21 commented on March 23rd 20 at 19:53
@Juliana_Ritchie69,
I mean the author, not you) the cases are completely different

well, I'm nowhere in the text did not see that it is June in in the boat of fortune 500 :)
the person asked Council, I gave an example of how to talk to non-developers in their language. The scale is different, the essence is the same. - lamont21 commented on March 23rd 20 at 19:56
@lamont21if the lead and CTO is made under their leadership, it is better not to be - not teach anything good. Not the task of the youngest quite - Juliana_Ritchie69 commented on March 23rd 20 at 19:59
@lamont21,
well, I'm nowhere in the text did not see that it is June in in the boat of fortune 500 :)
the person asked Council, I gave an example of how to talk to non-developers in their language. The scale is different, the essence is the same.


just look in the profile of the person - Juliana_Ritchie69 commented on March 23rd 20 at 20:02
@Juliana_Ritchie69, but with this, I completely agree. I would such a ship fled before rats. - lamont21 commented on March 23rd 20 at 20:05
March 23rd 20 at 19:31
To quit
March 23rd 20 at 19:33
Often and much to demonstrate to frontenders neglect, on the occasion to make condescending statements like "Oh, Well, someday you will become real programmers" and "Yes, I understand, not everyone". All the objections to genuinely wonder and ask "why are you offended, you have the same motley logs and bad code mixed up with spaghetti code." Not the fact that will help, but at least fun. The main thing is not to go too far with criticism, it should looks genuinely friendly.
March 23rd 20 at 19:35
The correct answer is a combination of the data above already answers (to Score and get the cash || to Quit)
March 23rd 20 at 19:37
Read the book "effective operation with the legacy code" and think about how to achieve the confidence that you won't break anything when refactoring.

If you don't have something from what is below to try to implement it:
- automated tests
- continuous integration
- code review or pair programming
- automatic refactoring
- static validation (typescript, for example)

To begin to analyze the statistics on causes of error - often it is bad code.

In the calculation of time for revision note at that time which occurs due to bad code and on the time that is necessary to be able to test the changes manually.

Try to convince management to implement automated testing, based on the facts above. Introduce it gradually, first for new code that's easy to test. When it will get used to the tools and start writing good tests, you can cover the old code before the changes.

Something like that
March 23rd 20 at 19:39
Write the optimizer.

Find more questions by tags Designing softwareProgramming