paint-brush
Why Reading JavaScript Is More Difficult When Default Exports Are Usedby@baransu
373 reads
373 reads

Why Reading JavaScript Is More Difficult When Default Exports Are Used

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

Too Long; Didn't Read

Using default exports hurts your codebase readability and refactorability. The first major problem with default exports is naming. You have to think about name import every time you include a function. It's forcing you to come up with a good name when creating a new function, as it's allowed to export anonymous values. You cannot spot right on what's that function is supposed to do. You can suggest a different name in the code review, but it's adding that complexity which could be easily avoided.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Why Reading JavaScript Is More Difficult When Default Exports Are Used
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

DYOR

DYOR

The writer is smart, but don't just like, take their word for it. #DoYourOwnResearch

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

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