nil punning

Created: Aug 29, 2021Published: Mar 28, 2023Last modified: Apr 05, 2023
No tags
Word count: 75Backlinks: 1

The idea that rather than crash, we return nil from a function. Most often, if something goes wrong, you just want the blog to be nil.

Instead, we go in and find the strange code and check if it's a None or an empty list or w/e, then return None by hand in that particular branch of code.

We don't need all that. when nil?, return nil. Done. The bad branch ends here.


Backlinks