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.

A few years ago I considered myself somewhat of a web developer, knowing the basic 3 languages (HTML, CSS, JS) and lots of PHP. Moving on from simple text to actual websites was a pain because of the so called "standards" out there, which at the time were ridiculously complicated for me. It pretty much boiled down to this (minus the IE related stuff):

Web development in a pie chart

Standards are there to replace old ways of doing things in a simpler way. However when trying to actually implement some of the stuff (Entirely CSS based layout for example), it took me 10x longer to actually do it then if I did the simpler and still working solution. If it rendered the same, then why should I use the more complicated example that takes 10x longer and breaks once you change browsers? This sparked many long religious debates in ##php, ##css, and ##js in Freenode IRC and actually got me banned from ##css because I messed with their little world over there.

My question: Should I follow every single standard and coding conventions even if they take me 10x longer but get me the same result as the simple one?


For the poll tag, those of you who have websites of any size (huge or small), do you follow all the standards?

share|improve this question
1  
Typo in the question title - "singe" should be "single" –  Paddyslacker Sep 9 '10 at 1:12
    
@Paddyslacker Thanks –  TheLQ Sep 9 '10 at 1:59
    
Have of that chart is anti-IE though... –  Ullallulloo Sep 9 '10 at 2:04
    
Standards and conventions are quite different. I'd say follow standards (W3C-specs, valid code), because things will break if you don't. But tableless design is a guideline, preference, best practice, but not a standard in itself. –  Inca Mar 8 '11 at 16:47
    
i came up with an algorithm to increase productivity by 47% +/-5%. Start by developing in IE and you will not have to worry about FF,Chrome, safari, etc.... :). all other browsers just work –  Ibu Jul 27 '11 at 5:27

6 Answers 6

I would say 'adhere' to standards as best as you can - but don't waste too much time nitpicking, sometimes you can over engineer a standard HTML/CSS in the pursuit of standards perfection and be left in the worst state.

As an example, in one of our web applications we have a page for invoicing. The page lists a long list of items to be invoiced and contains several columns. The original developer went so overboard with the "Tables are evil" syndrome he designed the whole 'table' structure in CSS.

Pretty impressive, until you are the one who now needs to add an extra few columns to the report, watch those columns go all over the place because you need to readjust the CSS settings, width etc..... nightmare.

If the developer wasn't so anal about following so called standards right down to the tee, he would of realised that actually, a regular html table would make soo much more sense, the invoice date is after all, tabular.

This leads me onto semantic HTML. I do believe that your HTML should only contain elements that describe your page. Styles should be stored in CSS and at the very worst, entered in the 'Style' attribute of the HTML tag where applicable.

I also see no valid reason why one should not put their HTML through a validator - provided you are getting valid HTML you are pretty much there.

share|improve this answer

Don't follow stanards blindly. Some standards are good, some are bad. They serve various purposes and some, like the drafts of HTML5, serve to push a collection of the big browser makers and web developers in one particular direction that seems mostly good. But always remember that there are loads of terrible things out there that have been standardized...

COBOL was a standard, too.

share|improve this answer

The standards writers have thought of things that haven't occurred to you, such as accessibility concerns. Standards exist for a reason. And, with HTML5, standards are fairly easy to follow.

There may, occasionally, be reason to not follow the standard, but following it should be your default behaviour.

share|improve this answer
1  
That sounds fair enough. I try to follow general standards, just not every single one of them –  TheLQ Sep 21 '10 at 20:25

Your first consideration should be supporting the browsers that your customers use. Secondly you should adhere to standards when applicable.

For example, in a recent project the only browser we had to support was Firefox 3.5. This meant we could use the -moz css properties without worrying what the page would look like in another browser. Would it really have been worth doing rounded corners the long way, just so we were using standard css?

Having said that, when creating sites for multiple browsers, standards will usually help you, rather than hinder you. I would try to adhere to most standards, but not lose any sleep if I had to deviate for browser compatibility.

For the poll, the answer from me is No.

share|improve this answer

Product first, then polish.

Get your site/application/game doing what it's supposed to do. Get it up and running, and get people interested.

Then, when you have the time, go back and polish it up. But only because you care, not because anybody else does.

Of course, if the non-compliance issues mean people can't view it, or it's unreadably ugly, or it takes a month to load, or it's hard to maintain, or it crashes the browser, this is a major problem. But it would still be a major problem even if you were standards-compliant.

Ordinary users do not look at the source for a website that isn't loading and go, "Well, it's not displaying the pictures, but it's completely W3C-compliant". They simply browse to another website and never return.

Bottom line, standards are there to make writing browsers easier, and to close up potential security holes. Amazon, Penny-Arcade and Stack Overflow do not make their money from running a standard-compliant website. And unless you're in a website-writing competition, neither will you.

share|improve this answer

Laziness is not an excuse for not following the standard. Sometimes, if the standard is stupid, that is a reason not to follow it. How do you know when the standard is stupid? When you have been making a good faith effort over an extended period to follow all the relevant standards in letter and in spirit and you've come to a reasonable and well-supported conclusion that the standard in some niche case is actually at fault, not you.

Most of the time, this will not be applicable though.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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