- My account
Premature optimization is the root of all evil. Donald Knuth
As most of us, I am tired to read blog posts about non-sense micro-optimizations like replacing print by echo, ++$i by $i++, or double quotes by single quotes. Why? Because 99.999999% of the time, it is irrelevant. Why? Because 99.99% of the time, you'd better install a PHP accelerator like APC, or add these missing indexes on your database columns, or try to avoid those 1000 database requests you have on the homepage.
print uses one more opcode because it actually returns something. We can conclude that echo is faster than print. But one opcode costs nothing, really nothing.
I have tried on a fresh WordPress installation. The script halts before it ends with a "Bus Error" on my laptop, but the number of opcodes was already at more than 2.3 millions. Enough said.
Code readability is more important than micro-optimization because in most part of cases micro-optimization does not worth it.
- order by priority
- code readability is more important than speed of work of that code
- block modularity
- should be things, which are needed to 80% of users
- less options
- split big tasks into smaller ones
- do not focus on competitors, just do what you want to do
- important is not to lose the idea during the development
- product should solve problem
- believe in what you do or product will not be good
<iframe style="width: 100%; height: 400px;" src="http://jsfiddle.net/webvitaly/MWCuv/13/embedded/result,js,html,css,resources/" width="300" height="150" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
- Register for Payoneer Card