As developers, we have an enormous amount of information about our domain at our fingertips. As our skills grow, so does our ability to filter out poor learning resources and quickly extract information we want. I think that this ability is something that we often take for granted. But beginning programmers often lack this intuition and end up relying on mediocre sites that encourage bad practices.
To illustrate this, consider W3Schools, an online resource that attempts to teach people how to build websites. Despite its popularity and prominent status in search results, its information is often inaccurate, and it neither follows nor teaches established best practices in web development. In fact, the site W3Fools was created by many respected members of the front-end developer community to criticize W3Schools (you should check it out if you haven’t seen it). While I agree with W3Fools’ overall argument that W3Schools is a poor learning tool that harms the community, I think that W3Fools has some shortcomings that illustrate the difficulties of improving the quality of learning resources.
First, I think that W3Fools resonates primarily with web developers who are already aware of the problems with W3Schools. W3Fools picks out several examples from W3Schools of inaccurate content. But a casual user looking to learn some basic HTML is unlikely to care that <p> tags need not be closed according to the standard, that file extensions are flexible, or that passing a string to setTimeout is bad because it uses eval. In fact, the latter example says:
You never pass a string to setTimeout() unless you like using eval(). Passing a string also means, among other things, that you can’t use any variables from your local scope. Also, the examples on [the W3Schools] page use a ton of global variables. Bad.
If someone is using W3Schools and passing a string to setTimeout, he/she probably doesn’t understand why eval is bad, why inheriting scope might be useful, or why using global variables is harmful. I think the inverse is also true: I find it hard to imagine that someone who understands the concepts discussed here would use W3Schools to begin with. Further, the tone here is belittling and could easily alienate someone relatively new to programming. This isn’t just speculation: a quick Google search reveals complaints that the W3Fools effort is arrogant and non-constructive. I believe that this critique is false: many of the contributors have done a lot for the community, and W3Fools links to alternate resources. But the tone of the page and the fact that many beginners find it inscrutable makes it easy for people to draw the incorrect conclusion.
Second, the alternate resources that W3Fools recommends don’t provide quite the same functionality as W3Schools. Although they are more comprehensive and accurate, many are not structured to be a quick reference. It’s important to remember that the allure of W3Schools is that it’s easy to quickly see an example of how to use a particular element or function. The structure of the MDN docs, an alternative resource W3Fools recommends, isn’t always conducive to this use case. For instance, the entry for eval doesn’t warn against the use of eval until about halfway down the page. This section is quite easy to miss. I believe it would be much better if there was a more prominent warning against the user of eval near the top of the page that linked to the more detailed explanation. The “Don’t use eval!” section itself is written well and the bulk of the content doesn’t need to change, but the page structure simply isn’t optimized for skimming.
The W3Fools example illustrates what I think is a broader problem with educational programming content. Many resources that are beginner friendly are infested with poor practices as they often aim to teach the bare minimum required to create a functional program. Beginners like being able to quickly reference how to use something or to follow a simple tutorial that builds something tangible. They often don’t care enough about conformance to best practices or specs to do further reading or sift through longer articles.
Christian Heilman from Mozilla discusses this issue eloquently here, where he criticizes a tutorial for beginners that uses poor security practices. I agree with most of what Heilman says, but one passage near the end of the article confuses me:
The Web is full of materials to learn the same things. The quick “here’s the solution — don’t worry about how it works right now” are the most successful ones. We also have a Web full of systems that lack very basic quality and security features and we spend months educating hires in companies what developing production code means when you protect the data of our users.
I think it is time to stop chasing the hollow success of creating a “quick tutorial” that is actually a “bad implementation with quick, sloppy code” in disguise and start curating what is already on the Web. We can then concentrate on the next level tutorials.
The second paragraph seems at odds with the first. Even if we managed to curate the good content on the web as Heilman suggests, many beginners would still gravitate towards the poor ones. And, as the W3Fools example shows, replacements for poor resources like W3Schools exist, but it’s hard to convince beginners to switch without sounding pedantic and using jargon they don’t fully understand.
I believe that the solution, if one even exists, would require a new paradigm for programming education that is fun for beginners and maintains best practices. As W3Fools suggestions, it should be community-driven so that information stays up-to-date. As a reference, the MDN docs optimized for skimming should be adequate. For tutorials, a platform like Codecademy has potential (disclaimer: I have worked with Codecademy). Though it currently doesn’t have that much content, it has attracted an enormous amount of interest and beginners in particular are drawn to the site. If the Codecademy community grows in the right way, it has the potential to become something that can overcome the institutional inertia of something like W3Schools while encouraging best practices. However, it is extremely difficult to teach good practices while maintaining the pace and lightness of its current lessons; we’ll just have to wait and see if Codecademy can strike this balance successfully.
Regardless of what the solution is, I think that its importance is clear. Teaching bad practices leads to a less educated programming community and lower overall software quality. I’m certainly not the first to point out this problem, but most of the discussion I’ve seen on this has focused on making educational resources more comprehensive, which doesn’t seem beginner-friendly. If we don’t change our approach to this problem, beginners will gravitate to sites like W3Schools and the developer community will suffer.