JavaScript is a sh*tshow

Issue #124.October 3, 2022.2 Minute read.
Bytes

Welcome to #124.

Congrats to our final winner of The Festival of Bytes, Timothy Whitbeck, for being the 200th person to respond to the last issue and winning the SNES. For those curious, 417 of you responded.

Today, we’ve got a big bowl of blue kool-aid, a controversial name for my newborn, and core memories of Parachute Day.


Eyeballs logo

The Main Thing

Bill gates and warren buffet playing ping pong

Look how big you're getting!

Ten Years of Types

TypeScript turned 10 years old on Saturday, and since none of you showed up for the birthday party, we decided to throw one ourselves.

So whether you’ve been a true believer since day one fifteen, or you’re still yet to type your first script — it’s time to step up to this giant bowl of blue Kool-Aid and take a sip.

Where we’ve been: If you think JavaScript is a sh*tshow today, you should’ve seen it back in 2007. Not only was the language itself much less robust that it is now, but members of the TC39 Committee couldn’t agree on what it should become going forward.

Microsoft, in particular, objected to many of the larger changes being proposed in ES4 at the time, because they deemed them too big and too risky for this simple scripting language, which was (in their opinion) “never designed to be a programming language for big applications.”

So after ES4 failed to reach consensus, Anders Hejlsberg and his team went deep into the Microsoft lair for a few years and eventually came back with TypeScript — a JavaScript superset that augmented JS by adding new, “application-scale” features like classes, modules, and static typing.

But if we fast forward to today, JavaScript has now added most of those features to the Spec. So why is TypeScript still hotter than Harry Styles wearing a dress a totally normal hot thing like a stove, maybe?

There are lots of reasons for TypeScript’s popularity, but most of them fall into one of three categories:

  • TS the language — Because it’s built on top of JavaScript, any valid TS program is also a valid JavaScript program. This lets you import any JS modules you want, and it allows you to gradually adopt TS features into your codebase, so it doesn’t have to be an all-or-nothing experience (unlike getting your first face tattoo).

  • TS the linter — Because it understands the relationship between the types in your codebase, TS can help eliminate all types of bugs (especially when paired with a compatible IDE). Much like your middle school basketball coach, it only yells at you because it cares.

  • TS the documentation tool — Type annotations make it easier to give helpful context to your team (and yourself in the future) about what your code is actually doing, without having to write a bunch of comments (gross).

Where we go from here: TypeScript’s meteoric rise over the past 10 years seems like it’ll keep on meteor-ing for a while. More and more companies are using it for their enterprise apps (Anders called his shot) — so if you haven’t had to learn it yet, it’s probably just a matter of time.

Add in the proliferation of AI-assisted programming tools like Copilot (which are even more powerful when used in a TypeScript codebase), and it seems like TypeScript is poised to become even more entrenched over the next 10 years. See y’all in 2032.

        

Jamstack Conf Logo

Our Friends
(With Benefits)

A big orc from Lord of the Rings

Looks like JAM's back on the menu

Jamstack Conf is back in all its glory

Sometimes it feels like all tech conferences are the same. Same speakers, same topics, same free lunch that tastes like it came from your middle school cafeteria.

But not Jamstack Conf. It’s the Coachella of tech conferences — just with less hallucinogens and more JavaScript.

And since it’s finally back in person on Nov. 7-8, they’re going all out:

  • Great speaker lineup with a healthy (and diverse) mix of smart people you’ve heard of, and smart people you haven’t (yet).

  • Hands-on workshops that’ll help you pick up new skills — like How to build backends with Remix and How to speed up your E-comm site.

  • Really good food, happy hours, and a block party on a rooftop in downtown SF.

Check it out and use the code BYTES to get an exclusive 20% off.


The Job Board Logo

The Job Board

Software Engineer - Frontend
Remote-friendly
React
TypeScript
$220k-$800k

Phantom's crypto wallet is used by millions of people to access apps and financial services built on the Solana blockchain. As a frontend engineer at Phantom, you'll be doing everything from creating delightful user experiences, contributing to cross-platform client infrastructure, and crafting web3 developer SDKs. Join us on our mission to make the digital eco.

Senior or Staff Front-end Engineer
100% Remote
React

Close.com is looking for 2 experienced individuals that have a solid understanding of React and want to help design, implement and launch major user-facing features. Close is a 100% globally distributed team of 65 high-performing, happy people that are dedicated to building a product our customers love.

Have a job you want to fill?
Spot the Bug logo

Spot the Bug

Sponsored by Trunk

Trunk is a DevEx toolkit that basically tricks you and your team into following best practices. You’ll test, merge, and monitor your code without feeling like you’re actually doing any of that boring stuff. Check it out.

const user = {
  name: 'Tyler',
  age: 32,
  greet() {
    alert(`Hello, my name is ${this.name}`)
  },
  mother: {
    name: 'Jan',
    greet() {
      alert(`Hello, my name is ${this.mother.name}`)
    }
  }
}

user.mother.greet()

Cool Bits logo

Cool Bits

  1. Christoph Nakazawa created this minimal, fast starter template for Vite, React, TypeScript and Tailwind that he appropriately named vite-ts-react-tailwind-template. And yet, everyone in my family says I’m crazy for wanting to name my newborn baby lumpy-tiny-human-boy.

  2. CarbonQA provides QA services geared for dev teams. They’ll boost your team’s morale sky-high by… breaking your code repeatedly. But the good news is that you’ll never have to waste time on testing again. They work in your tools, talk with your team on Slack, and let your devs be devs. [sponsored]

  3. Jenna Smith wrote a good article about Progressive Enhancement for a more resilient web. Because all of a sudden, every web developer is more obsessed with PE than a bunch of elementary school kids on Parachute Day.

  4. Liqe is a lightweight Lucene-like parser, serializer and search engine. So I guess you can dere-LIQE my JSON, cap-i-tan.

  5. Julian Benegas wrote about how Vercel is Serving millions of users on the new MrBeast storefront. But we all know this is just part of Guillermo’s 35-part plan to get in a MrBeast video.

  6. CodeGeeX is an open-source, large-scale multilingual code generation model with 13 billion parameters. This looks like a cool OSS alternative to GitHub Copilot — but the downside is that if you don’t pay for Copilot, Bill Gates might not be able to afford to buy as many giant ping pong paddles. So, tradeoffs.

  7. Our friends at Supabase just open sourced postgres-wasm, a PostgresQL server that runs inside a browser. Why? Why tf not?

  8. Cloudflare just released Turnstile — a “user-friendly, privacy-preserving alternative” to Google’s reCAPTCHA. And Cloudflare’s CEO wrote a beautifully sarcastic comment about it on Hacker News that has inspired us to officially offer him a job as a part-time Bytes writer. Matthew, we can’t offer you the same salary and perks you’re getting now, but we can promise that you’ll never have to be on an earnings call again. Think about it.


Spot the Bug logo

Spot the Bug: Solution

Sponsored by Trunk

const user = {
  name: 'Tyler',
  age: 32,
  greet() {
    alert(`Hello, my name is ${this.name}`)
  },
  mother: {
    name: 'Jan',
    greet() {
      alert(`Hello, my name is ${this.mother.name}`)
    }
  }
}

user.mother.greet()

When we invoke user.mother.greet, we can tell what the this keyword is referencing by looking to the “left of the dot” of the invocation – in this case, mother.

So inside of greet, it’s as if we had my name is ${mother.mother.name}, which is clearly wrong. Instead, since the this keyword is referencing mother, we can just do this.name.

const user = {
  name: 'Tyler',
  age: 32,
  greet() {
    alert(`Hello, my name is ${this.name}`)
  },
  mother: {
    name: 'Jan',
    greet() {
      alert(`Hello, my name is ${this.name}`)
    }
  }
}

user.mother.greet()