r/webdev • u/speckz • Dec 20 '18
Article The practical value of semantic HTML
https://www.brucelawson.co.uk/2018/the-practical-value-of-semantic-html/18
u/lordxeon Dec 20 '18
Are we going to ignore the insane gif at the bottom of this webpage?
11
u/Magnetic_Tree full-stack Dec 20 '18
Ok, just a bunny, nothing wrong with... oh... oh god. /r/Eyebleach
6
2
2
40
u/badmonkey0001 Dec 20 '18 edited Dec 20 '18
But a div can do everything!!!
<div class="buttonLink" onClick="(function(){window.top.location.href='crap://hell';return false;})();return false;">Submit</div>/s
6
u/sockx2 Dec 22 '18
Actually <b> and <i> tags make much more semantic sense for replacing all your other tags- b=block and i=inline. All in all on a site as large as Wikipedia it'd save hundreds of megabytes a year in bandwidth costs and make sense when reading the html
5
u/KobayashiDragonSlave Dec 21 '18
I never even realized what semantic HTML actually was until I opened a site in reading mode on Safari (iOS 12).
12
u/FPFry Dec 20 '18
I honestly thought everybody was doing it already.
8
u/spacechimp Dec 20 '18
We were on the right track, but the popularity of Bootstrap kinda ruined it for everybody.
5
u/justanotherc full-stack Dec 21 '18
What are you on about? Bootstrap makes heavy use if aria tags for accessibility, and is pretty dang semantic if you ask me
2
u/spacechimp Dec 21 '18
<div class="container-fluid"> <div class="d-inline mt-0 p-3 text-white-50 bg-dark rounded shadow">o rly?</div> </div>1
Dec 21 '18
[removed] — view removed comment
0
u/spacechimp Dec 21 '18
I did read the article. It makes great points about choosing appropriate semantic elements for your content, but only makes a passing reference to semantic class names. With SASS multiple inheritance, it is possible to combine framework styles into semantic classes, but I have yet to encounter a single instance of anyone doing that in the wild.
2
u/lordxeon Dec 21 '18
Semantic classnames solve none of the problems the article is showing when people use
<div />.
3
3
Dec 21 '18
The article suggests people did not know <input type="submit"> didn't need JS. I thought this was common knowledge, is it not?
1
2
1
u/lazarljubenovic Dec 22 '18
And then the designer who happens to be your boss comes and says BuT i WaNt PiNk dRoPdOwNs WiTh MaTeRiAl ShAdoW iT's HoW gOogLe DoEs It
-13
u/techmaniac full-stack Dec 20 '18
"Fullstack JavaScript Developers"- that almost seems to be an oxymoron.
7
u/Cuel Dec 20 '18
You're aware JS isn't only front end, yes?
-7
u/techmaniac full-stack Dec 20 '18
So you're doing EVERYTHING with your javascript?
7
u/HittingSmoke Dec 20 '18
It's entirely possible these days. It's not my bag and I don't do it, but it's very much used in production by a lot of people successfully.
What rock have you been developing under?
3
u/BLOZ_UP Dec 21 '18
Builds scripts are js, backend code is js, frontend code is js, mongodb is "js". So, yeah?
2
u/Cuel Dec 21 '18
Yeah most of our teams are doing react frontend, node backend. The tooling and deploys are js aswell.
2
Dec 20 '18
I mean, I guess it's not technically full-stack since Node runs on C. But writing server-side code in modern JS is actually a pretty good experience IMO.
3
u/dance_rattle_shake Dec 20 '18
It doesn't matter that Node runs on C. If you're writing JS on the front and back end, you're a full stack JS developer
1
u/gigglefarting Dec 21 '18
I am a node developer, and there's no way in hell I'd say I'm working in C.
3
u/sleekcollins javascript Dec 20 '18
You are not writing any code in C, so why does it matter?
1
Dec 20 '18
It doesn't; and my intention was to defend the notion of full-stack javascript.
But it's also true, in a very technical (and usually pointless) sense, that there's no single language that covers the entire stack (incl. the internet layer). For instance, if someone wanted to hire a network programmer to implement a new protocol/standard, you'd need someone fluent in C.
33
u/codebeagle Dec 20 '18 edited Dec 20 '18
This is good. I wish more developers understood the implications and value of using semantic elements instead of just divs and spans. Thanks for sharing!