3

I simplified 7 functions down to a blob because it was truly unreadable and fragmented. As I did it, I thought there was no way I did it right. This can't be the logic. Nope. It is.

Yeah, the formatting could be better. End of the shift so that's a tomorrow thing.

Comments
  • 1
    I'd just go for

    ```
    .if DB[ODWR_CLAIM_ONLY.DATE3] == 1/1/1900
    . return DB[ODWR_CLAIM_ONLY.DATE2]
    .else
    . return formatDate(getOldDateValue())
    ```

    by splitting this function doing 2 things into 2 functions doing 1 thing each.

    /SRP
  • 1
    you can shorten the "if 9/1/2002" and the following elseif to one "if 9/1/2002 < old_date_value <= 9/18/2011:"
  • 0
    My first thought was "oh shit, what language is this atrocity" and then I realized it's Python. Didn't realize it can get this ugly.
  • 1
    @gronostaj its not python.
  • 1
    @stop Right, those dates really don't look like valid Python ;) What is it then?
  • 2
    @gronostaj it's pythonic pseudo code for management types who can't understand python shortcuts
  • 0
    after inspecting the database, that date constant doesn't exist.

    F me. Now I have to clean up that mess too
  • 0
    Btw, the last else is irrelevant, you can just return the function
  • 1
    Y'all suggesting code improvements...I just tilted my phone to remove the glare
  • 0
    @zpeters that was the best I could do. All angles had glare
Add Comment