Full Stack Radio

144: Gary Bernhardt - TypeScript and Testing


Listen Later

Topics include:

  • Why Gary decided to write Execute Program as a full-stack TypeScript application instead of using a Ruby or Python backend like he may have traditionally
  • Do you actually have to write less tests if you have a good type system?
  • What does a good type system give you that tests can't give you?
  • Using io-ts to type check incoming data
  • How to think about structuring your code to best take advantage of the benefits your type system gives you and minimize the need to write tests
  • Pushing conditional logic to the core of your system to reduce the number of tests you need to write at the edges
  • The correlation between type errors and behavioral bugs, and how a type system can help you catch mistakes you don't think to test for
  • Do type errors signal that you're missing a test?
  • Structural vs. nominal type systems, and the benefits of structural type systems like used by TypeScript and Go
  • Best practices for type-checking within a function in a structural type system like TypeScript
  • The power of supporting literal types like true or "active" in addition to traditional types

Links:

  • Destroy All Software
  • Execute Program
  • TypeScript
  • "Are tests necessary in TypeScript?"
  • io-ts
  • TypeScript course on Execute Program
  • Gary's tweet about unions with literal types

Supporting the show:
I decided to stop taking sponsors for the show because I think advertisements are annoying and no one wants to listen to them.

If you do want to support the show, the best way to do it is to purchase one of my products:

  • Tailwind UI, a collection of professionally designed, fully responsive HTML components built with Tailwind CSS.
  • Refactoring UI, a book and video series I put together with Steve Schoger on designing beautiful user interfaces, without relying on a designer.
  • Advanced Vue Component Design, a course on designing simpler, more flexible Vue components that are both more powerful and easier to maintain.
  • Test-Driven Laravel, a massive video course on designing robust Laravel applications with TDD. Learn how to build a real-world application from scratch without writing a single line of untested code.
  • Refactoring to Collections, a book and video course that teaches you how to apply functional programming principles to break down ugly, complex code into simple transformations — free of loops, complex conditionals, and temporary variables.
...more
View all episodesView all episodes
Download on the App Store

Full Stack RadioBy Adam Wathan

  • 4.7
  • 4.7
  • 4.7
  • 4.7
  • 4.7

4.7

179 ratings


More shows like Full Stack Radio

View all
The Changelog: Software Development, Open Source by Changelog Media

The Changelog: Software Development, Open Source

291 Listeners

The Laravel Podcast by Taylor Otwell, Matt Stauffer

The Laravel Podcast

57 Listeners

LINUX Unplugged by Jupiter Broadcasting

LINUX Unplugged

266 Listeners

Laravel News Podcast by Jacob Bennett and Michael Dyrynda

Laravel News Podcast

56 Listeners

The Laracasts Snippet by Jeffrey Way

The Laracasts Snippet

76 Listeners

North Meets South Web Podcast by Jacob Bennett and Michael Dyrynda

North Meets South Web Podcast

24 Listeners

Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

Syntax - Tasty Web Development Treats

984 Listeners

REWORK by 37signals

REWORK

210 Listeners

No Plans to Merge by Daniel Coulbourne & Caleb Porzio

No Plans to Merge

50 Listeners

Notes On Work - by Caleb Porzio by Caleb Porzio

Notes On Work - by Caleb Porzio

17 Listeners

Hard Fork by The New York Times

Hard Fork

5,476 Listeners

How About Tomorrow? by Adam Elmore & Dax Raad

How About Tomorrow?

20 Listeners

Mostly Technical by Ian Landsman and Aaron Francis

Mostly Technical

27 Listeners

Talking Businessly by Daniel Coulbourne & John Drexler

Talking Businessly

2 Listeners

The Panel by Justin Jackson & Brian Casel

The Panel

4 Listeners