Jump to content
Larry Ullman's Book Forums

Xhtml To Use Or Not To Use Please?


Recommended Posts

Hello,

 

i am reading PHP for the web. It includes examples with xhtml. As a beginner programmer I am wondering weather I should use xhtml or html 5 in it's place.

 

The reason I am asking is that I have read that xhtml is no longer in use.

 

Thanks.

Link to comment
Share on other sites

XHTML is still very much in use. You can feasibly use either, but there's a strong argument for using HTML5 currently. They are very similar at a base level so for the book it doesn't make much difference as the book is about PHP. It would be easier to just follow the book and it's (presumably) XHTML I suspect as it's about PHP. But if you could always do some light reading around HTML5. I always liked w3schools for intros, i've never read this piece but it may be of some use to you as a side project.

 

http://www.w3schools.com/html/html5_intro.asp

Link to comment
Share on other sites

Yes, there's no harm in using XHTML but you should start moving towards HTML5 when you're ready. This is probably the last book/edition that I'll use XHTML, but I didn't want to add the new concept of HTML5 to the process of learning PHP for beginners.

Link to comment
Share on other sites

GeorgeD, the debate of HTML vs. XHTML is probably the longest and most contested in all of web development. As such, I'm not going to argue one vs. the other. However, if you're going to use XHTML, there are a lot of things to consider. To get the full story, I highly recommend checking out the following two links:

http://friendlybit.c...-is-a-bad-idea/

http://www.webdevout...beware-of-xhtml

 

I tend to be more practical than anything, so over time, I have personally concluded that HTML is the better choice, but with that said, with HTML, you have to take it upon yourself to always write 100% valid markup. I highly recommend always using the W3C HTML validator to validate all HTML you write.

It's also worth noting that XHTML5 is now a reality (kind of), but as usual, browser support is abysmal, and it'll probably be 10 years (no joke) before IE even supports it (that is, assuming IE is still around in 10 years).

Link to comment
Share on other sites

Jonathan, Larry, Hartley and Antonio, Guys thankyou very much for your replies and links. It's so nice to have my question answered so fast and so well. I'll do the exersises in XHTML for now and as I get better at HTML5, I'll switch to that.

 

I know where to come for sensible answers now!

 

Yours sincerely, George. ^_^

Link to comment
Share on other sites

 Share

×
×
  • Create New...