PDA

View Full Version : proper html design today?



billbenson
06-05-2011, 01:57 AM
I started doing web design over 10 years ago. Today I don't really to much web design, but I write a lot of php scripts for admin sort of functions on my sites. Since its for my eyes only it doesn't need to be pretty or error free in a code check. It just needs to spit out the data I want. I use css for layout.

I know I'm using sloppy old html coding. Works fine for what I'm doing but... I want to keep current. If I'm writing pages, I might as well use them as an educational tool and do proper html design.

So what standards etc should I be writing html to today to be current? I'm only talking about html, but if I should be using other code such as js clientside or at least know it I'm interested in input on that as well.

So, I guess, how should code standard sites be coded today?

MostHeather
06-05-2011, 06:07 AM
Websites have changed a lot over the years, now search engines favor websites that load fast and provide a better user experience. Proper coding is also pretty important and there are numerous platforms that can provide this without you having to code yourself, which is great because you can focus on the things that are really important. What are you currently using?

billbenson
06-05-2011, 10:45 AM
I hand code in a linux text editor that flags a lot of errors. Since I'm interested in coding properly, I'm not as interested in code editors. My web pages are half php anyway and that pretty much requires hand coding.

vangogh
06-05-2011, 11:36 AM
Bill I'm not entirely sure what you're looking for with your question. I certainly can't teach you everything about html in a single post. Are you asking something like whether or not to use xhtml 1.1 or html5?

(x)html hasn't really changed all that much in the last few years at least where xhtml 1 and html 4 are concerned. html5 is the new kid on the block. The spec isn't completely done, but you most browsers are already supporting a lot of it right now so you can already use much of it. It uses the simple doctype


<!doctype>

which will work in any browsers. html5 aims to be backwards compatible with older versions of html. It doesn't force any kind of coding style so you can mix upper and lowercase and even leave off the closing tags, however best practice will likely be following the xhtml style of all lower case, closing all tags, using quotes on attributes, etc.

If you really want to code well it's more than just html though. The best developers will code in a way that lets their site work across as many platforms as possible. That includes different devices, operating systems, and browsers. They'll do this by using html and css they know to work across all those platforms. Then they'll add things to create better experiences on those platforms that can accept the code to create the better experience. It's called progressive enhancement.

When building the better experience you'll use css and javascript that may not work on every platform, but won't cause the site as a whole to not work.

Spider
06-05-2011, 11:43 AM
That's cool! So, if I understand this correctly, I can continue to learn css at my own (slow) pace and bone up on html5 and be ahead of the game.

Boy! It's been a few years since I've been ahead of the game!

Is html5 expected to replace xhtml?

vangogh
06-05-2011, 11:57 AM
Nope. To be able to do this stuff right means a deep understanding of how it all works. And it's a lot more than just knowing the syntax of the language. You really need to understand how and why all the code you use works in order to use it well.

If you use the doctype above you're using html5 and all the html you currently write should work with it. html5 won't be complete as a spec for another 10 years approximately. Using the new stuff now is more about whether or not browsers are supporting it. As you might guess Internet Explorer lags the most, however there are workarounds, usually involving one or more javascript libraries.

Eventually html5 will be what most everyone uses, but html 4 and xhtml 1 should still work. Those will only stop working if and when browsers stop supporting their doctypes and that will probably only happens once everyone stops using them. html5 isn't a new language you have to learn. Like I said it's backwards compatible so whatever html you're using now is still going to be html when you start using html5.

To be ahead of the game you're going to need to learn more than the doctype though and you're going to need to learn more than html5. You'll need to know css up to css3. You'll probably want to know some javascript. More than anything you'll need to learn best web development practices. You can make a good or bad page using the most the most up to date code. Developing websites is a lot more than knowing the tags of html.

Spider
06-05-2011, 12:08 PM
Aw shoot! You're not making this easy, y'know!!! :-)

billbenson
06-05-2011, 12:15 PM
I intentionally left the question open ended. You did, however, pretty much answer my questions. If I understand your answer correctly, and understanding that the html that I do is by and large fairly simple but I want to stay abreast of the technology, I should write in html5?

Whats the difference in the different css's? Should I be using css3 and what is it?

Can you elaborate on what you mean by "best web development practices"?

vangogh
06-05-2011, 12:23 PM
First for anyone wanting to learn html5 here's a free online book: Dive into html5 (http://diveintohtml5.org/)


Aw shoot! You're not making this easy, y'know!!! :-)

Sorry. Think of it like this. I can drive a nail with a hammer and turns screws with a screwdriver. In fact I can use all the tools in my toolbox rather well. None of that makes me a good carpenter.


Whats the difference in the different css's? Should I be using css3 and what is it?

The difference is that the newer versions add new things. css3 isn't a different language or anything compared to css2.1 It mainly adds new properties and values. It doesn't replace css2.1. It adds to it. It's similar with html5. You don't need to unlearn html 4 or xhtml 1 to learn html5.


Can you elaborate on what you mean by "best web development practices"?

Not really in a single forum thread. If you have specific questions I can try to answer them, but if you want to understand best practices the best thing to do is start following the blogs of web developers, read some books or online tutorials. There's not really a single recipe of best practices.

Spider
06-05-2011, 12:40 PM
"Best practices" is a phrase used to keep out wannabes and pretenders and make the task at hand seem more difficullt and more exclusive than it really is!


OUCH! Do you throw something at your monitor, VG?!!!

vangogh
06-05-2011, 01:06 PM
That's not true at all. Best practices are the difference between building something and building something good. Sticking with the carpentry analogy best practice says if you want to drive a nail you pick up a hammer. You can also drive a nail with a screwdriver, a wrench, a rock, or anything heavy enough. The best practice of using a hammer isn't to scare off wannabe carpenters. It's guidance for how to do the job the best way possible.

If you follow best practices you're generally going to end up with a better result than if you don't follow them. If you don't follow them you can still end up with a workable result, but it's less likely to work well or last over time.

Spider
06-05-2011, 01:10 PM
Hmm. I guess you are in a serious mood this bright sunny Sunday morning, while I'm in a more whimsical mood.

Got it. Best practices = better websites. And better cabinets!

:-)

vangogh
06-05-2011, 01:16 PM
I had a feeling you might be joking. It's Sunday morning though and my funny bone is on the fritz. And unfortunately my funny bone repairman didn't follow best practices the last time he was here. :)