DEV Community

Discussion on: Should you pick C# over JS? Maybe.

Collapse
 
denvercoder profile image
Tim Myers

20 using statements vs 20,000 node_module files? 🤔

Collapse
 
denvercoder profile image
Tim Myers

With JavaScript you can use the fetch api but it sucks and almost no one does so you ‘npm install’ axios and then add an import statement. JavaScript doesn’t have good date time handling so you ‘npm install’ date-fns.

Would you like to see how many import statements I have on my current JavaScript project?

Thread Thread
 
denvercoder profile image
Tim Myers

There are several files with 30+ imports but the average is about 12 per file.

Now with Blazor all of your front-end usings can be put into one file and you can maintain them there.

Collapse
 
aarone4 profile image
Aaron Reese

Ah yes, but I don't need to know WHICH 20,000 mode_module files :)

Thread Thread
 
instanceid profile image
instance.id

I can't remember the last time I had to manually add a using statement with Rider, or really with most any modern IDE. They just add them for me.

Thread Thread
 
denvercoder profile image
Tim Myers

Yep. I use rider too. Or you can use Resharper. And I don’t know if it’s still around but there issues to be Visual Studio Power Tools that added usings.

 
denvercoder profile image
Tim Myers

And I don’t need to know what usings I have. If you place your cursor over the red squiggly then hit CTRL+ . It will add them for you. 😂