3 ms·
Isn't clarity better than bytes. We can always running through a minifier at build time.
by PetahNZ 6y ago
Isn't clarity better than bytes. We can always running through a minifier at build time.
- pcr910303 6y agoA minifier is better, but I find that snippet of code clear enough for personal use (el is element, t is tag, p is props, and c is children). The small bytes also mean that for simple sites I can just copy paste it before transitioning to a real setup.
- yunruse 6y agoClarity is only useful when the variable scope is complicated, which it isn’t here. The problem COULD be that the ultra-short variable names make an unclear external API… but given the function is internal, the context of its use would make it rather obvious it’s constructing HTML elements. You’re not wrong about clarity; it wouldn’t hurt here at all, but it wouldn’t hinder without, so I imagine it’s to reduce cognitive load and make it abundantly clear the function is logicless glue.