When to delete newly deprecated code?

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-05-22T18:12:19Z Indexed on 2010/05/22 18:20 UTC
Read the original article Hit count: 189

Filed under:

I spent a month writing an elaborate payment system that handles both credit card payments and electronic fund transfers. My work was used on production server for about a month. I was told recently by the client that he no longer wants to use the electronic fund transfer feature.

Because the way I had to interface and communicate with the credit card gateway is drastically different from the electronic fund transfer api (eg. the cc company gives transaction responses immediately after an http request, while the eft company gives transaction responses 5 business days after an http request), I spent a lot of time writing my own API to abstract common function calls like

function payment(amount, pay_method,pay_freq)

function updateRecurringSchedule(user_id,new_schedule)

etc..

Now that the client wants to abandon the EFT feature, all my work for this abstracted payments API is obsolete.

I'm deliberating over whether I should scrap my work. Here's my pro vs. con for scrapping it now:

PRO 1: Eliminate code bloat

PRO 2: New developers do not need to learn MY API. They only need to read the CC company's API

PRO 3: Because the EFT company did not handle recurring payment schedules, refunds, and validation, I wrote my own application to do it. Although the CC company's API permitted this functionality, I opted to use mine instead so that I could streamline my code. now that EFT is out of the picture, I can delete all this confusing code and just rely on the CC company's sytsem to manage recurring billing, payment schedules, refunds, validations etc...

CON 1: Although I can just delete the EFT code, it still takes time to remove the entire framework consolidates different payment systems.

CON 2: with regards to PRO 3, it takes time to build functionality that integrates the payment system more closely with the CC company.

CON 3: I feel insecure deleting all this work. I don't think I'll ever use it again. But, for some inexplicable reason, I just don't feel comfortable deleting this work "right now".

So my question is, should I delete one month's worth recent development? If yes, should I do it immediately or wait X amount of time before doing so?

© Stack Overflow or respective owner

Related posts about refactoring