2019-05-01+net

(Brent) #1

VOICES
Opinion


PR

OF

IL
E

Jason Cartwright on why developers need to make it


easy for others to inspect their work


Like many people my age (late 30s) I
learnt to build websites by viewing
the source of sites I thought looked good.
This way, I discovered you could use tables
to have a page laid out how you fancied and
framesets to persist elements of the page
on screen while other parts scrolled. I
found this form of learning by discovery
stuck in my head better than being taught
by someone.
Thankfully these old HTML techniques
are long gone and the complexity and
quality of the websites (or web applications)
we build has increased drastically. What
does remain, though, is the ability to view
the source of the page you’re viewing.
We’ve seen a burgeoning amount of build
tooling, a proliferation of new server-side
languages (such as Rust and Go) and the
encroachment of JavaScript from client to

server, enabling isomorphic apps. This is
all very exciting and I think we can all
agree that the more choice of ways to build
interwebs there is, the better.

HAVE WE FORGOTTEN
WHAT IT IS THAT MADE THE
WEB GREAT?
These newer capabilities and higher user
expectations, augmented by supercharged
evergreen browsers, can make you
responsible for lower-level tasks. A good
example is managing the browser’s state.
Previously this was all done for you. You
clicked a link, you ended up on another
page, you clicked the back button and
you went back to that previous page. Now
with pushState – or whatever your chosen
framework abstracts it to – you can make
a mess and have your site clunkily and

unintuitively work like a 2000s DVD menu.
And people frequently make this mistake.
I’m not arguing for a return to a world
without these massively well-built modern
frameworks. They, along with build tooling
that has improved developer workflows,
enable slick and useful web apps to be
built faster. There is no need to smash the
frames in the mills.
My argument is that while looking after
your ‘normal’ users, it’s also useful to make
the tech that’s publicly viewable (HTML,
CSS, some JavaScript) as comprehensible
as possible to developers – who are just
another class of person using your stuff.

GENERATED CLASS NAMES
GONE WRONG
At its worst – and when misused – new
technologies also remove the web builder
from having to think about other factors
that affect the user. It’s incredibly easy to
add yet another fancy JavaScript library
into the dependencies but harder to see the
effect on a user who isn’t on your superfast
office fibre.

INCOMING CLICHE: WITH
GREAT POWER COMES
GREAT RESPONSIBILITY
The web is a unique open platform built
on agreed standards. Content on the web
is accessible, addressable and predictable,
which are arguably a few of the reasons
why it’s so successful.
Despite being accessible worldwide, our
immature industry has problems attracting
a diverse range of people to work in it.
Needlessly obfuscating the output of our
work raises the barrier of entry for newbies
and ignores the beauty of the web.
It’s also about fun. Treating the web
as ‘just another compile target’ makes
it harder for developers to create user
stylesheets, browser extensions or data
scraping tools that extend what you’ve
built. They may be doing this in ways and
with tooling you couldn’t possibly have
anticipated – a brilliant way of finding new
business, hiring people or just for fun.

Cartwright is the founder of Potato, a digital product
development company. He’s previously worked for
the BBC, Google and various startups.

MAKE VIEW SOURCE


GREAT AGAIN


OPEN WEB
Free download pdf