When to remove new outdated code?

I spent a month developing a complex payment system that processes both credit card payments and electronic funds transfers. My work was used on a production server for about a month. Recently I was informed that he no longer wants to use the electronic media transfer function.

Since the way I had to interact and interact with the credit card gateway is very different from the electronic transfer of api funds (for example, cc gives answers to transactions immediately after an http request, while eft gives answers to transactions 5 business days after HTTP request), I spent a lot of time creating my own API for abstract calling common functions, for example

pay function (amount, pay_method, pay_freq)

function updateRecurringSchedule (user_id, new_schedule)

etc..

Now that the client wants to abandon the EFT function, all my work for this abstract payment API is out of date.

I am discussing whether I should give up my work. Here is my pro vs. con for recycling now:

PRO 1: Eliminate bloat code

PRO 2: new developers do not need to learn MY API. They only need to read the CC API

PRO 3: EFT , , . API CC , , . , EFT , CC , , , ..

CON 1: EFT, , , .

CON 2: PRO 3 , CC.

CON 3: , . , - . - , " ".

CON 4: . -, ( db), - . , , , , -.

, , ? , X ?

CON 4

+3
4

, , , , . , .

PRO 3: EFT , , . API CC , , . , EFT , CC , , , ..

CON 2: PRO 3 , CC.

, , , . .., , , CC API?

, , ROI. , Return On Investment, , EFT, ? .

+3

VCS , .

+8

. . , , , . , . , .

+4

, , . , .

, , , . , . , - , .

Yes, you can reuse part of this code again, so a version control system is a good thing. But the next time you have such a requirement, it will probably be another second system that will lead to a different abstraction.

That is, it will lead to another abstraction, if you do not bind it to the original abstraction, keeping the old code.

+2
source

Source: https://habr.com/ru/post/1746692/


All Articles