http://www.perlmonks.org?node_id=533124


in reply to what to do when you screw-up?

First thing's first. You need to completely eradicate the line of thinking that says it's your fault that the legacy code isn't up to snuff.

Next, you need to have a sit-down with your manager and have a little conversation about Technical Debt. And how bad it is now, and what it will take to fix it.

This is a resource question. And managers get paid to make resource decisions. Don't deny your manager a full and honest reckoning of the cost of this application in real terms just because you have a mistaken sense of guilt.

What you should have done, in an ideal world, is keep your manager in the loop of the potential problem as soon as you noticed it. However, now is not the time to dwell on such mistakes - it's a relatively minor mistake in the scheme of things anyway. Now is the time to do what it takes to meet your requirements, which the current code base sounds like is making mighty difficult.

Since we can only deal in the here-and-now, I suggest, if possible, hacking it together with spit, twine, and duct tape. And getting your manager's buy-in for a clean up of all that code (a paying-down of the technical debt) to something more manageable, and, hopefully, more flexible.

Good luck.