vijos/vj4

Let domain.get_user return empty dict ({}) instead of None when not found

twd2 opened this issue · 3 comments

twd2 commented

Let domain.get_user return empty dict ({}) instead of None when not found.

This will make some codes simpler

Why would it make code simpler?

In our projects, we would do that.

In general, processing data with the same return type is easier, you wouldn't like the idea that some method sometimes returns a certain type and on the other times another. Likewise, unify data types by making None to {} is a lot easier for programming and a bit more understandable.