News for hackers. Stuff that matters.
Re:You’re better off using Exceptions by weberc2 on Monday February 03, 2020 @07:28PM (#22230990)
It’s a poorly designed API, full stop. It doesn’t matter whether or not it has an API to check existence, it’s not the dictionary’s job to know whether or not a missing key is a valid state in the broader program, and most often it is. Moreover, it’s insane to do a separate “if exists” check every time you need some resource. And the world is littered with these poorly designed APIs, as they are idiomatic in Python, JS, C#, and Java.

There are no comments on this comment yet.