3 ms·
I guess it depends on whether or not you want your code to read like natural language. The refactored version reads like: Allow access to the site if the user
by yarou 13y ago
I guess it depends on whether or not you want your code to read like natural language.
The refactored version reads like:
Allow access to the site if the user is signed in or has a trusted IP.
The original (DeMorgan's applied):
Allow access to the site if the user isn't signed out or doesn't have an untrusted IP.
It does help to have a good understanding of propositional logic and Boolean algebra, though.