Click here to Skip to main content
16,003,611 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: You ever get into one of these situations? Pin
PIEBALDconsult17-Aug-24 6:04
mvePIEBALDconsult17-Aug-24 6:04 
GeneralRe: You ever get into one of these situations? Pin
David O'Neil17-Aug-24 8:22
professionalDavid O'Neil17-Aug-24 8:22 
GeneralRe: You ever get into one of these situations? Pin
honey the codewitch17-Aug-24 8:24
mvahoney the codewitch17-Aug-24 8:24 
GeneralRe: You ever get into one of these situations? Pin
David O'Neil17-Aug-24 14:26
professionalDavid O'Neil17-Aug-24 14:26 
GeneralRe: You ever get into one of these situations? Pin
honey the codewitch17-Aug-24 14:35
mvahoney the codewitch17-Aug-24 14:35 
GeneralRe: You ever get into one of these situations? Pin
Greg Utas17-Aug-24 9:17
professionalGreg Utas17-Aug-24 9:17 
GeneralRe: You ever get into one of these situations? Pin
Mike Hankey17-Aug-24 10:33
mveMike Hankey17-Aug-24 10:33 
AnswerRe: You ever get into one of these situations? (WARNING: very long) PinPopular
Jalapeno Bob17-Aug-24 11:00
professionalJalapeno Bob17-Aug-24 11:00 
Yes. While working in Waco maintaining a large electronic health record code base (This was years before the American Recovery Act mandated it.), Micro$oft Windows was doing a major upgrade from Windows 2000 to Windows 7. Since the code base was built starting in the 1990s and long before I joined the company, there was a fair number of Windows API changes that had to be worked in, and this is the killer, a huge amount of duplicate code and reliance on the side-effects of various subroutine and function calls.

The "common code" was a huge DLL that took forever to load and it contained code that was only occasionally used.

My boss, who learned to program in the Navy over twenty years earlier, was one of the programmers who originally built the program. While he was a good programmer, he moved into management and his skills became very rusty and out of date. He could not see why the existing code had to be changed.

This left me with the dilemma: update it on my own time without telling him or try to patch the code and pray that nothing breaks irrevocably.

I came up with a plan:


  1. I dropped the duplicate subroutines and functions, then recoded the calls to use the ones that remained. I hunted down all of the dependencies upon side effects and removed them. Many were functions that returned a single value of True or False, but modified other data. These I changed to return a data record with the data changes. I released this update to the huge common code DLL.
  2. I split the common code DLL into a three level structure with all the non-UI Windows API calls in the bottom layer. Depreciated API calls, of which there were many, were replaced with the current ones. The code to set up for API calls, such as letter generation, print formatting, data base record construction and whatnot in the middle layer as multiple DLLs. The top layer contained the business logic, with separate DLLs for Mental Behavioral Health, Mental Retardation Developmental Disabilities, insurance processing, billing, and client demographics. I released this revised common code as an update. I received praise from the clinicians because the whole program loaded much faster. My boss provided no feedback.
  3. I split the main UI code removing rarely used paths to separately called programs. The main UI code handled all of the windows that everyone used. The separate programs handled billing and report generation, behavioral health unique logic, and developmental disabilities unique logic. I released this in stages, and again the loading time decreased.
  4. When my boss decided on a date to update to Windows 7, he asked (finally!) how long it would take to convert the code base. I told him that, with the recent updates currently in place, I could be ready in two weeks.


While the cutover was ongoing, I did have to maintain two versions of the bottom layer of DLLs, but that was not overly onerous. The field crew could reinstall the final version with a simple command line.

The whole thing went so smoothly, that my boss was amazed. He finally looked through the code and was instantly lost when he found the code for loading and running multiple independent modules. He blew a gasket - his and his buddy's "elegant solution," which had morphed into spaghetti code was almost totally gone, although most of their code remained. He could not do much to me at the time: I was the clinicians' hero.

When I was asked (not by my boss!), I told people I was hired by my boss' predecessor as a software engineer, not just as a programmer.

__________________
Lord, grant me the serenity to accept that there are some things I just can’t keep up with, the determination to keep up with the things I must keep up with, and the wisdom to find a good RSS feed from someone who keeps up with what I’d like to, but just don’t have the damn bandwidth to handle right now.
© 2009, Rex Hammock

“If you don't have time to do it right, when will you have time to do it over?” - John Wooden

GeneralAnd ... it's back! Pin
OriginalGriff17-Aug-24 1:25
mveOriginalGriff17-Aug-24 1:25 
GeneralRe: And ... it's back! Pin
Matthew Dennis17-Aug-24 2:49
sysadminMatthew Dennis17-Aug-24 2:49 
GeneralRe: And ... it's back! Pin
OriginalGriff17-Aug-24 2:57
mveOriginalGriff17-Aug-24 2:57 
GeneralRe: And ... it's back! Pin
0x01AA17-Aug-24 3:30
mve0x01AA17-Aug-24 3:30 
GeneralRetractions on the rise Pin
Amarnath S16-Aug-24 15:46
professionalAmarnath S16-Aug-24 15:46 
GeneralRe: Retractions on the rise Pin
obermd16-Aug-24 16:15
obermd16-Aug-24 16:15 
GeneralRe: Retractions on the rise Pin
Amarnath S16-Aug-24 16:37
professionalAmarnath S16-Aug-24 16:37 
GeneralRe: Retractions on the rise Pin
obermd17-Aug-24 9:16
obermd17-Aug-24 9:16 
GeneralRe: Retractions on the rise Pin
David O'Neil16-Aug-24 17:06
professionalDavid O'Neil16-Aug-24 17:06 
GeneralRe: Retractions on the rise Pin
jmaida16-Aug-24 17:53
jmaida16-Aug-24 17:53 
GeneralRe: Retractions on the rise Pin
honey the codewitch17-Aug-24 5:20
mvahoney the codewitch17-Aug-24 5:20 
GeneralRe: Retractions on the rise Pin
Amarnath S17-Aug-24 6:16
professionalAmarnath S17-Aug-24 6:16 
GeneralRe: Retractions on the rise Pin
obermd17-Aug-24 9:17
obermd17-Aug-24 9:17 
GeneralRe: Retractions on the rise Pin
honey the codewitch17-Aug-24 10:41
mvahoney the codewitch17-Aug-24 10:41 
GeneralRe: Retractions on the rise Pin
jschell17-Aug-24 12:28
jschell17-Aug-24 12:28 
GeneralRe: Retractions on the rise Pin
QuantumPlumber17-Aug-24 10:26
professionalQuantumPlumber17-Aug-24 10:26 
GeneralRe: Retractions on the rise Pin
jschell17-Aug-24 12:29
jschell17-Aug-24 12:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.