code optimization

Reliability and readability are more important than code micro-optimizations.
But there are some methods to improve code-optimization and speed of script without harming readability.
For example expensive_function() should be last inside of if-condition because if "counter less than X" will be true than expensive_function() will not be executed.

if ( counter < X || expensive_function() ) {}

Leave a Comment