3 ms·
Box-sizing is not a good example of a standard that was poorly engineered: it actually fixes a poorly engineered standard instead. I understand the box model,
by TheCoreh 9y ago
Box-sizing is not a good example of a standard that was poorly engineered: it actually fixes a poorly engineered standard instead.
I understand the box model, which is precisely why I think one should not have to perform mental padding calculations just to know how wide an element will be on screen. Content box sizing (the original standard) also makes CSS less composable (since the results of combining multiple classes are harder to account for). Ergonomics are a very important engineering consideration.
The <!DOCTYPE html> tag also forces the browser to "do something it doesn't do natively" (enter standards mode) so does "use strict"; these are concessions one has to make when a platform evolves over 25 years and must remain backwards compatible.
- sureaboutthis 9y agoI said nothing about poor engineering. >one should not have to perform mental padding calculations just to know how wide an element will be on screen This, and the paragraph, falls directly into my comment about not wanting to think or do the work. >The <!DOCTYPE html> tag also forces the browser to "do something it doesn't do natively" (enter standards mode) Bad example. Using a doctype was not originally required and was only forced into being by Microsoft not following the standard. Technically, one does not need a doctype at all but we were forced into using it so browsers know you want to be in "standards mode" and not "quirks", but this diverts from the topic.
- TheCoreh 9y agoMy "poor engineering" remark was a response to your original comment stating that "In the past, standards were developed through engineering and computer science." Re: "not wanting to think or do the work": why would anyone want to think more or do extra work that is not required, except perhaps for fun? Computers were created precisely to automate and abstract away mundane tasks (such as adding padding measurements mentally). Only at Google/Facebook scales the extra bytes/CPU cycles added by setting box-sizing for all elements might perhaps make a difference. For everyone else the maintenance, time benefits of reducing the mental overhead imply on actual reduced costs, since you can ship your page/app faster.
- sureaboutthis 9y agoMy remark was in regard to my first statement about standards following fads but that does not mean the standard is poorly engineered. My main point, again, falls back to people wanting things done for them because they don't take the time to learn how things works. They want things done for them and never learn the basics, the foundation of understanding. If one cannot figure out how to make an element a certain width using "width" + padding + border + margin because they never bothered to read the specification, or any of the multitude of online tutorials, where it is clearly explained that width is the containment area alone, then this is nothing more than plain laziness mixed with "give me teh codez".