.

HD Mp4 3gp Video
Live Update Video
Play/Download
Live 3D App
Search.Pencarian Menu

Add text send email to rh3252705.adda@blogger.com or Click this (Text porn Will delete) | Tambah teks kirim email ke rh3252705.adda@blogger.com atau Klik ini (Teks porno akan dihapus)
Total pos : 19157+

[Go Make Things] No default exports

Today's newsletter is sponsored by ConfigCat — the feature flag service that helps you release features faster and with less risk. More on them at the end of today's newsletter.

Today, I wanted to touch quickly on an extremely opinionated JavaScript architecture/code authoring standards position I have.

Do not ever use default exports.

I've worked on projects that used a mix of default exports and collections of exports, and it gets really confusing, really fast.

import { formatCurrency } from './formatCurrency.js';  import convertCentsToDollars from './convertCentsToDollars.js';  

Why is formatCurrency destructured, but convertCentsToDollars is not?

You might assume that convertCentsToDollars is the only export in its file, while formatCurrency is one of a few exports.

And that could be the case. Or it could not!

And that's exactly the point. The mix/match of default exports and object destructuring imports creates needless mental overhead and forces me to think about things that I shouldn't have to.

If everything gets imported "the normal way," I never have to think about how to import it.

Are you looking for a service to support dynamic feature flags? ConfigCat is a cross-platform LaunchDarkly alternative that's easy to learn and quick to set up. With SDKs for 19 platforms — including JavaScript, Python, Ruby, Java, and even Rust — you can toggle features on or off without redeploying.

ConfigCat subscriptions are the same price regardless of your team size. Get 25% off any paid plan with code GO25 or just use ConfigCat's generous free tier. Definitely worth checking out.

Cheers,
Chris

Want to share this with others or read it later? View it in a browser.

Share :

Facebook Twitter Google+ Lintasme

Related Post:

0 Komentar untuk "[Go Make Things] No default exports"

Back To Top