Debian Codegraph @

www/src/content/essays/right-click-view-source.md

raw symbols SCIP
1 ---
2 title: "The #ViewSource Affordance"
3 description: "In this essay, Carson Gross explores the significance of the #ViewSource affordance in preserving the open, collaborative culture of the early web. He examines the impact of digital and technical enclosure on this culture, highlights the importance of developer decisions in maintaining openness, and advocates for prioritizing #ViewSource-friendly practices in modern web development."
4 created: 2023-09-21
5 modified: 2023-09-21
6 authors: ["Carson Gross"]
7 tags: ["the-case-for-hypermedia"]
8 ---
9
10 > Not for nothing, Hypercard presaged the web's critical "#ViewSource" affordance, which allowed people to copy,
11 > modify, customize and improve on the things that they found delightful or useful. This affordance was later adapted
12 > by other human-centered projects like #Scratch, and is a powerful tonic against #enshittification.
13 >
14 > \-\-[Cory Doctorow @[email protected]](https://twitter.com/doctorow/status/1701934612686196872)
15
16 ## Open Culture & The Web
17
18 When people talk about open source software, that conversation is often dominated by
19 [the Free Software Foundation's notion of free software](https://www.gnu.org/philosophy/free-sw.html):
20
21 > “Free software” means software that respects users' freedom and community. Roughly, it means that the users have the
22 > freedom to run, copy, distribute, study, change and improve the software.
23
24 This definition of free software has been a useful one and, through advocating for it, the FSF has gifted the world a
25 lot of wonderful open source software.
26
27 Web applications, however, have always been an uncomfortable fit for this definition of free. This is mainly
28 for technical reasons: web applications involve a web browser interacting with a web server that is, typically, running
29 on a remote system.
30
31 At a fundamental level, the REST-ful architecture of the web was built around _hypermedia representations_ of remote
32 resources: browsers deal only with hypermedia representations provided by the server and, thus, have no visibility into
33 the actual source of the code executing on the server side.
34
35 Now, the web has certainly _leveraged_ free and open source software in its growth: browsers are typically (at least
36 mostly)
37 open source, server software is often open source, and so on. And there are, of course, open source web applications
38 that users may run for things like forums and so forth.
39
40 However, from the standpoint of typical web application users, web applications are not free in the FSF sense of that
41 term: the users are unable to see and modify the source of the server code that is being executed as they interact with
42 the application via the browser.
43
44 ### Right-Click-View-Source As Culture
45
46 Despite the fact that the web has a somewhat uncomfortable relationship with the notion of free software, the early web
47 none-the-less had a radically open _developer culture_.
48
49 In fact, in some important and practical ways, the early web had a _more_ open developer culture than what was achieved
50 by the free software movement.
51
52 The [#ViewSource](https://en.wikipedia.org/wiki/View-source_URI_scheme) affordance available in browsers allowed people
53 to understand and "own", at least in an informal way, the web in a way that even most FSF-conforming applications could
54 not: you had direct access to the "source", or at least _part_ of the source, of the application available from
55 _within_ the application itself.
56
57 You could copy-and-paste (or save) the "source" (HTML, JavaScript & CSS) and start modifying it, without a complicated
58 build tool chain or, indeed, without any tool chain at all.
59
60 This radical openness of the web allowed many people, often not formally trained computer programmers, to learn how to
61 create web pages and applications in an ad hoc and informal way.
62
63 In strict free software terms, this was, of course, a compromise: as a user of a web application, you had no visibility
64 into how a server was constructing a given hypermedia response.
65
66 But you could see _what_ the server was responding with: you could download and tweak it, poke and prod at it. You
67 could,
68 if you were an advanced user, use browser tools to modify the application in place.
69
70 And, most importantly, you could _learn from it_, even if you couldn't see how the HTML was being produced.
71
72 This radical openness of the client and network protocol, and the culture it produced, was a big part of the success
73 of the early web.
74
75 ## Digital Enclosure vs. Technical Enclosure
76
77 The [Enclosure Movement](https://en.wikipedia.org/wiki/Enclosure) was a period in English history when what were
78 previously [commons](https://en.wikipedia.org/wiki/Commons) were privatized.
79
80 This was a traumatic event in English history, as evidenced by this poem by an 18th century anon:
81
82 > The law locks up the man or woman
83 >
84 > Who steals the goose from off the common,
85 >
86 > But lets the greater felon loose
87 >
88 > Who steals the common from the goose.
89 >
90 > --18th century anon
91
92 In the last decade, the web has gone through a period of "Digital Enclosure",
93 where ["Walled Gardens"](https://en.wikipedia.org/wiki/Closed_platform),
94 such as Facebook & Twitter, have replaced the earlier, more open and more chaotic blogs and internet forums.
95
96 ### Technical Enclosure
97
98 Many (most?) web developers have decried this trend.
99
100 However, despite recognizing the danger of an increasingly closed internet, many web developers don't consider their own
101 technical decisions and how those decisions can also contribute to the disappearance of web's _culture_ of openness.
102
103 Inadvertently (for the most part) technical trends and decisions in web development in the last two decades have lead
104 to what we term a "Technical Enclosure" of the web, a processes whereby technical decisions chip away at the #ViewSource
105 affordance that Cory Doctorow discusses in the opening quote of this article, an affordance that existed as a commons
106 for early web developers.
107
108 To see a stark example of the decline of the [#ViewSource](https://en.wikipedia.org/wiki/View-source_URI_scheme)
109 affordance
110 in web development and Technical Enclosure in action, we can look at what is perhaps the most popular web page on the
111 internet, [The Google Homepage](https://google.com).
112
113 Here is the nearly complete source of that page from the year 2000, taken from
114 [the wayback machine](http://web.archive.org/web/20000229040250/http://www.google.com/):
115
116 ### Google in 2000
117
118 <img src="/img/google-2000.png" alt="Google Source Code in 2000" style="border-radius: 12px; margin: 12px">
119
120 In contrast, here is a random snapshot of roughly 1/100th of the current source code for the website:
121
122 ### Google in 2023
123
124 <img src="/img/google-2023.png" alt="Google Source Code in 2023" style="border-radius: 12px; margin: 12px">
125
126 These two screenshots dramatically demonstrate the decline in the effectiveness of
127 the [#ViewSource](https://en.wikipedia.org/wiki/View-source_URI_scheme) affordance over time:
128 yes, you can still right-click the page and view its underlying source, but making sense of the latter code would be
129 challenging for even the most seasoned web developer.
130
131 A new web developer would have almost no chance of deriving any value from doing so.
132
133 Now, this is not to criticize the Google engineer's technical decisions that lead to this situation _as technical
134 decisions_: obviously, despite similar appearances, the Google homepage of 2023 is far more sophisticated than the one
135 available in 2000.
136
137 The 2023 google homepage is going to be a lot more complicated than the 2000 page and, given the zeitgeist, it is going
138 to
139 involve a lot of JavaScript.
140
141 However, this is to point out that something deeply important about the early web has been lost, almost certainly
142 unintentionally, along the way: the ability to view the source of the page, make sense of what it is doing and, most
143 importantly, to learn from it.
144
145 ## Right-Click-View-Source Extremism
146
147 Both [htmx](/) and [hyperscript](https://hyperscript.org) adhere to
148 the [Locality of Behavior](/essays/locality-of-behaviour)
149 design principle.
150
151 This principle states that:
152
153 > The behaviour of a unit of code should be as obvious as possible by looking only at that unit of code
154
155 The main technical advantage of Locality of Behavior is ease of maintenance, as outlined in the essay above.
156
157 However, there is an important cultural benefit to the Locality of Behavior of htmx and hyperscript as well: **it
158 restores
159 the power of the [#ViewSource](https://en.wikipedia.org/wiki/View-source_URI_scheme) affordance on the web**.
160
161 Consider [Hyperwordle](https://arhamjain.com/hyperwordle/), a hyperscript-based clone of the popular
162 [Wordle](https://www.nytimes.com/games/wordle/index.html) game, now owned by the New York Times.
163
164 You can visit Hyperwordle, right click and view the source of it, and you will be presented with some HTML and
165 hyperscript,
166 all of which is, with a bit of effort, understandable.
167
168 The [#ViewSource](https://en.wikipedia.org/wiki/View-source_URI_scheme) affordance is effective in this case.
169
170 Contrast this with the view-source experience of the Wordle implementation at the New York Times.
171
172 Now, this is of course a bit unfair: the NYTimes version has a lot more functionality and is heavily optimized.
173 Hyperwordle
174 is a proof of concept and not being hammered by millions of users every day.
175
176 Despite that qualification, Hyperwordle demonstrates a potential future for the web, a future where a culture of
177 openness,
178 of [#ViewSource](https://en.wikipedia.org/wiki/View-source_URI_scheme) politeness, is once again a touchstone of the
179 culture of the web.
180
181 ## Prioritizing [#ViewSource](https://en.wikipedia.org/wiki/View-source_URI_scheme)
182
183 Engineers who care about the open culture of the web should recognize that the threats to that culture come not only
184 from
185 Digital Enclosure by large, private companies of the most important pieces of the web.
186
187 They should also recognize the risks of Technical Enclosure, and the _non-technical_ value of the
188 [#ViewSource](https://en.wikipedia.org/wiki/View-source_URI_scheme) affordance in perpetuating the open culture of
189 web development. They should start thinking about making this affordance a priority in their technical decisions. As
190 with all priorities, this may involve trading off against other technical and even functional priorities during
191 application development.
192
193 But if we don't stand up for [#ViewSource](https://en.wikipedia.org/wiki/View-source_URI_scheme), no one else will.
194
195 <br/>
196
197 <img src="/img/memes/viewsource.png" alt="Right Click View Source Guy" style="border-radius: 12px; margin: 12px">