Why write inefficient code when it's just as easy to do it right?
I also wrote an article about this, if you can write efficient code without sacrificing readability I think it's worth the (small) effort.
I also wrote an article about this, if you can write efficient code without sacrificing readability I think it's worth the (small) effort.
The submitted article is fairly similar in some sense. You address optimization but skip out on the most important step of optimizing - measuring what you need to optimize. Tacking memo, ref and key onto everything isn't free and if those parts of your application weren't the problem you're actually making it slower.
It makes the same claim about code reuse, with the reasoning that code is more likely to be JIT compiled if it's a single hotspot rather than two, well, 'warm spots'. Again it doesn't properly back up this reasoning.