Hacker News new | ask | show | jobs
by Cowen 4489 days ago
I prefer the second one.

Explicit is better than implicit.

3 comments

If explicit is always better than implicit, why is Python dynamically typed?
Because at the time it was originally written, it seemed impossible to write a statically typed language that was beautiful, or even readable.

This has now proven to be false, and python is starting to add optional type annotations. It's not practical to introduce static typing more quickly - it would break too many existing programs.

So why is it better to have to check for None but not having to check for midnight?

The latter seems a lot less common and surprising.

The second what?
The second example:

    if var is not None:
        ...
I was making a joke about being explicit versus implicit ;)