Why Reading JavaScript Is More Difficult When Default Exports Are Usedby@baransu
348 reads

Why Reading JavaScript Is More Difficult When Default Exports Are Used

tldt arrow
Read on Terminal Reader🖨️

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

@baransu

Tomasz Cichociński

Credibility

react to story with heart
Tomasz Cichociński HackerNoon profile picture
by Tomasz Cichociński @baransu.I write about TypeScript, React, and Node.js. Exploring real-time rendering and Elixir in spare time.
Read my stories

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa