This is also against clean code examples, because Uncle Bob seems to be allergic against function arguments and return values.
I think this is your strawman version of “Clean Code”… not anything that’s actually in it…
I “like” some parts of your example more than the previous one, but a lot of this depends on where exactly in the whole program this method is - if this method is on a “Salesman” class - does it make sense to pass the “Contract” in? If there’s a Contract class available, why doesn’t the “calculateCommission” method exist on it?
I think this is your strawman version of “Clean Code”… not anything that’s actually in it…
I “like” some parts of your example more than the previous one, but a lot of this depends on where exactly in the whole program this method is - if this method is on a “Salesman” class - does it make sense to pass the “Contract” in? If there’s a Contract class available, why doesn’t the “calculateCommission” method exist on it?