3 ms·
Whew! <- The sigh of relief after reading comments here and realizing that I'm not the only one preferring the standard style of writing Python instead of this
by hnfong 3y ago
Whew! <- The sigh of relief after reading comments here and realizing that I'm not the only one preferring the standard style of writing Python instead of this "functional"(??) style...
I get that Optional return values can force the programmer to handle errors without resorting to exceptions, but I can't help but wonder whether the first example with all those `bind_optional` ... is just Objective-C's nil messaging in fancy disguise...
FWIW in Objective C this is exactly what one writes (even if those functions can return nil):
credit = user.get_balance().credit_amount()
if credit > 0:
discount_program = choose_discount(credit)
I'm not sure what's so "functional" about it though.
- emblaegh 3y ago> I'm not sure what's so "functional" about it though. This is a library about composing function, can't get more functional than that.