Skip to main content
1 of 2
Ian
  • 4.6k
  • 20
  • 28

You are not the only person that has had this problem, however I yet to see a good general solution that works across all domains. I think one problem with naming of these functions is that the two arguments have different logical meanings, but are presented as meaning the same.

If your language allows it you could try

return  calculatedDiscount.ButNoMoreThen(maxAllowedDiscount)

return  CDsInStocked.ButNoMoreThen(CasesInStock)
Ian
  • 4.6k
  • 20
  • 28