We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18373 ☆ A M B ☆
    • 3,141 Posts
    To streamline my development projects I’m working on a base set of static html, style sheets, folders etc to not having to worry about that (and details like styling the <strong> tag which I often forget). Now that I’m starting on my base html, it got me thinking about the doctype and the implications of each one.

    Did some googling, but I can’t really find any reasons why to use, for example, html 4 or xhtml 1. Only why it’s important to have one.


    As this community has loads of knowledge I turn to you... what doctype do you use, but more importantly, why did you choose for it?
      Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

      Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      I personally have been using xHTML 1.0 (strict) for the past.. years?

      But the only reason I can come up with for that is cause that’s simply with what I started off years ago, and never really dived into the why behind it.

      I’m also thinking about HTML5, now that’s it becoming bigger, browsers are becoming aware of it and in general there’s a buzz around it. But I’ve always been focusing on "progressive enhancement", and not "graceful degradation" (if that makes any sense, lol), so I’m a bit reluctant to moving up to something with evil thingies like IE6,7 and 8 still around.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        It’s like using // or /* ... */ for comments, or EMACS vs VI. Or Revo vs Evo. Windows or Linux or Mac. Whatever floats your boat.

          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          // is awesome for single line comments (I use them after a line to indicate what it does, when needed)
          /* ... */ is good to comment out blocks of code or long explanations

          Revo is more aimed at developing custom stuff, where Evo is a great CMS.

          Windows is on my laptop and works with things on school.

          There’s like, reasons (or maybe merely excuses) I can think of with those examples..
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 21838
            • 284 Posts
            I prefer using HTML5 as I believe in future technologies. Before I used XHTML 1.0 Strict as it has the better (more strict) guidelines for coding than transitional.
            If you check my gitHub Repo for Boilerplate you see my standard configuration. IE gets updated via Modernizr.
              MODX Free Template Base: MODX-Boilerplate | my blog (lots of MODX stuff) | my gitHub (translations) | MODX User Groups Germany (Facebook)
              • 3749
              • 24,544 Posts
              Quote from: sottwell at Feb 17, 2011, 06:31 PM

              It’s like using // or /* ... */ for comments, or EMACS vs VI. Or Revo vs Evo. Windows or Linux or Mac. Whatever floats your boat.

              IIRC, the MODx coding standards used to frown on //, I don’ t know why. I don’t see that in the current Revo standards.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 36805
                • 354 Posts
                I used to use xhtml (transitional). I think xhtml is really annoyingly strict without offering alternative ways. 2 examples:


                • target="_blank" is an invalid attribute - yes, one must use it sparingly but why not allow it at all?
                • Validation errors in embedded javascript. Like with ampersand (&) in an url variable. I hate to use those CDATA tags and I can never remember them too.

                html 5 handles the above painlessly. It has handy shorthand syntax for scripts and styles. Also I think it is strict enough. I don’t see any disadvantage to using html 5, so i started using only html 5.
                  • 27708 MODX Staff
                  • 2,502 Posts
                  I use both HTML5 and HTML4 but do 4 with XML syntax. XHTML was to enable XML applications to be parsed and be cross compatible with browser user agents but was almost always used incorrectly. I honestly think because it was newer and more recently established that HTML Editors like Dreamweaver and AdobeGoLive set XHTML Transitional as the default many people started with it and went with it.

                  Transitional is/was intended to bridge the gap between now deprecated elements/attributes and the XHTML Strict syntax and not intended for people to use it to build new sites. For the most part there was no reason to not just build in HTML4 Strict with XML standard tags. It would have enabled you to continue to use the browser breaking attribute of target="_blank" (which in my opinion is if you don’t want someone to leave your site on a link that might be useful don’t put the link there in the first place since many people hate spawned windows and those who don’t often don’t see the spawned window and then the back button no longer works.

                  One argument for XHTML from what I understand, many JS libraries were developed with it in consideration and there could be inconsistencies in how browsers handled DOM from HTML4 to XHTML. I’ve not personally encountered this and have never been concerned with it.

                  What I think you need to do though is learn each spec/recommendation, it’s intended use and then develop your designs based on your own understanding as it grows. Once you know that you can learn when it’s okay to have an invalid page. (Did you know that from time to time the W3C validator gets it wrong?) In addition, some browsers err on the side of doing what they expect developers to assume rather than the spec. I.E. has always done this and recently it became clear to me that Webkit browsers don’t follow the standard for elements that are styled as display:table.

                    Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                    • 18373 ☆ A M B ☆
                    • 3,141 Posts
                    Quote from: MrDutchy at Feb 18, 2011, 07:04 AM

                    I used to use xhtml (transitional). I think xhtml is really annoyingly strict without offering alternative ways. 2 examples:


                    • target="_blank" is an invalid attribute - yes, one must use it sparingly but why not allow it at all?
                    • Validation errors in embedded javascript. Like with ampersand (&) in an url variable. I hate to use those CDATA tags and I can never remember them too.

                    html 5 handles the above painlessly. It has handy shorthand syntax for scripts and styles. Also I think it is strict enough. I don’t see any disadvantage to using html 5, so i started using only html 5.

                    I never really understood the reason for not allowing target="_blank" either. I personally took the stance that if it’s for "the greater good" it’s fine if it doesn’t validate. Content editors will ruin the validity anyway tongue

                    Thanks for sharing your insights all - I think it’s very interesting smiley

                    Jay: You have a valid point on the target="_blank".. why link to something if you don’t want people to leave your sites through the link? Better write the content you’re linking to on your own site, too, and keep ’m in!
                      Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                      Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                      • 23299
                      • 1,161 Posts
                      Interesting thread...

                      Just recently I have noticed the actual code for target="_blank" showing up in user posts on some of the forums I visit...