3 ms·
Agreed; that was helpful in understanding how it works. However the large imbricated `if`s make it harder to understand than a refactored version with early ret
by hk__2 9y ago
Agreed; that was helpful in understanding how it works. However the large imbricated `if`s make it harder to understand than a refactored version with early return's:
def public_license (paid_available, commercial, contributing):
if not paid_available:
return 'standard, Open Source, two-clause BSD'
if not commercial:
return 'noncommercial, BSD-like license'
if contributing:
return 'contribution-enabling, BSD-like license'
return '90-day free trial, then you have to buy a license'
- kemitchell 9y agoThanks for this. I did, actually, laugh out loud. Pity me, brother. For functional programming ruined my young mind. And then I went to law school ;-P
- c-smile 9y agoUnfortunately "contribution" is quite hard to formalize. As they say in Russian "три яблока это куча или нет?". (Loose translation: is three apples a lot of apples?) It depends...
- kemitchell 9y agoWe need a День контрибютора. Then everyone will understand...