errors are still a big fat lie

1 view
Skip to first unread message

Raoul Duke

Nov 29, 2021, 3:07:36 PM11/29/21
i can say that since my dr told me i'm technically bmi obese.

anyway -

say you have a Thing and it has some properties like Thing.size which
is a rectangle (width,height). When making or loading the Thing, or
when doing some big operations like Thing.bigTranformation() you know
it can have errors so those functions are marked with throw (e.g. in
swift, fughedabout java i guess of course).

then you decide you want to make a lazy version of Thing,

now you are kind of screwed. you want to only force
bigTransformation() to really happen when somebody actually calls the
.size property. But that doesn't throw, but now it has to throw since
it would be actually internally calling the big transformation.
Reply all
Reply to author
0 new messages