4 ms·
On top of what the article recommends her is my personal pet peeve. STOP using gazillions of nested DIVs only to achieve a single button. I know this is the re
by unnouinceput 6y ago
On top of what the article recommends her is my personal pet peeve.
STOP using gazillions of nested DIVs only to achieve a single button. I know this is the result of frameworks but maybe, just maybe, somebody someday will start making a clean layout framework that uses TABLE instead of DIV. It's sooooo f*ing much faster.
- maccard 6y agoHave you got any numbers to back that up?
- unnouinceput 6y ago"have you got any..." -duude! just open facebook messenger and inspect any element there, then comeback and tell me if you can't see the gazzilion DIV's there. Or are you referring to table vs. div from performance point of view? For that you can do your own testing. Create a DB, put in there 100k rows and then view them via a framework that uses the gazzilions I mentioned vs a table with 100k TR's. See for yourself which one loads faster. And to get out the loading times from DB, do it once then save it as HTML offline page for both tests and then use those pure HTML to load from local file. See that TABLE is faster.
- cblconfederate 6y agoI thought they did that on purpose, to evade scrapers and ad blockers.
- maccard 6y ago(sorry should have been clear - im talking about the performance of div soup vs a table) I'm aware how to put together those benchmarks, but you're the person making the claim. The onus is on you to prove its faster, not me.
- unnouinceput 6y agoI already proved to myself, exactly like I told you. And since you can do it yourself, then do it. Don't take my word, test yourself. Then comeback and tell me the results of your own benchmark.
- maccard 6y ago> I already proved to myself, exactly like I told you. No, you didn't. You made a claim, and then stated it was true based on your description, not based on the results. > Then comeback and tell me the results of your own benchmark. You're the person who is claiming it's faster. As I said above, The onus is on you to prove its faster, not me.
- Theodores 6y agoThis is hard work. It is also a variant of 'any fool can make things complicated, it requires genius to make things simple'. The HTML specs define the div as the element of last resort, it has not been deleted from the spec but it really is supposed to be the last choice. You can do it all with the new CSS Grid and pseudo elements, to never need a div. This does not mean swapping every div for a semantic element, defaulting to 'section' every time. What I find sad is that the gurus of web design start blocking out their lorem ipsum examples with div elements. If they used real content they would be able to see what elements suited their content and use asides, navs, list items, figures and whatever else best suits. Anyone preaching HTML and using div elements needs to be called out for it. There are no excuses, anything and everything can be refactored into sensible HTML that has a few classes and next to no div elements. Time is the thing though. To refactor HTML to not use the mess of divs requires hard work, essentially it is a simplification of the code, actual real design which is not the same thing as decoration. Too often decoration is passed off as design whereas the innards of the page - the document structure and HTML - is essentially un-designed. We are making artistic impressions of web pages and not the low carbon, well cached web pages we deserve.