View Source considered beneficial, endangered

Alex Russell's essay, "View-Source Is Good? Discuss," considers the role that the browser's "View Source" command played in making the Web into the world's dominant platform, and looks at the threats posed to the idea that anyone can see how the Web works:

To understand the importance of view-source, consider how people learn. Some evidence exists that even trained software engineers chose to work with copy-and-pasted example code. Participants in the linked study even expressed guilt over it the copy-paste-tweak method of learning, but guilt didn't change the dynamic: a blank slate and abstract documentation doesn't facilitate learning nearly as well as poking at an example and feeling out the edges by doing. View-source provides a powerful catalyst to creating a culture of shared learning and learning-by-doing, which in turn helps formulate a mental model of the relationship between input and output faster. Web developers get started by taking some code, pasting it into a file, saving, loading it in a browser and hitting ctrl-r. Web developers switch between editor and browser between even the most minor changes. This is a stark contrast with technologies that impose a compilation step where the process of seeing what was done requires an intermediate step. In other words, immediacy of output helps build an understanding of how the system will behave, and ctrl-r becomes a seductive and productive way for developers to accelerate their learning in the copy-paste-tweak loop. The only required equipment is a text editor and a web browser, tools that are free and work together instantly. That is to say, there's no waiting between when you save the file to disk and when you can view the results. It's just a ctrl-r away.
View-Source Is Good? Discuss. (via O'Reilly Radar)

(Image: View Source on Google Image search, a Creative Commons Attribution ShareAlike image from Andrew*'s photostream)


  1. I learned HTML and Javascript through ‘View Source’. I’m all for it staying visible.

    In the fine arts, it has been an age-old method to learn the by ‘copying the masters’. We learn by repetition and experimentation before we can fly on our own. I am sure there are volumes of educational theory supporting this…

  2. +1 to everything here. My bread and butter is web development, particularly Drupal, and even though I’m “Senior Developer” I still get a large portion of the code I use from cut-and-paste, especially for new concepts. It’s the best way to learn, for me at least.

  3. ++1, That’s how I learned and that’s how I got my children interested in making their own websites as well.

  4. It’s the way I’m currently dabbling in web design.

    One learns by reverse-engineering, then creating. You don’t learn how to speak from a blank slate, you learn by tweaking what people are saying around you.

  5. When I first logged onto the net during the age of free web hosts like GeoCities and Angelfire, I learned how to create my own web pages using “view source” as a guide. The command was a real help for me as I was very interested in learning HTML, but could not afford the guidebooks at my local bookstore and didn’t know anyone who would teach me. Man, I can remember how much time I spent in Notepad with “view source” open in the background…

    Thanks BB, you’ve given me reason to smile this morning!

      1. I logged on for the first time in 1997, just after GeoCities introduced advertisements.

        It really killed the mood when I would visit a goth web site on GeoCities (with suitably moody MIDI music in the background) and see a flashing neon-colored banner ad for Tower Records (or whatever) above the animated flaming torch .gifs; that was price we paid for free web space!

        I also remember quite vividly the serendipity of clicking the “random” on the webring index at the bottom of a given page — like strolling through the stacks of a library…

  6. Ctrl-r seems really old-fashion. Firebug is transformative for the make minor changes – see results type of learning.

  7. I was unaware that there was any controversy. Is there? Either way, there certainly can’t be any discussions on whether it should “remain.” It would be impossible to remove the ability to see the source of the page. (Individual browsers could remove the button, but the source of the page is what is sent to you, so you would always have a way to have access to it.)

    1. They aren’t going to(nor could they) take away the ability to view source; but changes in the style of web development could make that ability far less useful.

      If a page is mostly flash/silverlight, the only HTML you are going to be learning the the embed tag.

      If the page is an inscrutable tag soup of giant javascript libraries and autogenerated boilerplate, viewing source is just going to be the beginning of a rather ugly bit of reverse engineering. Even more so for any deliberate attempts at obfuscation.

  8. View Source has become less useful over the past few years. Firstly, because so many pages are dynamically created, so the static page layout doesn’t really get at how the thing is constructed, and secondly, because so much of the layout is handled with CSS classes and if you can’t see the stylesheet, you can’t really figure out how the layout is working.

    1. Yes, even for the developer to figure out how his own pages work so that he can debug them. CSS hierarchy have layers coming in from a CSS server in Badapest? How exactly does that 30-level deep inheritance structure work? I would ban CSS if I could. It’s just a waste of time dumped on us by people who don’t know the difference between a word processor document and a web page.

  9. View Source can also be useful beyond copying, uh, I mean learning, such as when the site’s author has made a blunder that affects rendering of the page. Sometimes you can use View Source to see the content that the browser can’t/won’t display.

  10. I use “view source” all the time to fix the mal-formed HTML emails that the local newspaper sends me (or, rather, to participate in their polls because the button in their HTML emails doesn’t work).

  11. It hasn’t created too many problems, as web development is a culture of sharing. Designers show off their skills by writing a tutorial of how they did something and giving away the code. Anyone who wants to mung their source code wouldn’t have much trouble, though.

    The problem is when you get into things like HTML 5 video and content that requires DRM protection. I guess copy-paste also had the problem of letting everyone put code on the web, even those without the discretion to do so, see MySpace – but that problem was self-correcting.

  12. From a practical point of view, I still use View Source often to grab the direct link to embedded stuff all the time, usually because the page doesn’t work in linux.

  13. For those using Firefox, I highly recommend the excellent View Source Chart addon, which formats into blocks by syntax rather than by original code layout. For the older coders out there, it’s a pretty-printer for HTML.

  14. I use View Source all the time, mainly for writing screen scraper apps. If I really need to look at the code to find out where to add things, or what CSS is being used, I fire up Dreamweaver.

  15. thank you so much for this post. i was able to share it with one of my professors who taught us to code by hand in library school and had a very thoughtful policy about using/copying code for assignments while still learning and giving credit where credit is due.

  16. I feel compelled to chime in here too. I’m a self-taught programmer. I’ve never taken a class. I’ve learned everything I know about programming from books and example code. I’ve always had a, “follow it and see what it eats,” strategy toward coding. Example code, be it from a book or hot off a web site or just good old view source is critical.

  17. Those of you using Safari can turn on the Develop menu (go to Preferences, pick the Advanced tab, check the Develop menu checkbox at the bottom of the dialog). This gives you access to the Web Inspector, which is like a super-powerful View Source.

  18. This is news? In the Smalltalk world the approach has been to make sure users/programmers can see all the code for instructional, inspirational and reusablility purposes since day 1. Likewise the ‘instant effect’ thing; make a change and it takes effect now. This is 40 years ago and still in use.

    What was that about neglecting history and being doomed to repeat it? Or perhaps more directly applicable:-
    C++ is history repeated as farce. Java(script) is history repeated as tragedy.

  19. Avram @23

    The web inspector has been a godsend for me at times.

    Another big one for learning CSS was the (Mac-only) CSSEdit (, which allows you to pull the CSS from any page and mess with it live on the site. I love the immediacy of being able to mess with live code on someone else’s site and see the results as you type. I feel like I always learn best when I can just poke something and see what happens, rather than trying to build something from the ground up on the first go.

  20. I recently came across this YouTube video showing one practical use of “view source”: revealing the scrubbed text praising Ted Haggard on the Oral Roberts University web page:
    “Ted Haggard Erased from Oral Roberts University”
    YouTube user justinfeed (Nov 03, 2006)

    (Warning: the music at the very beginning is MUCH louder than the spoken commentary immediately following in the video.)

Comments are closed.