3 ms·
> If I'm wrong about that You are wrong about that, and he did explain. He is talking about the same thing. That was the purpose of his comment about inline s
by Manishearth 9y ago
> If I'm wrong about that
You are wrong about that, and he did explain. He is talking about the same thing. That was the purpose of his comment about inline styles. (If it was unclear I can answer any more specific questions you have)
What native frameworks let you do is assign inline styling to mostly leaf nodes, plus some extremely generic overall theming functionality.
This is both possible and fast in CSS. This is not where CSS is complicated.
Comparing apples to apples, they're simple specs.
You're saying "But they cannot hope to be able to optimise as much and as easily as the former approach (in principle that is, I cannot say anything about whether or not they actually do)." -- this is incorrect. Setting inline style on leaf nodes is very fast and not a performance issue especially if you solely rely on inline style. The main reason I can think it would be a perf issue is that in CSS this will have to re-parse (whereas in native you can set these things without string ops), but that is fixable (typed CSSOM is probably going to happen). But aside from that, it's a simple computation followed by setting something on a struct. Not really a problem. You can't really optimize it further, aside from the typed CSSOM thing I mentioned (which has nothing to do with complexity).
CSS gets complicated when it attempts provides more power than these native frameworks, however the associated perf issues crop up when you try to use these features. If you use CSS restricted to the feature set of basic native frameworks, these complexities will not affect you much.
pcwalton made an additional point on top of that that if you want to compare apples to apples here, you get frameworks with that level of power (e.g. React Native) on the other side, which don't have as many optimizations.