net - UK (2020-01)

(Antfer) #1

VOICES
Interview


If he tried it today, Chris Ferdinandi
isn't sure he would be able to make
the jump into web development. He
taught himself to code and transitioned
from a career in HR when responsive
design, HTML5 and CSS3 were the hot new
things. As everyone wanted developers
with JavaScript experience, Ferdinandi
also started learning jQuery and plain
JavaScript in order to land himself a job.
These days, however, he’d be completely
overwhelmed. He believes that the web
has become a bloated, over-engineered
mess and that many of our modern best
practices are actually making the web
worse. Now Ferdinandi has written an
ebook, The Lean Web (leanweb.dev), to
share some ideas on how to fix it and
explore a new set of principles for a
simpler and faster web.
“If I had to sum up what modern web
development has evolved into, it would
be ‘JavaScript all the things’,” he explains.
“JavaScript is at the heart of how so many
folks build for the web today. It manifests
itself in things like JavaScript frameworks
but also module bundlers, single-page
apps and CSS-in-JS. It’s complicated and
it’s exhausting.”
JavaScript-heavy tooling and processes
can have negative consequences.
Ferdinandi says they make it harder for
new developers to get into the profession

“We use tools designed


to solve problems that


we don’t actually have.


We’re inheriting


solutions to other


people’s problems,


not ours”


and they exclude people without JavaScript
expertise from the process (for example,
UX, CSS and accessibility experts). Most
importantly, however, the over-reliance
on JavaScript makes the experience worse
for the user: “JavaScript is the most
expensive and most fragile part of the
stack,” Ferdinandi points out. “We have
at our disposal the most powerful internet
browsing devices and fastest connections
that have ever existed but they’re not
evenly distributed. For a lot of people the
web is painfully slow or not usable at all
because of all the JavaScript dependencies.
You end up with this really delicate house
of cards – if any one piece falls out of
whack, the whole thing comes crashing
down around you!”
One of the causes behind this evolution
is that, as an industry, we’re obsessed

with bright and shiny new things. It makes
it exciting and we constantly chase new
tools and techniques. It’s important to
realise, however, that the problems big
companies face are not necessarily the
same problems that smaller companies
face. “Some of the tools were created to
answer or address real problems that a
certain segment of developers have but
they then get used for cases they weren’t
really intended for,” cautions Ferdinandi.
“For example, a tool like React makes
sense for an app of the size and scale of
Facebook. It improves front-end
performance and makes it easier for the
massively distributed team to collaborate.
But then a team of five at an agency starts
using it for everything and they ship 30
kilobytes of JavaScript down the wire for
a use case that React wasn’t really built
for. Most of us don’t build apps that big,
most of the things we build will never get
that big and still we use tools designed to
solve problems we don’t actually have.
We’re inheriting solutions to other
people’s problems, not ours.”
Ferdinandi also thinks that JavaScript
developers are often more valued within
an organisation and have the most
influence on how apps and sites are built,
which leads to even more JavaScript. “If
you’re a hammer, everything looks like a
nail. When the people who make the
front-end design decisions specialise in
JavaScript, they will use it to solve all the
problems because it’s the tool they know
best when really another part of the stack
may be more appropriate. Module
bundlers, for example, are designed to
help address some of the challenges
around shipping so much JavaScript in
the first place because it’s bad for
performance. So we invent tools that help
you more efficiently load JavaScript but
we’ve created a problem with JavaScript
and then we attempt to solve it by slapping
on top even more JavaScript, which feels
a little bit silly.”
A lot of the issues that these tools aim
to address could be solved more simply
and elegantly with techniques that lean
a little more heavily on core concepts,
HTML and CSS and only on JavaScript
when necessary, Ferdinandi believes. The
Free download pdf