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
-
Write a unit test, delete this function, and build a proper one from scratch.
That is all. -
Manuch2222y@fullstackclown this is a refactory I did about a year ago of a big ass function written by a guy who should be as far as possible from a computer.
I left that line commented because I couldn't believe it -
'And' has precedence, right? so not only are the years hard-coded but it doesn't even work for most of those?
-
Manuch2222y@Oktokolo the first comment, from this guy, "alla mejo proprio" can be translated to "at the bestzz" (with a couple of random Zs)
My comment next to it "revisione ... Perché..." means "revision ... Why..." -
Manuch2222y@Oktokolo I had to, the only reason I had to do this refactory is that this program, instead of writing one row in a table per month, like it was supposed to do, it was doing something else.
In a table where I expected about 20 rows (~ 2 years of usage) I found 45kk rows, that table alone was over 4GB.
The guy before me did a series of horrible mistakes and everytime the user refreshed a list the program was adding about a 1k of records in this table and more shit somewhere else, for NO FUCKING REASON.
It took me a month to refactor this garbage, having to fight myself to continue and finish it. -
@Manuch 4GB for just 45k rows leads to an average row size of rougly 89kB. That is a lot for a non-BLOB record.
Related Rants
This is what I have to deal with in my sad sad life
rant
shit
shitcode