Chris Heilmann – JavaScript is a buffet, not the enemy / Script’17


because I’m now introducing the next
speaker, Chris Heilmann. And I thought hard, really hard on how to introduce
Chris because who doesn’t know Chris, who needs who needs an introduction to Chris?
So I came up with this: Chris Heilmann, a man who needs no introduction who is fluent in “Erste Allgemeine Verunsicherung” lyrics, as we’ve seen yesterday who knows more work from
Qualtinger than I do is here tonight he is our keynote speaker he makes the
opening keynote “JavaScript is a buffet not the enemy”.
Have a big welcome to Chris hello I like that he said like here
tonight time zones right it’s weird excellent so hopefully you had a good
travel here hopefully you realize it’s getting really warm in here and it’s
really cold outside so we’re all gonna have a cold for the next four weeks as a
memory of this conference which is good and I was here to introduce this and I
thought I thought long and hard what to do about it because there’s so many good
talks today there are so many great people here to talk about the cool new
stuff that’s happening in JavaScript we’re gonna hear talks about the v8
engine and the inner workings of the v8 engine we’re gonna see Henri at the end
of it giving this wonderful crazy things you can do with JavaScript that is demo
scene stuff in the browser nowadays and we’re gonna hear about electron in
between so I didn’t want to overwhelm you with the things that JavaScript can
do there’s always these talks like 10,000 things you need to do now or
you’re gonna be homeless tomorrow and this is not what I think we should be
about so I wanted to give a bit of an introduction to what I think the
JavaScript world is lacking at the moment and what we are how we’re making
our lives much harder than it should be and I came up with this idea or that
JavaScript is a buffet and not the enemy because “JavaScript is not the enemy” is a
talk it was a talk I gave the other day where I talked about how progressive
enhancement is not as hard as we think it is and that using JavaScript doesn’t
make you a bad person just blocking out other people makes you a bad person and
my quote was actually javascript is a Buffay not a main course and it got
quite some retweets and people like what the hell are you on about and it’s
mostly because I’m never at home and I just had conferences in hotels so I got
used to eating from buffets but what I meant with it is that JavaScript has
grown so much in the last two years that it became something completely different
and it used to be it used to be this weird language that was invented in the
10 days of drug-infused frenzy by some person who had to create something
new that runs in the in the client-side and nowadays we do everything in
JavaScript so JavaScript is not only a language anymore but it’s actually not a part of the web stack it’s a development environment in its own right
people start and end in JavaScript we’re not just
writing HTML CSS and sprinkle a bit of JavaScript fairy dust on the end of it
to make it better I still do that I still like working
that way but many people use JavaScript for completely different things you are
not aware how many things you see daily that are running on JavaScript it’s
quite impressive what you can do with it. and we want and we do everything in
JavaScript and that’s always a bit of a weird thing that people jump to
JavaScript is the first thing as I get the same issue when people have like CSS
only solutions. To me it’s always a good solution uses each part of the
technology that does the things right, not just one of them. But we love doing
everything in JavaScript. And it’s quite funny when you see talks or you see
like introductions, you’re like it’s just JavaScript it’s easy to understand. And
most of the time it’s just JavaScript means like here’s an API that you’ve
never seen in your whole world there’s not documented that somebody put
together in 12 NPM packages. Good luck! You know, knowing the language is not
enough most of the time. You have to know the environment that you’re running it
in you have to know the problems with it as well. And it does cause a lot of
confusion what people that we do everything with JavaScript and people
coming from higher languages are like why would you do this is a toy language.
People coming from CSS like so hard to do. This was in Portugal the other day,
and I was just standing there like how is a pizza with eggs on it a London
thing. Together with a drink that you only get in Portugal. So this is the kind
of feeling that I get when people tell me like it’s just JavaScript and I
thought I knew it! I wrote five books on the thing but most of the time I’m just
looking at stuff “no idea what you meant”! I’m worried about the state of our web
and our community. The web first of all I gave a gr– I gave a — almost said —
great talk because I’m really excited that I gave it at the Internet days in
Sweden where I pretended to be a psychologist that interviewed a
depressed internet. And because it feels fat and it feels not useful, which is
what we made the web to be. If the average web site is 2.2 megabyte and 1.2
megabyte of that is JavaScript I just wonder what we’re doing with the web.
It’s not necessary that we fill it with things all the time. But I’m more worried
about the state of our community because we work in the open and with very
flexible technology If javascript is anything then it’s
flexible. Some say undefined some say confusing, some day undefined is
not defined. Like error messages from Internet Explorer 6 back then. But we’re
not as open and flexible as our technologies are. We know that javascript
is not the end-all and we know it is not a perfect solution. But we keep telling
people to use it for everything or they’re not ready for it yet. I see a lot
of drama and dogma and less flexibility and understanding. You know there’s
clashes of the people like “oh my god you use JavaScript for something that HTML
can do in itself, you’re a bastard”. And people like “oh you’re using HTML and
doesn’t work in Internet Explorer 5 on his old computer, you’re a bastard! And
I’m like: This drama and Dogma is just annoying me because we should be
flexible and inviting. Because if anything that I learned about JavaScript
and I’m doing a lot of that lately is that it’s easy to get people started
with it. It doesn’t need an IDE, it doesn’t need a development
environment. It needs a bloody text editor and a browser and you can even
use developer tools nowadays to write JavaScript inside the browser itself.
We’ve contained our development environment to the things that be
consuming the internet with and this is great because when consumption and
creation gets as close together as possible then anybody can become a
creator and if anything we need more creators on the internet right now, and
not just people writing things on Twitter that are awful. We need more
people to build things, use the internet and build great things with it. And worst
of all there’s a lot of arrogance and intimidation. Arrogance in terms of like
“oh that never worked, it will never work now”.
it debt that we made that mistake before why are you doing this again. And
intimidation: is not like that we are that we’re intimidating people by
shouting at them, although that happens as well, but it’s more that like “you’re
not a professional developer if you don’t use this”. If I can… if I became a
new developer right now and I would come on the web and we look around and like
never tell me use these 10 things are not professional I’m like okay I’m not
gonna be professional then I’m gonna do something else. Goat farming or something
like that is much more fun! And this kind of
intimidation is killing us, because what we really need to have is more diversity
in our market. Cause people from different
and backgrounds, people with different skill sets building things together,
means we build products for end-users cause weirdly enough our end-users are
diverse and different as well! We are not our end-users at all. So today I want us,…
I want us to stop and think about how we can use JavaScript and share the
excitement of it. We can share the happiness and the flexibility of it
rather, than just saying like you’re not professional if you don’t use the 10.000
modules, and why do you do this on the server. Now a bit of a caveat:
I’m not forbidding anyone to do whatever they want to. This is a very very broken
thing that happened to me a few times now at conferences where I said
something. I made a statement, you know, I allowed myself to say something.
And then like “are you telling me I’m not allowed to do this and that?” No, I’m like
no! I’ve got… I don’t have that power. You can do whatever the hell you want. As
long as it doesn’t interfere with other people. As long as it doesn’t block other
people out. You’re your master of your own little world. If you want to mix the
cake and the fish, go ahead! It’s fine! It’s not my tummy. It’s not my problem.
But I’m not forbidding you to do things What I want to talk about is what we
could do and what we could think about a bit more, to become a better community
and to build better things together! And not be someone and a community people
are afraid of. And something that people are like “JavaScript is hard to do”. I see
courses right now that sign “JavaScript for designers” and this angers me! Like
this really really angers me! Because it’s belittling designers! It’s like that
it’s not a skillset that nobody that needs to be a mathematician to actually
use JavaScript. You build interfaces that are interactive we need designers to
help us with that because we crap at these things. Most of us. Sometimes we
have people who are totally talented which are just bastards. (laughter). I want to see us
becoming more diverse and more interesting and more engaging for people.
I love this Buffet at the British Airways lounge: it’s the only white toast.
Different shades of grey but that’s about it, you know. (laughter) But this is not what we should be like, we should be more of a thing
that is a lot more interesting. So let’s go back to the buffet metaphor because I’m
hammering this home like dead horse cake. You know. Buffets are great. You will
probably see something like that. They’re great.
First of all they feed a lot of people in a short amount of time. You don’t have
to wait for everybody to get their meal before. And then you know that awkward
moment when you all sit on the table and one person doesn’t have their meal yet and
everybody else lets their meal getting colder and colder. And we’re not your
friend can’t start yet. The buffet is “yeah! get yourself together. Start eating!” They
allow people to make their own decisions. So you don’t have the problem of like “oh
but I’m vegetarian, and it’s full moon, and my first name starts with a K. I
can’t eat that now! So we can, I mean none of us can have that!” Make your own
decision choose whatever you want. They create less waste, cause people only take
what they need. Or so we think if greed doesn’t come into it. It’s not
like a whole meal, where people leave half of it on the plate and then throw
it away. And best of all they’re asynchronous. And we all love
synchronous things. Because you can cook while people are eating. Then you don’t
have to wait for everybody to get their meal before you start eating. So that’s a
pretty good thing. Of course buffet’s have issues as well. First of all there are
most of the time lesser quality food. Because you make a lot of food for a lot
of people and you don’t have time to actually get the last last little bit of
like flavoring into the … What am I talking about live in England. We don’t
use flavoring. But anyways the quality is not as… normally not as good as with a
full meal. They might contain things that make people sick. So there might be
things in there that people can’t eat. And you if you have a peanut allergy
allergy or you’re lactose intolerant you always have to hope these little signs
say the right things when there is a mix already there. You hope that everything
is fresh and gets renewed when not used and not put out the next day again. And
just sprayed painted or something like that. You never know how the quality of
the thing is and everybody has their hands in them. And you hope that they use
the right tools to take their part. You know it’s like people are “oh yeah well I
don’t use the tongs provided I’ll just use my hands after
sneezing in my hands” or whatever. And it happens sadly enough, and this is pretty
much where we are with JavaScript right now. Everybody has their hands in it.
Everybody wants to do something with it. We don’t know the quality of something.
Just use this package, don’t try to understand it, it’s fine! It solves your
problem. And then if you don’t know what it’s in there, if you don’t know the
upgrade cycle of it, you might have a security hole in the
middle of your app without knowing it. User testing, unit testing is
against that but we’re using a lot of stuff that other people have been
doing to be faster, and we wonder if that’s the right thing now. I realized
that when it comes to buffets and to JavaScript, the same etiquette, the same
way of dealing with other people applies. Or that’s what I thought myself, cause I
subscribe to this metaphor and now I’m going to run it to the ground, so… The
first thing: don’t cherry-pick and leave nothing for others. That’s always the
worst people when you go to breakfast and they just basically get all the
salmon, and put it on their plate. Then everybody else needs to get the dry
bread and like cranberry juice or whatever. And don’t just pick one thing.
Of course you have the right to do it, but it’s just a terrible move to other
people. Take as much as you need and take the thing that is good for you, but leave
something for others as well. What I mean by that in JavaScript is development
environments. Your environment is very much you, and probably nobody else. And
this is great! This is “get as effective as you can!”. Find the editor of your
choice, find the browser of your choice, find the debugging protocol of your
choice, and stick with it. And become a god when it comes to development, but
don’t expect that everybody else has to change their environments to work with
you. That confuses me when people like “oh you should use Chrome because otherwise
you’re not a JavaScript developer” What? You know I know people who have never
touched the browser. Who are a great JavaScript developer. “You
should use this kind of editor or otherwise you’re wasting a lot
of time!” I use, like a lot of people, Visual Studio right now. I don’t have time to
look at the old editor and understand the IDE before I start coding. I’m too
impatient for that. I just want to start coding. That’s why Visual Studio
Code is fun because you get the intellisense
inside a normal editor. It’s great that you own your environment and you
customize it to your needs. Be as effective as you want to, but think about
that people are not you. So if what you release becomes a dependency on the
things that you build it, then we have a problem. Because you don’t want people
to reset their editors just to be able to consume your code
in their products. Share what makes you happy and makes you more effective. So if
you’re happy with that, cool! Write that blog post but don’t say “you’re not
professional if you don’t do the same thing” Just say “here’s what helped me” And
these are the coolest, nicest posts out there. This is the stuff that I retweet. That
other people retweet because you’re not bashing people on the head with your
effectiveness, you just tell them like this is what worked for me, in my
environment, with my clients, with my environment I work in. Help improve the
tools you use and your love! All our editors are hackable nowadays. They’re
written in CoffeeScript, or in TypeScript or even in JavaScript itself! Developer
tools are written in JavaScript. They’re not in c-sharp or C++ any longer. We have
the tools and we have the chance to make those tools better. So using open-source
doesn’t mean that you use free code, it means that you become part of a
community. And part of that is to give back once you found something broken. And
not go to Twitter and say like “it’s broken”
Great, you can fix that! Put that extra time in, because the time that you won by
using somebody else’s code you should give some of that back. Much like you
don’t just use the fancy bits in a buffet and leave the other ones hanging.
Don’t pick the things you like and demand people to accommodate to your
needs. This is how I code my code, this is the only way of doing it. Let’s talk
about tabs and spaces and curly braces on a new line or not. For the
500th time. You’re like, really? This is the most boring things ever. If
something can be converted from one code style to another by a script, let a
script do that. Let’s not people confuse these things that is really important.
Important is that our end users get something that’s beautiful, fast and lets
them do things. We are here to deliver interfaces to people. That could be data
interfaces, that could be graphic interfaces. Our job is to make people
love the internet and love using software. Not how effective we are or
what come what comma style or semicolon style we have. Make sure you explain in
detail what you rely on and why. So if somebody… if you have an open-source
project you say like “okay I’m using this editor, that’s why these
ten thousand source files and these kind of things are in there. If you don’t use them
please don’t touch them, but I use them because it makes me this
effective, because of this and that.” Explain the things that are in your
repository. Don’t just expect people to know what these things are. We’re
creating a service and the more you think about others, the more success you
will have, the easier it is to work with you in the open. In an open source
project the more people will start working with you, the more dogmatic you
become and say like “I’m not gonna take your code, cause the semicolon is in the
wrong direction or whatever” This is not a way to expect people to
work with you. They already give you their free time, they already give you
their knowledge so be nice to them and be ready to be flexible. Flexibility is
what made the internet what it is right now, so there’s no one way of doing
something. There never was one way to do something. Don’t try to reuse dirty plates.
This is actually a law in California. I learned that the hard way that if you go
back to the buffet with a plate that’s already used they’re gonna shoot you or
something. Well not really … well not yet. They’re basically just very
angry with you and that’s the same thing to me with development.
And especially web development right now. What do I mean with that. Some things
should not be used on the web any longer and the argument that you cannot use a
ES2015 or ES2016 API because you have to support Internet Explorer 6 is a very
stupid argument. Cause in essence what you’re doing is you’re allowing the web
to become stale, vulnerable and insecure. These browsers are not there because
people want to use them. These browsers are there because people are forced to
use them. Are locked down into systems that were only written to work in those
browsers. And I work for the company where a lot of our sites only work in
Internet Explorer cause they were built with Sitepoint in 2005. And there’s no
way to actually spend money and time to rewrite these things. That should not
hold us back from innovating. That should not hold us back from making better
things for the people that have systems that haven’t been
stagnating for the last 20 years. And I’m including Android browsers in that in
the older Android machines when Android was so completely coupled with the
browser and there was no way to update the
things these are security problems these are not browsers these are very terrible
things and don’t confuse that people think and we have to work with Internet
Explorer 6 are expecting beautiful interfaces you confuse them if you give
them something pretty give them the normal forms and the drop-down menus
that they’ve been hate that they’ve been learned to hate and forget for the last
15 years I call this the Stockholm Syndrome of interfaces when you build
something when you have to use something so horrible every single day you start
defending it because you cannot be stupid enough to use something horrible
every day right we have to somehow make it for ourselves better it’s not ok to
block these things it’s ok but it’s a waste of time to support them a hundred
percent a polyfill that gives CSS animations to Internet Explorer 6 is a
waste of time saying you need Chrome to use this website is also a waste of time
because it’s arrogant and it’s stupid because some people I love it when
you’re an engineer honest on a certain browser and then you go on holiday and
you go to the hotel lobby where there’s no wireless and no connectivity and you
get these old Mac I use with Internet Explorer 5.0 2 on them and you’re like
this is your Internet now where is your God now kind of thing like I can always
you can never control the environment so make sure that you don’t block anybody
else just don’t give them interfaces that they choke on give them something
that is as simple as possible and does the main job the other stuff to make it
easy to make it beautiful to put the extra stuff on top of it fine Twitter
used to be an interface where I can text to and send a tweet this is great this
is good enough sorry twitter-like
doesn’t like it fair enough now I feel not confident to keep not in any ways we
can’t move forward carrying the weight of failed api’s and broken
implementations it’s it hurt me so much when I went from Firefox to into
Microsoft and we started building edge and I’m like cool with getting rid of
all these broken things in Internet Explorer and we built a new browser from
scratch standard compliant and then we put it on
the web and nothing worked because people relied on WebKit prefixes people
relied on M s prefixes only a few people relied on API api’s implemented in not
the standard way in other browsers so to make our browser not suck and people
complaining about the browser we had to put a lot of interoperability into them
and every browser maker has to do that Mozilla just hired Ola for that and a
few other people interoperability is 30% of our job as browser makers not
breaking the web because something else that is broken people are relying on so
make sure you don’t rely on broken things but I’ve said that for eight
years that doesn’t matter in any ways this also includes to me polyfills that
aren’t included on demand a polyfill was is a great solution to use technology
that’s coming next right now but if your polyfill becomes stagnant and gets
included every single time even when all browsers have have caught up and don’t
need it anymore that is dead code that is being loaded on the Internet and that
code and unlock code is a terrible thing think about the code code needs love
unloved code on the internet don’t do that the web needs to be evergreen
there’s no way we can to see kind of a secure web and have a web that can
compete with closed environments and native environments if it’s not
evergreen and if browser bugs cannot be fixed as fast as possible so please as
developers do not fight against this try to get people to upgrade try to embrace
what’s coming next and do an if statement around your
things and give a functionality to browsers that don’t understand the new
stuff but give them something that works don’t put meat in the veggie section
that’s another fun thing to do in a buffet when you basically just take this
to take the spoon that yet that has to meet and put it on the cheese and then
people like oh my god this is terrible but people can’t some people don’t want
to eat meat some people can’t eat meat so don’t mix those things and this is
where I’m talking about JavaScript being applied in environments where they’re
just not applicable where they’re just not necessary and they’re not possible
there are quite a few browsers and environments where JavaScript is
restricted it’s restricted and it’s actually not available in some cases I
mean not available the case of like no JavaScript at all is a very odd case
because that’s mostly very angry people that just turn off the JavaScript and
want to show you that it’s broken the case of JavaScript maybe being there but
you have no idea about what’s going on is the internet so there’s no way you
can always select every one of my users has bruh has in JavaScript enabled and
we all have seen that at flaky connections when out of a sudden
Facebook tells me the descriptives out stating out the timing out because it
takes too long to connect on something and I’m like ok
reload nothing broken nothing terrible reload all my content is still there
everything is still saved but there are environments where your JavaScript will
be mangled with will be changed with and as like there’s Opera Mini there’s the
silk browser from Amazon there’s tea it’s a squirrel browser which is
something and there’s the puffin browser and these are all mobile browsers in
environments where connectivity is very expensive and very scarce so instead of
just sending the data from an American server to India they cache it to in an
Indian server before that and only give you HTML string back they take you CSS
they take a JavaScript Dave some down sample your images and then give the
user something they can actually consume which might look terrible but it’s
consumable it’s not a spinner that doesn’t do anything so think about these
environments that there are there and it’s fun to actually use Opera Mini on
your own mobile phone from time to time to try things out and javascript is also
used to spy on users and that that doesn’t mean though that we have to
demonize it that’s it that basically is like turn off all JavaScript because
it’s terrible we have to fight this the bad guys using
JavaScript giving JavaScript a bad name we have to fight this and be better at
that and adblock plus and brave and others are filtering out ads from the
Internet that’s admirable that’s nice but that is a first-world solution we
are in the great position that we can filter those things out but we shouldn’t
be surprised if if advertising becomes more aggressive and if advertising
becomes more annoying the more we block it somehow somewhere people have to pay
for stuff and this is sadly enough advertising is the most broken thing on
the internet right now deeply the advertising model of the Internet
doesn’t work we have to get a better way of payments on the Internet
we have to get better at showing things to people that are relevant to them and
even artificial intelligence doesn’t work us right now
I just bought a suitcase on Amazon what do I get 15 ads about do you want to buy
another suitcase no I don’t need that many suitcases weirdly enough you know
like I’m happy until this one breaks too to use that one it’s not something that
you buy a lot you’d save with cars there’s like no so JavaScript being
being a security problem is something we have to tackle and something we have to
tackle very vigilantly in our own code in our own code quality as well
different use cases of JavaScript have totally different needs a node solution
and a dong scripting solution that should be backwards compatible to older
browsers do not follow the same rules so it’s it makes no sense if those two
worlds argue with each other who’s the better more professional coder these are
different use cases these are different rules some rules apply to all of them
don’t call things that are unreadable but the way you actually shave off 50
milliseconds by reversing a loop doesn’t really make any sense to anybody working
on the server it’s much more important not to hammer ddt’d your ram consumption
and not to hammer the tick on a server like that each one of those have best
practices and sensible approaches let’s talk about sensible approaches more like
lurid and calling something best practice a best practice to me is found
in production it’s very much dependent on the group that is using it and the
environment it’s executed in that could be anything that could be terrible
somewhere else but it’s the best practice
that product a best practice is a very very rare thing so let’s not say this is
the best practice you should start with that but otherwise you’re not
professional they don’t need to mix sometimes antithetical something that it
makes totally sense in an old environment is totally terrible on the
web and something really really good on the web is totally useless too or a
waste of time for you in an old environment or a tesla environment or
whatever else you do you can script illustrator with JavaScript it’s pretty
fun actually it’s okay we can evolve JavaScript on different tracks we don’t
have to have one JavaScript to rule them all this is the benefit of having a
language that is it that is basically don’t hasn’t have to be compiled but
compiles on the fly and actually is a very very strange language I love it for
that don’t pile up your plate don’t be the guy that goes to a buffet and puts
like every all the food on it and then goes back and like wastes half of it
throwing in the room or something like that and that leaves half of it you can
go back get a new plate eat more it’s totally fine it can be daunting to look
at the JavaScript world right now when you look at like there was this massive
medium article it’s like oh it’s really hard to be a JavaScript developer right
now and then it was very sarcastic about how many web pack settings you need and
what many servers you have to set up and the command line and blah and it’s it
was quite fun but it was also very kind of brutal for people who really want to
get into the JavaScript world we hammer people with best practices and we tools
to make ourselves more effective rather than like allowing people to find these
things themselves dee dee dee fetish of being effective and writing less code is
something that is very weird to me because sooner or later we have to
understand that computers are getting better as well
artificial intelligence is all right he already writing artificial intelligence
code highly optimized code will be written by machines for us and that’s
good not in 10,000 workflow systems that you have to set up before you do the
other day I was a 10-minute cause of setting up 12 environments on your
computer and you’re like and what’s that afterwards like these three things I
didn’t understand it you can learn in 10 minutes I felt really stupid and I felt
really like maybe I should do something else instead of this job
don’t try to be everything find something you are excited about and
do that at first become an expert in dumb scripting in UX in performance in
in server-side in messaging in databases find something some part of the stack
that you’re excited about and become the expert in that even in JavaScript world
understand one part of JavaScript well and concentrate on that cuz this is your
bread and butter this is gonna be your job this is gonna be how you make money
and how you become successful in a company knowing the rest is important
but you cannot stretch yourself thin by learning everything it doesn’t work that
way don’t use the every cool new thing because it’s cool and new I get I get
stressed you know like I go through my 3000 subscriptions in RSS and I’m like
oh cool new thing damn I have to write a talk I have to go to a client I have to
do something I don’t have time to do it and then three days later who you think
dangerous to use and I’m like well good I didn’t spend time on that you know
it’s the amount of time we have like don’t use the cool new thing that we
could just get excited about the day before is coming faster and faster and
the time is getting shorter and shorter as well so just don’t use it because
they’re cool and you use them in a downtime moment or when you when you
really want to learn something new but understand that sooner or later you have
to deliver code for a living or you have to consider products for a living so you
cannot just change your environment all the time
I had job interviews where people told me flat out like 20 year old guys coming
in yes guys coming in like oh I only work with that editor in that
environment otherwise we cannot meet me might as well stop the interview like my
mom my sister works in the unemployment office and I see people struggling to
find a job and we’re making a drop interview dependent on which bridge
editor we’re gonna use how arrogant have we become this is just ridiculous at
times get to know the basics and go from there understand the basics of
JavaScript understand the basics of how the language is being it’s being parsed
how the language is being turned into code how the language is actually
helping you to get better understand the Dom don’t just say the DOM is slow
understand why sometimes a virtual DOM is a better thing than using the Dom
understand the power of the DOM understand how the the interplay of CSS
and JavaScript can be very very successful for you understand that hTML
is not a toy language and that somebody writing hTML is not a designer
understand that this is structuring much like you’re structuring code as well if
you publish something think about collaborating from the very beginning
cause you will get bored of it you will not make me the maintainer of
your cool code for the next 15 years unless you get really really striped
gold and make lots of money with it as well
think about collaboration from the very beginning documentation tests demos
written by others allow you to question your own biases it allows you to
question your own code and understand that it for others it might be hard to
use if you rewrite it a bit differently it might be easier for use for them and
that means less work for you as well that means you you get a an editorial
review of your own code by allowing other people to write documentation and
death test demos and extensions for your code a lot of stuff that went into
visual studio code we learned when we open up extensions but people need these
kind of interfaces to talk to the editor itself that we hadn’t thought of before
find a stack that allows you to deliver your work and don’t rely on things you
don’t know yet find a stack that works you know the other day I wrote PHP
because I freaking know it you know it was just a list of links to download
something I did this in 20 seconds without thinking about because I used
PHP professionally in Yahoo for years I didn’t want to set up another note
server and another thing another backpack and blah and I’m like it was
just a list of things I know it’s not gonna change so I’m now I’m using PHP
fine there’s nothing dirty about this I shouldn’t feel bad about it I did but
you shouldn’t and just because you find something that people use something and
it’s cool to have it on your CV right now you might not be able to rely on it
talk to people who relied on Silverlight flash or angular 1 to angular 2 is not
fun either but it’s necessary so think about these kind of things think about
that you what you don’t know yet and you’re using you don’t call yourself an
expert just by using it by going through a course or just finding it but this is
what people do and call out on in job descriptions if people ask for
like five-year experience and a half-year-old program or tool send them
an email and say like I did not apply for this job because you made a massive
mistake there we have to stop hyping up our job descriptions as well it’s just
nuts what people put in there don’t touch things you don’t like and you
don’t want don’t go to the Buffay and like mmm yeah you know if you don’t like
them and you don’t want them don’t play with them don’t touch them don’t spoil
them for others and that is something that I keep seeing us arguing in our
community over and over again about and I don’t see the point of that it is okay
not to understand something or not like it if you don’t understand how CSS works
and you don’t like – syntax of CSS as a JavaScript developer it always confuses
me that exclamation mark important meets important rather than not important as
it should fine that’s totally okay it’s totally
fine to not like something and not understand it it’s not okay to discard
it and call people unprofessional but for using it that makes no sense these
are experts these are humans these are people that are actually behind each
line of code as a human a human with feelings a human with problems a human
with experiences a human who put effort in there putting themselves out in the
world to say like I want to do something with that you don’t have any right to
call them unprofessional you don’t have any right to call them bad you have a
right to point out that some things might be ineffective and you if you form
it as a question you start a conversation if you tell them this is
broken you should use that you shouldn’t be surprised that they don’t answer or
just get angry at you JavaScript can be a great helper tool but it doesn’t need
to replace everything not not everything has to be done in JavaScript why do we
do everything in JavaScript why do we create content in JavaScript why do
curate styles in JavaScript because we want full control because we’ve been let
down by old browsers and we’ve been let down by even new browsers implementing
things wrongly and we get the opportunity in JavaScript to apply
something test if it applied properly and then fix it if it didn’t in CSS we
don’t have that and see us as we apply something we hope the browser does to it
right we have no feedback channel we don’t
know what happened we have to benefit though that browsers
can fix stuff for us in CSS in animations and these kind of things so
in we use JavaScript to get full control over something and not and be able to
fix it and you know what the web is so diverse and so weird full control never
happens not even in not the web cases try to be
an Android developer and try to predict what phone it will run on this is not
the world anymore that we are we cannot control the interface it is not helpful
trying to forcefully convert people as well like you should learn JavaScript
because you’re obviously an expert in CSS but that’s all shit so learn
JavaScript don’t need that don’t we need CSS experts we need people who don’t
understand JavaScript to ask us questions that we haven’t thought of
there’s nothing better than getting stupid questions because there are no
stupid questions there’s just questions that have a lack of understanding much
like there’s no unknowns there’s no magic it’s just things we haven’t
analyzed enough yet can’t be going that we go in towards use
the cutlery provided that’s a very important thing as well as I said before
the tongs to get the food out flexibility and control comes at a price
we want to control everything we have to want to have full control of the
interface that’s why we use JavaScript for everything this also means that the
more functionality you make dependent on scripting the more responsibility you
have it is up to you to make this thing 60 frames per second it is up to you to
make sure that it doesn’t flicker it’s up to you to make sure that whatever the
end user does to your interface doesn’t break the limited interface that you
create it a lot of good development means giving up that control and hope
and allowing the browser the environment and things to fix things for us this
feels weird as a developer because you don’t want to rely on the unknown but
you have to at times and when you control everything with JavaScript okay
here’s lots of code that you have to send to your end user and you hope that
it’s gonna get executed you hope it gets understood because you have no control
over the environment if you use the web platform to solve an issue use it reduce
HTML use CSS use JavaScript use HTTP you server-side caching use
understanding attacks use understanding how performance on the server can help
your code as well rather than you controlling everything the web is a lot
of different moving parts and all of them have interesting bits and bobs in
it but as soon as you use the web platform itself instead of just doing
everything with the big one include of JavaScript you realize that you have
much more support for environments you haven’t even thought of out of a sudden
you have users in like old browsers that say like hey I can use it you have blind
users you have people who can’t use their hands you have people that
uncannily will use one hand and it’s not unarmed people it might be a new a new
parent with their baby on their arm trying to do something on their phone
people change people have different use cases so the web the w3c standards and
the web interfaces that we have have been so slow comparatively in innovating
because they have to think about all these things they have to think about
all the implementations and not just the one that we are it also allows browsers
creators to optimize for you a lot of stuff that we do in JavaScript and I
hope Francisco is going to talk about that in the engine we do a lot of
optimization in the JavaScript engine for you if you don’t code against us if
you have an unnamed function we can cache that thing and we can call the
bytecode again without having to re-evaluate it if you create new for new
new unnamed methods and functions in a loop all the time we don’t have a chance
to do that for you we make sure a CSS animation will run in a good frame rate
we make sure that we gave you something like requestanimationframe so you have
full control over and over the animation frames rather than having a timeout that
works against the animation of the browser we give you all these good api’s
and we optimize them so if you get to if you get to choose CSS to do something
for you let it do its thing because the browser’s optimize that for you and I’m
really looking forward to the next version of Firefox having rust at a rust
based engine in CSS this is gonna be very very good as competitive for the
other browsers again because it’s got to be a huge impact in terms of how CSS
renders in in Firefox the fewer code you shift to the
user the better the end-user has something you don’t know it might be a
cool iPhone seven it might be an Android they got for Christmas six years ago and
don’t want to do something new with it might be a machine that is busy in
another tap with a game or like Netflix or whatever or playing things you have
no control over these things there’s a great talk by Alex Russell about the
perceived performance of mobile devices that we have right now that like oh it’s
got six cores and twelve video chips and it’s great and it’s it heals children
and whatever but as soon as it as soon as a mobile phone is hot all of this
Azhar is out the window all of these processes are slow as hell
and basically the memory consumption is is going sky-high so unless you have
your phone in a freezer you really have a very very short amount of time like 50
milliseconds or five milliseconds even to execute your code before it gets
slower so the amount of numbers that we throw at people how fast computers are a
kind of a big lie it’s a really really good talk it was at the at the Sam
summit lots of them right now I can find it later it was really really good
consider making several trips to a buffet don’t go pile up the cake with
the fish and Viktor the potatoes on the same plate
think about doing several trips and eating only what you need in between and
the same thing applies to code again we have an unfortunate drive to deliver all
the functionality on first interaction in our products this is what we learned
from like the terrible thing that is apps and IOT app does everything as soon
as I loaded yeah because you knew you downloaded 50 Meg and installed it and
then you started it you don’t download 50 Meg already on the internet and wait
for people to load it and then do it it’s much better to build an interface
that gives the better the most use case up front and then makes it better after
subsequent loads it is the sensible in terms of data size and code that needs
to get passed and executed in an unknown environment again there’s a great reader
chrome team did some very very good research and we’re doing so we’re
releasing something soon as well about this how much it actually costs to parse
and execute the Java script on a mobile device you don’t
understand you cannot simulate this on a desktop as well you have to try it on a
real device so it’s very easy on a fast connection to download 500 1.5 Meg of
JavaScript SD and then it allows you to be very effective but the end user
basically has run out of memory by the time it actually tries to get the first
functionality of the website out there it also doesn’t allow us to deliver the
right solution to the current environment by bootstrapping your
solutions and giving the first solution in HTML and then making it better you
can do a lot of if statements in between and say like hey does this browser know
this API cool then I need this API if not I download that I download that
polyfill to help me override that problem but you don’t need to put that
polyfill into a system that already supports it and you don’t need to you
cannot call a fetch API on a browser that doesn’t support it I’m very happy
with that Safari yesterday really the new release they’re catching up as well
everything now that I was wanted to have is getting in there things like a
download attribute on the link that’s friggin cool fetch really really good
takes the stupidity out of xhr and the errors out of 8 xhr there’s so many good
api is coming but make sure you test for them and if they’re not available use a
polyfill but don’t use a polyfill for everybody cause the less code you send
to the end user the happier your end users are consider not using the
one-size-fits-all solution that makes you more effective this is not what
we’re here for this is not about us having a great time coding all the time
yes it’s fun to do that it makes us more effective as well but we’re getting paid
for this you know the people cleaning out the dishes at a buffet the people
taking your rubbish away in front of your house they don’t do that because
they love rubbish they do that because they get paid for it we get paid to
build things that make people use the Internet
we don’t get paid to actually make ourselves more effective all the time
this is a great idea to have this there’s a lot of research opportunity in
there but it’s not our day-to-day job our effectiveness should be reflected in
the great products that we build deliver progressively improving situation this
is progressive enhancement been hanging around that for years but
also means like progressive web apps there’s no question anymore how
progressive web apps are a great idea just look at that stuff it makes total
sense serviceworker can be applied to any old crappy HTML page old HTML app
and make it better the more you can store on people’s computers the more you
can store on people’s mobile devices the less has to be downloaded on a flaky
connection that might break that’s a great opportunity that we have right now
serviceworker is a wonderful wonderful thing and there’s lots of lots of good
work going on there all the code that didn’t get loaded an executor is a
benefit in the flaky connection world and we always have a flaky connect in
the world don’t get fooled by connectors at home try go out there try right now
here to use the wireless and you know what I mean I’m gonna finish with a
thing that you shouldn’t at the same time don’t be afraid to taste it sounded
like I’m not being reactionist and saying like oh don’t do new things
no do new things try new things out but also understand that you’re a
professional understand that you have to have a base to come from you have to
have something that you can deliver without thinking about it that became
muscle memory already we live in great times where you can learn most of what
you need in our market online and for free go to youtube era conference has
two talks they’re wonderful online courses like Khan Academy you can learn
almost everything online them for free for now we’re gonna see what the new
American government and what the English government is gonna do to it
but for now everything is online and free and beautiful so go and use that
stuff don’t spend if you got half an hour time off download one of those
videos there’s a Python script to download it from YouTube and watch it
learn something while you’re on the go don’t get bored and just play a random
game again for the 600 time find your free time to do something and try to be
part of this people put these things online for free for a reason they just
want you to use it so let’s let’s use them go and play try something new kick
the tires of products people sell you as amazing I’m not demonizing react I’m not
teaming izing angular – I’m not immunizing anything I’m trying them out
when I find time to do them but I’m wary I’m getting there when
buddy tells me this is the best solution ever and makes our job much easier
I heard that too many times I heard that too often and I also don’t want my job
to be easier because if my job is an expert job I get expert pay you know
we’re optimizing ourselves out of a market that’s kind of weird just because
we want to be optimized what’s next what’s coming next
machine learning yay like I love this stuff but I’m also scared of it because
even I am not safe in my job don’t sit on your laurels there’s so much to
explore out there I could now sit back and be like the JavaScript God from 2006
when I wrote my book and only talk about these things are the most important
things it’s very easy to give a talk about like don’t break the web don’t
change anything that we’ve done in 2004 because you would break the web if you
do it but that this is just being boring this is just sitting on your own stuff
we have to push ourselves to make new things to find out new things all the
time to become competitive and to be actually interested be sure to use the
opportunity to watch videos take courses and take part in open source projects
this is daunting this is scary and every open-source project that I mentor I tell
them half beginner bugs half things that are very easy to fix that are boring for
engineers on the product to build and to fix but would allow a new developer to
come in fix a buck and understand the structure of your project while actually
fixing a bug and how cool is that is the first thing you’re an effective part of
the thing that you want to be part of from the vet from the get-go you’re not
somebody who just comes in and doesn’t understand things and ask stupid
questions beginner bugs is a very very important thing for any open-source
project to have and it’s a great opportunity for you to play with the
project and sometimes realize ok even if the project is not for you at least you
fix the bug for them so you already have a good relationship with the people that
run the original project make sure to explain this to your companies and
demand time to keep learning I’m getting angry when I hear that one that the
average we are in a company one to two years and this is seen as a normal thing
this is not sustainable this is not allowing us to have a healthy job and a
healthy social life and a healthy life actually this is burning ourselves out
we’re being pushed into the world of investment bank
from the 1980s you know these assholes we see on television and we hate we have
we are becoming those we are becoming these overly competitive very very
efficient very very angry people that want to do more and more more more all
the time demand to be allowed to teach yourself new things demand down time in
your company and demand a proper training program in your company as well
companies it costs you about 20 thousand pounds to get somebody through the door
no matter who it is like paperwork and time and all the kind of things so when
somebody leaves it costs company a lot of money as well having a proper
training program having a proper support program for your engineers in your
company makes me choose you as a company I didn’t go to Microsoft because I love
the products dear god no a lot of them I never touch I never understood I never
have to deal with but I went to this company because it invests in me the
five-year question was not an interview question the five-year question was like
here is what we have in the next five years for you which is a way that you
think you want to go and how cool is that how much our mature environment
would we be if more companies did that and not like oh we’re running out of
investment in half a year we have no idea what you’re gonna do code monkey go
you know we need you to use these ten thousand things so we can hire new
engineers because we could be used to newest stuff if you need help with this
let’s talk I help a lot of companies out with that and I help a lot of I come to
companies on skype and in Brownback talks to them how important is to
actually turn your engineers into humans and not only into numbers it’s a very
important thing to keep ourselves happy it’s ridiculous that we’re the most
overpaid and pampered market with the most mental issues right now which is
like impostor syndrome and people being unhappy while being actually in a job
whereas other people have a hard time finding a job now to wrap up what’s for
pudding the JavaScript world and community is us whatever you do online
whatever you do in an in a commit whatever you do in a pull request is
part of the JavaScript community you cannot say it’s a toxic environment
without doing something about it you cannot say that it’s a daunting
environment without calling people out when they do daunting things we have to
watch each other and become better by telling each other off
when we’re doing wrong things it is not one browser or engine or environment
monoculture is stagnation let’s not stagnate but improve Internet
Explorer six was a gorgeous browser at its time building things only for
Internet Explorer 6 is still haunting me I wake up sweating every day because I
have to fix these kind of things and the same applies to Roley writing code for
v8 in note when there could be other JavaScript engines to support as well
think about flexibility think about moving parts getting exchanged all the
time think about providing standard supporting standards instead of
supporting one thing that is cool right now and shouting at other browsers to
support it as well I love that coexisting that my colleague has done
with different browser logos supervised for me to find out so there are many
ways you can help this community and not all are hardcore coding like we need
humans we need people who use words and feelings and talk to each other and help
each other out we need people who write documentation we need people who who do
like little screencasts of explaining how to you how to use something for
other people we need to break the toxic demand of more code in less time this is
stupid this is not impressive when you tell me
I spent 16 hours in the office yesterday and I wrote so much code I’m like okay
you’re broken now take 2 days off at there’s no way I can have in a meeting
without being grumpy without being annoying for other people don’t fall for
that you got to do more fast and things what that is is actually fast food and
fast food quick cheap and fast makes us sick in the long term and this is what
we’re doing right now quick fixes being more effective using beta things in life
productions because they make us more effective this is great but it’s it does
a place for that it’s called academia it’s called University it’s called
schools it’s called downtime research time you
don’t research in production that’s a very very scary thing the whole move
fast and break things drives me crazy because this is again a toxic way the
way bankers were in the 80s it’s basically an arrogant way of
working and not sustainable in the long term we need to deliver things that are
digestible with good with good ingredients and non fattening so make
your things as small as possible make your things
do the one thing well and add other things at the end of it and that needs
time and effort and demand that you get that time you’re not here to churn out
code you’re here to build interfaces that people use love and make become
more effective and that’s all I had so thanks very much you

Add a Comment

Your email address will not be published. Required fields are marked *