Bytes.dev - Bytes: C++ kind of sucks, actually

Bytes banner (Turn on images 😘)

This week, we’ve got Google’s succession plans, Bun tattoos, and my virtual wolfpack chatroom from 2005. Welcome to #110.


Wrestlers giving up the crown

Live footage of the C++ succession ceremony

Google wants to build the TypeScript of C++

It all went down last week in Toronto at a C++ Conference (yes those are real, I checked).

Chandler Carruth (leader of the C++, Clang, and LLVM teams at Google) stepped onstage to give the keynote speech, slowly locked eyes with everyone in the audience, and delivered the news: “C++ kind of sucks, actually.”

Ok, he didn’t say it quite like that. But he did say that the language is “falling short” of its stated goals – which include software and language evolution, creating code that is easy to write and understand, and more.

Why though? Just like your parents, most C++ issues stem from the fact that it’s pretty old and unwilling/unable to change (still love you, mom).

The language is bogged down by decades of technical debt, but it needs to focus on backwards compatibility (at the expense of incremental improvements) to make sure it doesn’t break all of the low-level systems that use it to power
 (*checks notes*) most of the modern world.

After outlining all of the C++ problems, Chandler (aka Chan-C) also offered a solution that he’d been cooking up with his friends at Google: an experimental “successor language” to C++ called Carbon.

This approach is similar to JavaScript → TypeScript and Java → Kotlin: it’s designed for tight interop with C++ and large-scale adoption/migration, while giving Carbon the freedom to make improvements much faster.

Highlights:

  • Performance matching C++, so it doesn’t sacrifice any speed

  • Simplified grammar and keywords, so it’s a lot easier to learn and use

  • Seamless, bidirectional interoperability with C++

Bottom Line: There are lots of great options for modern, low-level programming languages out there (Rust, Go, Kotlin, and more). But the C++ ecosystem isn’t going away anytime soon, especially now that Google has stepped in the ring. Stay tuned.


Cat stuck in a pringles can

“Looks like I got stuck hand-rolling auth again” [sponsored]

FusionAuth is the holy grail

Trying to build authentication from scratch is like trying to hold in diarrhea while meeting your future in-laws – it’s painful, complicated, and you’re one wrong step away from a complete disaster.

That’s why we’re huge fans of FusionAuth.

They’re a complete auth solution that takes care of all the gross stuff like SSO, MFA, user management, and security – and if you don’t know what one or more of these things are
 you probably need it.

Their Free Community version is surprisingly robust (no credit card, no limits, and it’s free forever if you self host 🙏). That makes it great to learn with or use for side projects, but it’s also got a pretty seamless integration process for existing apps.

And if you ever get stuck, you can call their support line and talk to an actual engineer who really knows auth – instead of just typing your questions into a support chat box that no one will read (like some other auth companies I know).

Check it out and never worry about auth again.


Succession characters sitting in a circle

Design system support group

Radix releases v1.0 so you can stop pretending to build your own

Remember ~2 years ago when every frontend dev wanted to work on design systems, only to realize it’s basically like working in the basement of Lumon Industries?

Fortunately, Radix UI (Latin for round) just released v1 of their set of primitive, un-styled React UI components – so we can all stop pretending to build our own 🙏.

What makes Radix so good? Every React app does styling differently, which can make certain component libraries a no-go. Radix, however, is unstyled, which makes it easy to adopt and customize.

Each component encapsulates the markup and core UI behaviors while ensuring that accessibility features like keyboard navigation, focus management and screen readers work out of the box (aka all the things your PM would cut from the scope because “we need to move fast and break things”).

Basically, Radix let’s you live your life, while they earn the finger traps for providing some top-tier goodies out of the box:

  • 26 different components, including essentials like tooltips and modals (popovers), but also has primitives like Portal to help you compose your own components.

  • Great SSR support for React 18, which ensures that fast TTI for screen readers.

  • Small bundle size – you can adopt the components one at a time and save some bits.

  • Nice add ons including an accessible icon library and color palette generator.

  • Works with any styling or animation solution, but the team build their own zero runtime css-in-js solution too.

Bottom Line: You know a component library must be great if big bois like Vercel, Linear, and Supabase were already using it before Radix had released v1. Excited to see where it goes from here 🚀.


Spot the Bug – Sponsored by Appwrite

Their secure, open-source backend asa service gives you all the core APIs you need to build anything you can think of.

function reduceLanguages (str, lang, i) {
  if (i === this.languages.length - 1) {
    return `${str} and ${lang}.`;
  }

  return `${str} ${lang},`;
}

const user = {
  name: "Tyler",
  age: 27,
  languages: ["JavaScript", "Ruby", "Python"],
  greet() {
    const hello = `Hello, my name is ${this.name} and I know`;

    const langs = this.languages.reduce(reduceLanguages, "");

    return hello + langs;
  },
};

const greeting = user.greet()

Jobs

Frontend software engineer at Phantom

Phantom is looking for frontend engineers who enjoy massive ownership and freedom, and who want to work with a variety of technologies, including React, TypeScript, and React Query. You’ll be directly impacting the development of their flagship mobile app and working closely with the founders to improve the product. The role is fully remote.


Cool Bits

  1. Ryan Carniato wrote about The Cost of Consistency in UI Frameworks. FWIW, “The Cost of Consistency” also sounds like the title of a (ghost-written) self-help book by a college football coach who’s about to get busted for doing something super illegal.

  2. BugHerd simplifies Website QA and UAT testing for everyone and sends website feedback to one central location for easy management. As a result, one team was able to reduce bug ticket management time by 75% đŸ€Ż [sponsored]

  3. Kelly Lampotang and Bonnie Nguyen wrote about Building text animations for Instagram Stories at Meta. Those text animations have really helped take my inspirational quote + stock image IG stories to the next level: “For the strength đŸ’Ș of the wolf is the pack đŸ‘Żïž, and the strength of the pack is the wolf đŸș.” Smash that follow button for more pure alpha inspo.

  4. The PyTorch team partnered with Expo to create PlayTorch – a new app and SDK for easily prototyping “AI-powered experiences.” I’m not really sure what that means, but I’m sure it’s good, right? Right??

  5. Kara Erickson spoke about the NuxtJS and Chrome collaboration that she works on as a member of the Chrome Aurora team. What a coincidence, “Chrome Aurora” is also the wolf name that all of my brother wolves gave me in that virtual pack I joined in that chat room back in 2005.

  6. Baldur Bjarnason wrote an article called, I don’t care how you web dev; I just need more better web apps. Why would you say something so controversial, yet so brave?

  7. Awesome Bun is a repo full of “awesome things related to Bun” – just in case you weren’t entirely sure what phase of the hype cycle we’re in. (First one to get the Bun logo tattooed on their face wins a free hoodie!)

  8. You.com (S-tier domain flex) is a new search engine that’s looking to target developers with features like code snippets in the search results and AI-assisted autocomplete for code searches. Here’s an example. It was very forward-thinking of them to get Kelly Clarkson to write and record their product theme song back in 2004.


Spot the Bug Solution – Sponsored by Appwrite

If you run the original code, you’ll get “Uncaught TypeError: Cannot read properties of undefined (reading ‘length’)”. The only place we’re using .length is inside our reduceLanguages function, so we can infer that this.languages is undefined and we’re incorrectly using the this keyword.

Whenever you’re trying to figure out what the this keyword is referencing, you need to look at where the function using the this keyword is being invoked. In our example, we don’t know since it’s in the implementation of reduce. To make sure reduceLanguages gets invoked in the right context and therefor has the correct this binding, we have two choices. First, the old school way - using .bind.

greet() {
  const hello = `Hello, my name is ${this.name} and I know`;

  const langs = this.languages.reduce(reduceLanguages.bind(this), "");

  return hello + langs;
}

Second, the better way - using an arrow function.

greet() {
  const hello = `Hello, my name is ${this.name} and I know`;

  const langs = this.languages.reduce((str, lang, i) => {
    if (i === this.languages.length - 1) {
      return `${str} and ${lang}.`;
    }

    return `${str} ${lang},`;   
  }, "");

  return hello + langs;
}

The reason this works is because with arrow functions, this is determined lexically. Arrow functions don’t have their own this. Instead, just like with variable lookups, the JavaScript interpreter will look to the enclosing (parent) scope to determine what this should reference.

Want to read more? Check out Understanding the “this” keyword, call, apply, and bind in JavaScript.


Have a product you think our developers will love?
Advertise in Bytes

ui.dev icon youtube icon twitter icon

50 W Broadway Ste 333 PMB 51647 Salt Lake City, Utah 84101

Unsubscribe from Bytes

Older messages

Bytes: what exactly are the differences between JSC and V8?

Monday, July 18, 2022

This week, we've got robots, engines, and minions. Welcome to #109. When you finally give GitHub Copilot your credit card Love, Death & (Coding) Robots Last year, GitHub introduced us all to

Bytes: Sun's Out Bun's Out

Monday, July 11, 2022

As a reminder for all our cultured readers, today is National Slurpee Day so make sure you take advantage. This week, we've got hot cross buns, a new Shrek getting chosen, and how to apply The

Bytes: Like any good doggo, ESLint might be a little overbearing

Monday, July 4, 2022

Happy Fourth of July to those who celebrate and happy July 4th to those who don't. This week, we've got our special Bytes Cocktail recipe, our class action lawsuit Airbnb developers, and a

Bytes: Hot Spec Summer is BACK

Monday, June 27, 2022

This week, we've got Hot Spec Summer, Shopify's Big H, and Bionicles fan fiction. Welcome to #106. Hot Spec Summer is back A tradition unlike any other Last week, we observed the only religious

Bytes: If it renders on the edge, it's time to pledge.

Monday, June 20, 2022

This week, we've got the Death Cab for Cutie of auth solutions, lessons from Daddy Warzucks, and nowhere to hide. Welcome to #105. We are fast. We are lean. We are French. The build tool coming for

You Might Also Like

LockBit Ransomware Developer Charged for Billions in Global Damages

Saturday, December 21, 2024

THN Daily Updates Newsletter cover The Data Science Handbook, 2nd Edition ($60.00 Value) FREE for a Limited Time Practical, accessible guide to becoming a data scientist, updated to include the latest

Re: My VPN recommendation

Saturday, December 21, 2024

Do you know when to use a VPN and what it does to protect your data? Any time you are connected to the internet, your information is at risk of being tracked or hacked. A VPN helps keep your surfing

📧 Scheduling Background Jobs With Quartz in .NET (advanced concepts)

Saturday, December 21, 2024

​ Scheduling Background Jobs With Quartz in .NET (advanced concepts) Read on: m​y website / Read time: 6 minutes The .NET Weekly is brought to you by: It's been a big year for API collaborations!

The Thrill Was Never There 🎸

Saturday, December 21, 2024

Takeaways from a punk-rock creator who says he doesn't like punk. Here's a version for your browser. Hunting for the end of the long tail • December 20, 2024 The Thrill Was Never There A famous

🎮 Smartphones Will Never Kill Dedicated Handhelds — 11 Stocking Stuffers for iPhone Owners

Friday, December 20, 2024

Also: How to Add a Smart Speaker to Your Home Assistant Setup How-To Geek Logo December 20, 2024 Did You Know The nursery rhyme "Mary Had a Little Lamb" is based on a true story. The girl in

Daily Coding Problem: Problem #1643 [Easy]

Friday, December 20, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Facebook. Given a 32-bit integer, return the number with its bits reversed. For example,

JSK Daily for Dec 20, 2024

Friday, December 20, 2024

JSK Daily for Dec 20, 2024 View this email in your browser A community curated daily e-mail of JavaScript news Empower Your Data Insights: Integrating JavaScript Gantt Chart into Power BI Syncfusion

Charted | America’s Top 20 Billionaires, by Wealth 💰

Friday, December 20, 2024

America's top 20 billionaires have a combined wealth of $2.7 trillion, as of December 2024. See how it all breaks down in this infographic. View Online | Subscribe | Download Our App Presented by:

My holiday AI reading list 🎄

Friday, December 20, 2024

plus, what's coming in 2025 ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Spyglass Dispatch: On to '25

Friday, December 20, 2024

Google's 'AI Mode' • Billionaires at Dinner • Nintendo's Switch 2 • Amazon's Bond Problem The Spyglass Dispatch is a newsletter sent on weekdays featuring links and commentary on