option still sucks

1 view
Skip to first unread message

Raoul Duke

unread,
Jun 13, 2022, 5:48:50 PM6/13/22
to pi...@googlegroups.com
even if you have maybe nicer syntax like "?" in various c-derived
languages like typescript or swift or kotlin, there are still plenty
of times, places, ways that you have to have the extra boilerplate of
checking for null. which makes it more annoying in a way when those
crop up.

pseudocode version of XCTest
assert_null( thingtocheck: Ref?, errormessage: String )

called like
assert_null( foo, foo.message )

sucks because
foo.message would have to be
foo?.message which still isn't of type String
so then it has to be
foo?.message ?? "fail"
which is confusing to say the least

even though the only time the code should use the message is when
dynamically foo itself is not null!!!!!!!!!!!!!!!! :-\
Reply all
Reply to author
Forward
0 new messages