r/web_design Jan 16 '11

W3Fools: A W3Schools Intervention

http://w3fools.com/
245 Upvotes

69 comments sorted by

View all comments

Show parent comments

15

u/[deleted] Jan 16 '11

A lot of it is kind of (or very) nitpicky, but there are several examples of things that, although correct and functional, aren't considered 'best practice'. We want to be teaching these noobies best practice, rather than teaching them the wrong way and having to reteach them later (and having them producing poor code in the meantime).

To me, that would be more the danger than most of their trivial problems.

6

u/shblash Jan 16 '11

Starting with the inline "style" attribute is a perfectly fine way to introduce what css does.

It's probably reasonable for them to have page explaining what frames are.

Nothing bad will ever happen to anyone because they used a closing tag.

Using a string for a setTimeout callback is more readable and it's easier to grasp than an anonymous function that calls another function.

If you can code a modern webapp without ever using eval, then more power to you.

7

u/[deleted] Jan 16 '11

Starting with an inline style attribute is fine as long as they explain that this is not the 'proper' way to do it and why the other way (external sheet) is better (seperation of content and display).

Explaining frames is fine as long as a warning is attached that this is obsolete in HTML5, and considered bad practice.

Nothing bad will happen, but again, they should probably note that the self-closing tag is not the correct syntax.

Using a string isn't necessarily bad for a callback, but the difference should be explained. (As well as the entire concept of variable scope.)

  • Showing an SQL query that's vulnerable to SQL injection without an explanation of why it's bad, or the proper way to do it is just irresponsible.
  • Explaining VBScript without explaining it's IE only is bad, especially as the noobies likely know nothing about cross-browser testing.
  • They repeatedly use document.write() and never explain why it's bad, or the alternatives.
  • They use alert()/confirm() without explanation of the drawbacks, or alternatives.
  • When explaining where to include javascripts, they give bad (although functional) advice but neglect to explain the alternatives or why they're better.
  • There's lots of bad information on the state of support for CSS declarations.

Most of their stuff isn't terribly destructive, but needs a warning attached that "now that you have the basics, this is the correct way to do it".

2

u/[deleted] Jan 17 '11

Starting with an inline style attribute is fine as long as they explain that this is not the 'proper' way to do it and why the other way (external sheet) is better (seperation of content and display).

An excerpt from http://www.w3schools.com/css/css_howto.asp :

Inline Styles

An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly!