144

I have linked to http://www.w3schools.com many times in the past when answering an OP's question. Almost every time, someone eventually tells me that that was not a good idea.

Why is referencing or linking to http://www.w3schools.com a bad idea? I learned most of my coding skills there, and I find it very useful. What are the advantages of the MDN or others? What makes W3Schools bad, and MDN good/better?

I never post link-only answers, and I've only used those links to back up my answers. But look at what some users have said about W3Schools:

I would strongly advise against using w3schools as a reference, see W3Fools for good reasons not to.

By @apaul34208

W3Schools is not regarded as one of the best places to learn JavaScript / jQuery. A well-respected alternative for JavaScript is MDC's JavaScript Guide. For jQuery, check out the tutorials page.

By @Andrew Whitaker view comments on this subject at this post

5
  • 6
    Linking without copying the essentials from the linked resource is a bad idea. Not that particular site at all ... Commented Dec 17, 2014 at 1:52
  • 33
    You can find the reasoning in the archived version of w3fools.com
    – Antony
    Commented Dec 17, 2014 at 2:12
  • 53
    Tell anyone citing W3Fools that they need to go read that page. It doesn't say what they think it says anymore.
    – Bill the Lizard Mod
    Commented Dec 17, 2014 at 2:30
  • 1
    @Antony: Thanks, I needed a laugh. ("Example: Play a sound after each occurrence of an h1 element: h1:after{content:url(beep.wav);}")
    – Kevin
    Commented Dec 21, 2018 at 2:58
  • 1
    10 years later, W3Schools uses <br> elements to add space between block elements on their own homepage. And inline styles everywhere. Just to mention the first 2 things that struck my eyes when I checked their homepage code today.
    – MrUpsidown
    Commented Mar 7 at 14:31

6 Answers 6

208

They've gotten ... somewhat better in the last year or so, but they used to be notorious for serving outdated, or outright bad information. Folks got pretty fed up with them because people would go there, get bad information, then end up on Stack Overflow wondering what went wrong. Hence, even as a 'supplementary' resource where you've given all of the important information within your question itself, links to them tend to fall under scrutiny.

There was also the issue with them continuing to make new sub domains in order to prevent folks from filtering them out of search results. There's quite a bit of history there.

There's no issue with linking to information you believe (or, better, know) to be accurate, but as others have noted, consider linking to official documentation instead. It's maintained much better, it often links to even more related material, and (most) provide at least rudimentary search functionality. Tutorial websites are great, but no substitute for learning how to find and read endorsed documentation.

Just write good answers that teach. Don't just link to a tutorial, write a better one. If you do that, you're fine.

0
52

Link-only answers are always discouraged because a link isn't answering a Question and has the potential to break if the link goes bad.

If you are supporting an Answer with a link (which is usually a good practice), then it's always best (when possible) to link to the authoritative source for any given reference links:

eg.

etc, etc, etc

The reason being, the authoritative source is unlikely to dissappear while languages are still in use, they're likely to be updated when technologies change, and they're unlikely to contain misinformation.

9
  • 3
    Agree entirely, though I also find W3schools to be a good reference for HTML (and sometimes javascript). I certainly wouldn't downvote if the reference came from there instead of MDN. Commented Dec 17, 2014 at 1:58
  • 2
    Well, I do use links as a further reading link, I never post link only answers. I mean, you can look at my profile itself! It's just that some users seem to have something against that site ?!?! Commented Dec 17, 2014 at 2:01
  • 1
    I've used W3Schools a lot in the past too, but have had my Answers with links to there corrected to the relevant MDN pages by editors. I do think if the same info is expressed as clearly on MDN it is a better link target, but when links are changed to a less easily understood reference page it can be a problem. Commented Dec 17, 2014 at 2:03
  • @Godisgood Could you post some examples where this has occurred? Certainly some people may not like a particular site of course. Commented Dec 17, 2014 at 2:05
  • 1
    Here's an example of one of my Answers that was edited from w3schools to MDN: stackoverflow.com/a/24112428/3651800. Commented Dec 17, 2014 at 2:09
  • @BradleyDotNET, I've put some in my question. Commented Dec 17, 2014 at 2:09
  • 23
    Although (by my dictionary) MDN is authoritative, it is not official; if we wanted to point people to the official reference—well, for getElementById, I’d have to give them this. Pedagogically, that’s probably not the right thing to do, though.
    – icktoofay
    Commented Dec 17, 2014 at 2:41
  • 8
    @icktoofay Sadly there's often a huge gap between official and helpful, which is probably why there are so many questions on Stack Overflow! Commented Dec 17, 2014 at 2:44
  • 2
    @MattCoubrough To be fair, in this case W3C isn't trying to make day-to-day reference documentation. They're trying to rigorously specify the precise behavior of a function, so that implementers can know exactly what to do to meet the standard. (sorry for the necro but wanted to point that out)
    – Nic
    Commented Oct 31, 2018 at 22:50
17

I'll take a stab at this seeing as how I'm one of the guilty parties.

W3schools isn't the worst reference, but even their more accurate stuff isn't great. The information presented isn't usually all that deep and the explanations of why things work the way they do is often lacking.

Personally I prefer MDN for most things, but when needed I also go to the w3c directly.

When I was brand new to HTML, I used w3schools as learning resource. I suppose it can offer some really simple answers to really simple questions and they usually top the search results...
But when there are better resources available why not use those instead?

I haven't bashed w3schools in a while, not saying that I wouldn't, but I haven't seen anyone link to their stuff lately.

If our goal is to "make the internet better" I think we can do a little better than using w3schools as a reference.

10
  • 4
    The w3fools site also mentioned webplatform.org. It solves one problem I've always had with w3schools: ads. The fact is, w3schools exists to make money for its owner(s). WebPlatform exists to be a reference for web technologies, and that's it. Commented Jun 2, 2015 at 19:57
  • 3
    It's related to your audience. Try with this piece of w3c.org's prose on CSS color on a new-to-HTML: "UAs may vary in the fidelity with which they represent these colors, but use of sRGB provides an unambiguous and objectively measurable definition of what the color should be, which can be related to international standards." (Wait, let me fetch a dictionary.)
    – Jongware
    Commented Jun 2, 2015 at 19:57
  • 1
    @Jongware That's a good example of why I prefer MDN, solid docs that tend to be a little more digestible.
    – apaul
    Commented Jun 2, 2015 at 19:59
  • 12
    Some of my favorite answers on SO are those that taught me to interpreted w3c docs. These are the "teach a man to fish" posts we should all be striving for - they remain valuable through multiple revisions of the standards, while w3schools just rots.
    – Shog9
    Commented Jun 2, 2015 at 20:34
  • 5
    Based on some of the comments I'm reading here and a little reading between the lines, I think one possible reason references to w3schools get down voted might be because some people just don't like for-profit websites (if you check out the site, you'll notice there's quite a bunch of ads here and there (at least they're technology related)). On another note, reasons for why w3schools gets used a lot is because the organization of content is rather simple (I hate going into official documentation only to find that it's complicated to read). Anyhow, still a good reference for basic html. Commented Jul 19, 2015 at 16:59
  • 3
    It's mostly snobbery.
    – Chalky
    Commented May 13, 2016 at 8:53
  • @HereticMonkey webplatform.org is discontinued since 2015
    – yunzen
    Commented Dec 21, 2018 at 9:32
  • @HerrSerker webplatform.org was discontinued in September of 2015 — if you look very carefully at the time stamp of my comment, you’ll see it was written in ... June of 2015 :). Commented Dec 23, 2018 at 7:11
  • 1
    @HereticMonkey That may be the case, but it is discontinued whatsoever
    – yunzen
    Commented Jan 7, 2019 at 8:16
  • 1
    And the fact that it was discontinued illustrates >another< reason why linking to sites like that can be a bad idea.
    – Stephen C
    Commented Nov 26, 2020 at 23:19
12

I still see today that there is some misinformation at W3Schools that confuses coders.

For example, such confusion surfaced in this question. At the time of writing this, W3Schools explains what happens when you assign a string property to a JavaScript array as follows:

If you use named indexes, JavaScript will redefine the array to a standard object.

Compare this to what MDN has on the topic:

Arrays cannot use strings as element indexes (as in an associative array) but must use integers. Setting or accessing via non-integers using bracket notation (or dot notation) will not set or retrieve an element from the array list itself, but will set or access a variable associated with that array's object property collection. The array's object properties and list of array elements are separate, and the array's traversal and mutation operations cannot be applied to these named properties.

But MDN is also not perfect

In another question it surfaced that MDN's page on "strict mode" has/had a code snippet with a comment that is misleading some readers:

First, strict mode makes it impossible to accidentally create global variables. In normal JavaScript mistyping a variable in an assignment creates a new property on the global object and continues to "work" (although future failure is possible: likely, in modern JavaScript). Assignments, which would accidentally create global variables, instead throw an error in strict mode:

'use strict';
                       // Assuming a global variable mistypedVariable exists
mistypeVariable = 17;  // this line throws a ReferenceError due to the
                       // misspelling of variable

... The "Assume" part in the comments is of course not conditional to the error being thrown. They should just have added an example declaration like this:

'use strict';
var mistypedVariable;
/* ... */
                       // Because of the spelling mistake
mistypeVariable = 17;  // this line references a variable that was not
                       // defined and throws a ReferenceError

Verdict?

Except for the authoritative text itself (the ECMA-262 standard) it should be no surprise that other (more accessible) texts will at times be less accurate or even plain wrong. Earlier spotted mistakes have been corrected over time. Those that have a wiki-like update mechanism get fixed sooner, but are also vulnerable to temporary glitches.

One should be always careful in relying on one source only.

3
  • 14
    Also note that w3schools is closed and only the owner(s) can update it. MDN is essentially a wiki that can be peer reviewed.
    – j08691
    Commented Dec 20, 2018 at 21:05
  • 5
    There is no any resource which 100% accurate. Even you can find a lot of mistakes in StackOverflow, but those content will be updated with time since content managed by users in here... For me, W3School is one of the best resources for beginners. Commented Dec 21, 2018 at 5:04
  • 1
    Should make it explicit that your W3S example is not just incomplete but plain wrong, Every array is already a "standard" object.
    – OrangeDog
    Commented Nov 26, 2020 at 23:55
0

When someone asks a question, it's usually a problem that can be broken down to one or more API or library methods, constants, whatever.

On W3Schools, I usually see problems explained or "explained", similarly to how you would ask a question here, like "how to create and style an HTML table" or "how to render a list of elements to li tags using JavaScript".

So it sounds intuitive to link them to such an article or tutorial.

However, I find it much more productive to explain exactly how to break down what they want to do or what's wrong with what they were trying to do in an answer, and link them to the individual API or library methods, constants, whatever.

These will be without a doubt more accurate on MDN, as it's actively updated, and in case it becomes outdated, it's marked there, and you are linked to newer alternatives.

-18

A good place for starting

W3Schools is perfect for a beginner with its clear interface.

Its Tryit Editor and tutorial notation help to keep the learning motivation.

I'm personally totally new into coding, and the W3C approach helps me better than any other.

6
  • 9
    When I was one to two weeks into python coding, I decided to take some tests on w3schools. Turns out, I spotted many flaws in the "answers" even with such little coding knowledge.
    – Red
    Commented Nov 26, 2020 at 21:57
  • 3
    It's perfect if you want to learn the concepts only. Not for learning about how the languages really work. Once you try to actually solve a problem or make something useful, it's not sufficient. Don't go for insufficient and easy, go for good and thorough :)
    – Scratte
    Commented Nov 26, 2020 at 22:59
  • 1
    Find a site/channel that's dedicated to teaching the specific language or technology that you are studying. Even better if they have "learning paths" that start with the basics then builds on top of it to get to advanced topics. W3schools is more of a "memorize these things" type, they try to cover everything so it lacks explanations, and they don't even teach you to use the official docs of the language/tech/tool you are learning. Commented Nov 26, 2020 at 23:40
  • 1
    What do you by "W3C approach"? W3C is an international standards organization for the World Wide Web. How is it related to W3Schools? It is close in name, but does W3Schools actually take such an approach (whatever that approach means)? Commented Nov 27, 2020 at 3:31
  • 8
    "W3Schools was created in 1998, and derives its name from the World Wide Web (WWW) but is not affiliated with the W3C." w3schools.com/about Commented Nov 27, 2020 at 3:54
  • 5
    -1 This reads strongly like an ad or a review comment.
    – Brondahl
    Commented Jul 31, 2022 at 10:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .