Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Is there a practical reason to learn xhtml still? Should I learn to make my webpages in xhtml instead of html5 still or does it matter?

share|improve this question

closed as not constructive by ChrisF Jan 17 '12 at 23:31

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

4 Answers 4

up vote 5 down vote accepted

If you are new to HTML then you need to learn the fundamentals of HTML first before diving in to HTML5 (which is to some extents still a moving target). Why? Because nearly every web-site, tutorial and example code you will encounter regarding HTML will be written in HTML4 or XHTML. You can only really understand the problems that HTMl5 is addressing by first understanding HTML4 and XHTML.

If you hope to work as a web-developer or designer then you won't be able to avoid encountering "legacy" code - so you need to at least understand it and be comfortable with what it is doing. Unfortunately you'll find that the "web" and "standards" are often two different things - for many years HTML has been a mess because of the way different browsers have interpreted (and often blatantly flaunted) the standards. So, at the very least, you need to be aware of this.

share|improve this answer
    
Ok, that's a well put reason for me to learn HTML4 and XHTML. Thank you. –  maxfielden Jun 20 '11 at 9:19
    
@maxfielden learning HTML5 includes learning HTML4. HTML5 is a (mainly) superset. there's no reason to specifically learn html4/xhtml, learning html5 should include learning html4. –  Raynos Jun 20 '11 at 14:01
    
@Raynos but you still need to know what has been deprecated and what has been added between 4 and 5. Otherwise, if you have to work on an HTML4 "legacy" site (and that probably encompasses 99.99% of the existing web) you'll not have a clue what is valid or not –  Dan Diplo Jun 20 '11 at 15:13
    
@DanDiplo you don't really need to know about that. Because 99% of "legacy" HTML4 websites don't validate in W3C anyway, so you don't really care. It's bad practice to use most of the things that are deprecated in HTML5 because a) they are deprecated for a reason and b) it does not make the website future facing. And we should also destinquish between what's actually new in HTML5 and the WHATWG features that people think is in HTML5 because all those other APIs have been thrown under the HTML5 buzzword. –  Raynos Jun 20 '11 at 15:19
1  
@Raynos ... and if you only know HTML5 and have to work on an HTML or XHTML site you will know what features of HTML5 won't work by intuition alone? For instance, just take doctypes, rendering modes, box model and compatibility modes as one small part. HTML5 may do away with these problems, but doesn't mean they don't still exist for the vast majority of existing sites. You can't call yourself a web-developer and be ignorant of them. –  Dan Diplo Jun 20 '11 at 15:29

Start with HTML simply and then slowly adopt other variations. HTML is a well-defined language just like XHTML

View already answered question on stackoverflow.com

http://stackoverflow.com/questions/413114/html-vs-xhtml-does-it-still-matter

share|improve this answer
    
A working knowledge of HTML 4 is going to be essential for some time to come. It is the lingua franca of the web, and isn't going to go away. XHTML is mostly just HTML 4 with an XML serialisation; if you know HTML 4, XHTML is pretty trivial. HTML 5 is a bigger leap, and since it isn't even standardised yet, something for a beginner to stay away from for now. –  Tom Anderson Jun 20 '11 at 12:20
    
yes the only difference is XML Serialization and some other points. –  pir abdul wakeel Jun 20 '11 at 12:27

"bother" with as much as you can (since you seem to be in the early stages). you only stand to learn more. nothing to lose

share|improve this answer
2  
Except people don't have infinite time, and don't want to waste half of their lives to learn unnecessary technologies. –  Davor Ždralo Jun 20 '11 at 9:02
    
@davor i think since he is a beginner .. he shud himself learn first hand that XHTML is a bad choice. the experience is worth it –  Wildling Jun 20 '11 at 10:36

XHTML has always been an invalid choice to start with. Essentially no site that advertises it will validate anyway, and the rare that do almost never serve the correct header.

Serve good old HTML 4.01, or HTML 5.

share|improve this answer
1  
So, paraphrasing, "XHTML is almost always used in the wrong way, so don't bother." That's the case with HTML as well, and is part of the reason why the web is still buggy and slow. –  l0b0 Jun 20 '11 at 8:44
    
@l0b0 -- More like: with HTML, his odds of making a non-trivial page validate at all are much higher. –  Denis de Bernardy Jun 20 '11 at 8:48
    
@Denis: Noone serves the right header because IE breaks horrifically when you do. –  Matthew Scharley Jun 20 '11 at 9:56
    
@Matthew: noone serves the right header, because widgets, share/tweet buttons, ad services and what not are almost guaranteed to turn valid markup into invalid markup. –  Denis de Bernardy Jun 20 '11 at 10:13
3  
The power of XHTML is not in the browser, but server-side. It is very clear that your "invalid choice" source have not understood this. –  user1249 Jun 20 '11 at 11:33

Not the answer you're looking for? Browse other questions tagged or ask your own question.