paint-brush
Using Destructuring and Inline Types Can Hurt Your TypeScript Codebaseby@baransu
1,141 reads
1,141 reads

Using Destructuring and Inline Types Can Hurt Your TypeScript Codebase

by Tomasz Cichociński4mOctober 10th, 2022
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

Using destructuring and inline types makes your TypeScript less readable. I want to show you how using destructuring makes it less readable in TypeScript. It discourages creating smaller helper functions and relying on composition to build up your main function logic. There is no natural place to write documentation comments when all the types are cramped with destructuring in the function definition. It's just a lot of space of code and takes a lot-of-space of lines of code. In addition, it focuses on implementation detail in addition to the implementation detail.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Using Destructuring and Inline Types Can Hurt Your TypeScript Codebase
Tomasz Cichociński HackerNoon profile picture
Tomasz Cichociński

Tomasz Cichociński

@baransu

I write about TypeScript, React, and Node.js. Exploring real-time rendering and Elixir in spare time.

0-item

STORY’S CREDIBILITY

Code License

Code License

The code in this story is for educational purposes. The readers are solely responsible for whatever they build with it.

L O A D I N G
. . . comments & more!

About Author

Tomasz Cichociński HackerNoon profile picture
Tomasz Cichociński@baransu
I write about TypeScript, React, and Node.js. Exploring real-time rendering and Elixir in spare time.

TOPICS

Languages

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here