View Source considered beneficial, endangered

Discuss

28 Responses to “View Source considered beneficial, endangered”

  1. RichSPK says:

    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).

  2. ian_b says:

    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.

  3. Xenu says:

    I hate to say this, but 90%+ of all code was copied and pasted from somewhere.

  4. snsr says:

    I’ll never use a browser without it.

  5. sassylibrarian says:

    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.

  6. OneAmp says:

    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.

  7. Anonymous says:

    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.

  8. fencepost says:

    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.

  9. Avram / Moderator says:

    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.

  10. Agies says:

    IE8 actually has a fairly fantastic source viewer.

  11. Robert says:

    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.

  12. Keith K says:

    Avram @23

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

    Another big one for learning CSS was the (Mac-only) CSSEdit (http://macrabbit.com/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.

  13. tim says:

    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.

  14. marco antonio says:

    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…

  15. phillamb168 says:

    +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.

  16. The Thompson Five says:

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

  17. Daedalus says:

    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.

  18. davidasposted says:

    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!

    • marence says:

      You’re making me nostalgic for 1994.

      • davidasposted says:

        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…

  19. figment88 says:

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

  20. SamSam says:

    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.)

    • phisrow says:

      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.

  21. edinblack says:

    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)
    http://www.youtube.com/watch?v=leOnaJqDOXo
    (Warning: the music at the very beginning is MUCH louder than the spoken commentary immediately following in the video.)

  22. wetzel says:

    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.

    • Nadreck says:

      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.

  23. jenjen says:

    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.

Leave a Reply