Fighting an API
Sometimes, when working with a certain codebase or API, you find yourself working on a problem or feature that just won't fit given the constraints of said codebase. I ran into such a problem the other day working with the MFC CRecordset class and probably spent a full day thrashing against it's walls, trying in vain to figure out a way around it's limitations. This is fighting an API.
I find that it's usually a good idea to take a walk for a bit to clear your head and maybe think about taking another approach, because when you're spending that much time working around an API, you're doing something wrong--your overall design is probably flawed and you're just going to run into more problems like this down the road.
But what to do if you can't backtrack and redo your flawed design due to time constraints and legacy concerns? This is the situation I found myself in right now--we were using autonumbers is an odd way that just wasn't going to work. I eventually found a pretty ugly workaround, but it's only going to be a losing battle from here on out with this app. Hopefully, I'll get the chance to rewrite this thing and do it right.
I find that it's usually a good idea to take a walk for a bit to clear your head and maybe think about taking another approach, because when you're spending that much time working around an API, you're doing something wrong--your overall design is probably flawed and you're just going to run into more problems like this down the road.
But what to do if you can't backtrack and redo your flawed design due to time constraints and legacy concerns? This is the situation I found myself in right now--we were using autonumbers is an odd way that just wasn't going to work. I eventually found a pretty ugly workaround, but it's only going to be a losing battle from here on out with this app. Hopefully, I'll get the chance to rewrite this thing and do it right.