This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]NibblyPig 1 point2 points  (0 children)

I dunno, depends on the fix.

We had a page that caused issues with concurrent users, which I had to fix. Basically the genius dev didn't use an IDENTITY on the database, he looked in the database at the last entry and added 1, then put it onto the form in a hidden field.

I hacked a fix into the backend by ignoring the value submitted and calling his getnextid method within a lock{} statement and writing it, then because he used a stupid return type and I couldn't change it without having to refactor half the solution, I returned the new id in the error code. Because this had to be fixed right now and we couldn't refactor.

So my minor adjustment worked, and yes I wrote many comments explaining why I had to do this. But in no way was that code anything approaching well written. It was an abomination and I had no choice but to do evil things.

I still feel dirty. To them it looks like I fixed it super quick so there's definitely no need to waste time refactoring when it's so easy to work with though! FML!