Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Tuesday July 02 2019, @04:39PM   Printer-friendly
from the lawns dept.

"Front-end" developer, Pete Lambert, writes about why front-end "web" developers should start to learn HTML. More and more developers are using only pre-made frameworks and quite unfamiliar with the fundmentals of the technology they are using, such as semantic markup. He notes that the continued failure to pay attention to the basics of semantics is slowly breaking what's left of the World Wide Web and suggests reasons to correct that and has some pointers to learning resources.

I’m a ‘frontend of the frontend’ kind of guy. My expertise is in HTML and CSS, so it’s easy for me to wax lyrical about why everybody should learn what I already know (for the record, I don’t know it all - we still have heated debates in the office about what the best way to mark up a certain component might be). This isn’t about ‘my job’s more important than yours. If you’re writing code that renders things in a browser, this is your job.

It’s about usability and accessibility. If you don’t think the semantic structure of your Web page or app is important then you’re essentially saying “Well, it works for me in my browser, ship it”. I don’t think you’d do that with your Javascript and you certainly shouldn’t be doing it with your CSS. Search engines need to read your content, not enjoy your swoopy animations or fancy gradients. Screen reader software needs to read your content. Keyboard users need to read your content. Who knows what technology will come next and how it will consume your app but I’ll bet my bottom Bitcoin it’ll work better if it can easily read, parse and traverse your content. The way these things read your content is that they know it’s actually content and not just strings of text wrapped in meaningless tags. They know what’s a table and how to present it, they know what’s a list and how to present it, they know what’s a button and what’s a checkbox. Make everything from divs and they’re going to have to work bloody hard to figure that out.

Earlier on SN:
How to Build and Host an Energy Efficient Web Site (2018)
Conservative Web Development (2018)
Dodgy Survey Shows 1 in 10 Believe HTML is an STD? (2014)


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 5, Interesting) by Thexalon on Tuesday July 02 2019, @06:43PM (4 children)

    by Thexalon (636) on Tuesday July 02 2019, @06:43PM (#862481)

    I've recently hand-coded a couple of simple websites, and I quickly remembered that putting together some halfway decent HTML was not substantially harder than futzing with a CMS. Now, it helps that I'm fluent in HTML and CSS and JS, so I know how to quickly do what it is I want to do, but I'm also fluent in the PHP and MariaDb code somebody decided would be "standard" back in 1999 or so and I'm still not entirely convinced that all those layers of code make things massively easier.

    Among other things, I've found that CMS work goes a lot more smoothly when you can switch to a text-only editor, fix some busted-up HTML, and go back to the visual view when you need to do that. Because when there's flaws in stuff like FCKEditor, you're not going to be wanting to dive in and fix them yourself, and the alternatives are to hand-code your HTML again or hope that a new release is imminent.

    And of course the hand-coded site also runs much faster than the CMS-based site, because instead of "Run some PHP, load a bunch of stuff from MySql, build a page, send to browser, wait 15 seconds for the 148 JS libraries to load for all the latest whizbangs, ...", it's "Here's a copy of the file, here's a few images, here's the 20 lines of custom JS you actually need to worry about here, you're all set." And yes, you can address that time problem with caching, but that's yet even more complexity and more time when there isn't a cached version.

    I'm not saying "never use a CMS ever", but I do think there are more tradeoffs involved than many Wordpress jockeys think, and that an awful lot of code has been written in search of the elusive "Do What I Meant Rather Than What I Told You" mode to questionable effect.

    --
    The only thing that stops a bad guy with a compiler is a good guy with a compiler.
    Starting Score:    1  point
    Moderation   +3  
       Insightful=1, Interesting=2, Total=3
    Extra 'Interesting' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   5  
  • (Score: 1, Interesting) by Anonymous Coward on Tuesday July 02 2019, @07:11PM (3 children)

    by Anonymous Coward on Tuesday July 02 2019, @07:11PM (#862500)

    It is all the code that you don't have to update across all files, along with a ton of UI improvements. CMSs allow abstractions that would be functionally impossible to do with pure HTML/CSS and if you allow JS then you basically re-create a CMS anyway. Once you learn a certain CMS it is almost always easier to build a site with it.

    I will agree that for super simple sites it might be easier to hand code everything.

    • (Score: 3, Insightful) by Thexalon on Tuesday July 02 2019, @08:21PM (2 children)

      by Thexalon (636) on Tuesday July 02 2019, @08:21PM (#862514)

      It is all the code that you don't have to update across all files

      There are plenty of times I've been able to get a lot of mileage out of the following extremely complicated PHP snippets:

      <?php include('header.php'); ?>

      ...

      <?php include('footer.php'); ?>

      and still code most of the site in simple HTML / CSS / JS and runs extremely quickly.

      Once you learn a certain CMS it is almost always easier to build a site with it.

      You seem to think that my defense of hand-coding is due to my lack of familiarity with CMS's. It's not: I'm good enough at both Wordpress and Drupal to get paid good money to fix other people's foul-ups with them (and less frequently, create new sites and/or add new features and plugins and such).

      What I'm suggesting is that your "easier" comes with substantial trade-offs and downsides that you are probably not considering because pseudo-WYSIWYG is shiny.

      --
      The only thing that stops a bad guy with a compiler is a good guy with a compiler.
      • (Score: 0) by Anonymous Coward on Wednesday July 03 2019, @12:36PM

        by Anonymous Coward on Wednesday July 03 2019, @12:36PM (#862674)

        Nope, I mean advanced functionality that would involve more coding effort. As for wysiwyg editors you can always allow pure html. Except for the simplest of sites or some seriously custom and weird functionality I just don't see any reason not to use a cms.

      • (Score: 3, Informative) by canopic jug on Wednesday July 03 2019, @01:19PM

        by canopic jug (3949) Subscriber Badge on Wednesday July 03 2019, @01:19PM (#862692) Journal

        There are plenty of times I've been able to get a lot of mileage out of the following extremely complicated PHP snippets:

        That's still too much PHP. If you just need some headers, footers, and maybe some menus, then you can do better with Server-Side Includes. Either use the XBit hack or add an output filter. After making a good template it becomes less work than using and maintaining a CMS, and is less risk than PHP.

        <!DOCTYPE html>
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
        . . .
        <body>
        . . .
        <!--#include virtual="/header.html" -->
        . . .
        <!--#include virtual="/navmenu.html" -->
        . . .
        <!--#include virtual="/footer.html" -->
        . . .
        </body>
        </html>

        Both Apache2 and Nginx support Server-Side Includes. Though with Apache2, you should remember to configure it noexec, just out of principal.

        --
        Money is not free speech. Elections should not be auctions.