9 ms·
I usually prefer to write more readable code, and then optimize later if necessary. If the short circuit becomes critical for performance then I would leave a c
by juiiiced 4y ago
I usually prefer to write more readable code, and then optimize later if necessary. If the short circuit becomes critical for performance then I would leave a comment, or as the parent suggests just order it with an early return.
- simplotek 4y ago> If the short circuit becomes critical for performance the The point is not performance. The point is readability, and expressing things clearly and with the appropriate level of detail and leaving out nesting and scope. Safety and performance are important but secondary advantages.