Hello Kyle! Welcome to the interview with JS Nation. So, with all these You Don’t Know JS books written, do you think you know JS? 😉
I think the way JS handles types is probably the most misunderstood (and thus controversial), although its “class” system is a close second right behind. I find most people only think about “types” in terms of the static typing they’re used to from languages like C++ or Java, and since we don’t have as obvious of a type system in JS, one that shows up in syntax, the assumption is that JS’s type system is either naive (at best) or non-existent (at worst). In my opinion, JS’s type system is actually wonderfully powerful and actually well designed. It’s not perfect, but it’s vastly under-understood and under-utilized.
I don’t think we need to “fix” types in JS (like TypeScript or Flow), I think we just need to understand them better and more clearly communicate our types in JS. For example, completely contrary to most common belief, the == operator is actually more powerful and more useful in our programs than ===, and in fact, usage of == should be preferred and === should only be a last option. But to understand why I make that claim, you have to actually learn types, and the way they’re converted: coercion. I really wish developers wouldn’t just keep parroting back “JS types are evil” like they’ve heard for years. They’re great, and your programs suffer if you don’t learn and use them to their full potential.
I’m probably most fascinated with JS’s “multi-paradigm” approach. Certainly JS is not the only language to claim that label, but I think maybe JS is the most multi-paradigm of any language, mostly because of how far the language is stretched in such opposite directions. It’s astonishing to me to contemplate how a 10-day experimental language could have grown into the world’s most ubiquitously used language, while at the same time, most of the core of the language was there back on day 10. I don’t know how to attribute that kind of surprising and unrivaled success to anything other than accidental genius on Brendan Eich’s part. There are plenty of “JS haters” around, and most of them lament JS wishing instead for some other “better” language to have been in its place.
The problem is, JS is exactly what it needed to be to get to where it is. None of those other languages would have succeeded. And I think that’s in part because none of those other languages are as flexible (aka, “multi-paradigm”) as JS has proven itself to be. I don’t have to choose to write a program entirely procedurally, or entirely object-oriented, or entirely with FP patterns. I can pick which of those paradigms works best for each part of my program, and JS is flexible enough to let me mix-n-match them. As far as I’m concerned, no other language has ever (or will ever!) come as close to universal as JS has. When it’s referred to as a “lingua franca”, the reason for that is because it’s flexible enough to serve as the common bridge language between nearly any combination of programming languages you could imagine. That’s truly fascinating to me.
First off, I’m not a JS expert, and I definitely don’t think I deserve to be called a “classic”. I’m tremendously grateful for the outsized (and unplanned!) impact I’ve had the privilege of making on the JS community. When I started to write YDKJS, I told my publisher I wanted to sell 2500 copies to feel like a success. Today, the books have sold more than 100k copies. I never in my wildest dreams would have imagined that.
It’s still hard to comprehend. I think and hope that what has resonated most with so many readers is that I trust and respect my readers, and indeed my fellow programmer community colleagues, enough to believe they deserve to know how and why something works, the whole truth, not just be told to do what I say because only I know what I’m talking about. I always try to speak and write as if I was sitting next to them, having a conversation where I wanted to share something I’ve learned and passionate about. I think that’s what makes YDKJS take root in people’s minds — they come away truly feeling like someone cared enough to help them know JS a little better.
I always tell people that the only difference between me and them is that I asked more questions and didn’t stop until I found the answers. And then I decided to write down my journey of asking questions and finding answers in book form, so that others would maybe have an easier path. I’m overjoyed, almost beyond words — which is a big deal for a writer! — that it’s reached and helped so many.
How did you “fall in love” with JS? Did you have some sort of teacher or mentor that helped you get started or you were a self-learner?
I’m definitely of the self-learner clan. I had formal CS education, but that only taught me to appreciate programming as an engineering discipline rather than as a hobby or toy. The CS programs I attended looked down on languages like JS, so they had nothing direct to do with my attachment to the language. Unlike many who say the more they learn about JS the more they dislike it, for me it was the complete opposite.
I didn’t like it at first, but as I learned to understand it more, I really began to love it. Definitely not a love-at-first-sight sort of situation! I think what I’ve loved most is, that no matter what complexity of problem I try to solve, there always seems to be a way for JS to bend to let me solve it. It’s the most flexible tool I’ve ever encountered, and that makes me feel empowered and capable. I feel powerless contemplating writing software in other languages, like I wouldn’t even know where to begin. But the more JS spreads into other domains, the more I get excited about being able to use what JS can do in those places.
I can write apps for my phone, my watch, my refrigerator, my tv, my cable box, and even to control the lightbulbs in my house! It’s the fulfillment of my childhood dreams, I can make it do whatever I want! Who wouldn’t love that!?
I think “Open-First” and “Symmathecist” together most fully embody my identity in our community. I say “open first” because I truly believe that the best software is the software we build together, rather than the software we distribute to others so they can be impressed. I always start with the assumption that every line of code I write is the worst possible version of that code, and that my only hope of improving it is to put it out there ASAP and try to get others help me improve it. That’s the ethic that I think is truest to the spirit of “open source” as a community movement, and I try to live out and model that for others.
“Symmathesy” is a concept that’s a little newer to me in terms of having a word for it, but it’s what I’ve always believed and didn’t have as good of a way to articulate. A great talk by Jessica Kerr helped me grab ahold of this idea. Symmathesy means “learning together”. My handle “getify” was conceived years ago to describe my role as “going out and getting things (ideas, services, etc) and making them available to people”. I didn’t even realize at the time that this would evolve into me teaching.
But for me, teaching and learning are two sides of the same effort. So when I teach, I truly am “learning together” with others as I do, and I’m hoping to help others do the same. So open-first symmathesy embraces the idea that we will all be better, and learn more, if we do it together rather than apart.
On your Kickstarter campaign page, you mentioned you were trying a hybrid publishing model with support from both people and a publishing house. Do you think this model worked?
I’m tremendously glad for that experiment, and for O’Reilly’s willingness to let me do it (on their dime). I hoped, and still do hope, that people would be more likely to become authors if someone could de-mystify the whole process of writing and getting published. My editors were quite intimidated when I told them I was going to require that they sign up for Github accounts and post all their feedback as issues and PRs! But it’s because I wanted to live out that open-first mentality with my writing just like I do with my coding and my teaching. And I think that’s been a very good thing for anyone who’s ever been interested in writing.
I’ve had countless folks over the years use that information, and ask me more probing questions, and then go on to become authors themselves. That’s hugely gratifying. I still write and (now self-) publish with that open-first approach, and I expect I will continue to do so for as long as I’m a writer. I can’t imagine doing it any other way. And I hope I keep inspiring others to do the same.
You’re going to give a keynote in one of the most beautiful churches in Amsterdam. Considering you’re a JS Theologian and going to speak at a former church, is this not a sign?
What are you going to talk about at the Amsterdam JSNation Conference?