Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
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 -
stop68025yyou can shorten the "if 9/1/2002" and the following elseif to one "if 9/1/2002 < old_date_value <= 9/18/2011:"
-
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.
-
@gronostaj it's pythonic pseudo code for management types who can't understand python shortcuts
-
after inspecting the database, that date constant doesn't exist.
F me. Now I have to clean up that mess too
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.
rant