4 ms·
Objective-c allows you to send messages to null objects. On one hand it allows for a form of null-coalescing, but on the other it allows bugs to slip in and get
by krackers 2y ago
Objective-c allows you to send messages to null objects. On one hand it allows for a form of null-coalescing, but on the other it allows bugs to slip in and get the program into an unexpected state, whereas a more rigorous treatment would result in a more deterministic crash.
- ipv6ipv4 2y agoIt is part of what makes Objective-C phenomenally good for rapid development in the hands of competent developers. However, as team, and codebase sizes increase, it allows for subtle bugs by less competent developers.
- masklinn 2y agoIt’s also very much related to its use in GUI hierarchies: GUI objects generally have a lot of properties and behaviours, most of which you often don’t care for at any given point. Nil being a shorthand for “do nothing” without needing explicit checking is very convenient.