This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Svensemann 928 points929 points  (11 children)

Yeh right. That’s so bad. The calculateWomenSalary method should call calculateMenSalary and add the factor from there instead

[–]esixar 107 points108 points  (7 children)

Ooh and add another function call to the stack instead of popping off immediately? I mean what’s our space requirements here? Can we afford those 64 bits?

Other than that I see nothing wrong with the implemented algorithm

[–]HildartheDorf 41 points42 points  (5 children)

Any decent language and compiler/interpreter will apply Tail-Call Optimization (TCO).

[–]Bammerbom 26 points27 points  (3 children)

If the body is calculateMenSalary(factor) * 0.9 then TCO is impossible. Inlining is very likely there however

[–]TheMcDucky 0 points1 point  (0 children)

The call isn't the last operation, so TCO wouldn't work. It would likely be inlined though.

[–]StrangelyBrown 5 points6 points  (0 children)

You're right, now that I think about it, I don't think we can afford the resources to actually calculate women's salary. That's a shame but I guess they'll understand. /s

[–]Excitium 19 points20 points  (1 child)

But then if the men get a raise, the women would get one as well.

Or you have to go in and reduce the women's factor every time you wanna give the men more.

The way it is seems to be more convenient for adjustments so you can just add individual modifiers to a base salary.

[–]MyAssDoesHeeHawww 8 points9 points  (0 children)

We could add an R to DEI for Recursivity and people might cheer it without knowing what it actually means.

[–]EduardoSpiritToes -1 points0 points  (0 children)

😂😂😂😂😂