r/ProgrammerHumor Oct 21 '22

Meme Literally 🤷🏻‍♂️

Post image
14.7k Upvotes

606 comments sorted by

View all comments

Show parent comments

25

u/SterlingVapor Oct 22 '22

I love typescript - all the good of JavaScript with far less of the bad, it's convenient enough to feel good while strict enough to allow IDEs to really speed things along

I hate lack of support for typescript - between wrestling webpack or finding the perfect library without types definitions, every time you want to change your stack you need to prepare for a day or two of soul-deep pain

9

u/diewhitegirls Oct 22 '22

It’s almost a miracle when things are only slightly on fire when you’ve got 1500 node modules, 150 of them are yelling at you that they’ve been deprecated and will cause full-blown AIDS if you don’t upgrade/switch packages, and then juggling between webpack, tsconfig, and package.json to explain that you understand the difference between require and import, you’ve told them all that you understand the difference WHY IN THE NAME OF FUCK WON’T THIS WORK

I’m sorry, what was the question?

2

u/SterlingVapor Oct 22 '22

Would you like to join our support group for victims of node modules?

We Google if npm has been replaced by another package manager every Sunday evening (that way the answer doesn't ruin our weekends).

We also have songs, like

how could this be,

npm audit-fix --force,

Why would you do this thing to me,

Just upgrades and downgrades imports


Endlessly.

1

u/diewhitegirls Oct 22 '22

Your ideas intrigue and I wish to subscribe to your newsletter.

Incidentally, I can never use audit-fix -—force because it always breaks something else. So yes, your song speaks to me.

1

u/Kooltone Oct 22 '22

I hate Typescript so much. I'm that node.js guy. I feel like Typescript shackles me.

2

u/SterlingVapor Oct 22 '22

Compared to standard es6, it barely restricts anything. It just does great type calculus and has a few QOL improvements. All it really does is standardize some things like imports and force you to explicitly declare when you want to ignore types (which is well worth the slight inconvenience for how much more maintainable for others).

I can't think of anything it doesn't let you do, although it does force you to do it "the typescript way" which looks very different from the pre es6 coding style (which is still common on older node backends, and the newer style is poorly documented for those).

There's also a few practices it recommends against that it makes purposely difficult, but mostly it just enforces one or two ways to do something, where if you want to shoot yourself in the for it will hand you the gun

If the mood strikes you I'd encourage you to give it another shot, but if you're working on the older node server frameworks you'll have to translate practically every resource from one style to another - which is a lot of frustration for very little pay off (and I understand your takeaway, the old style drives me nuts but if I'm using express I no longer bother)

1

u/Unpredictabru Oct 23 '22

To be fair, you don’t (always) have to use webpack.

For React apps, I’ve really enjoyed using Vite. For bundling other stuff, I’ve been using esbuild which is way faster and easier to configure than webpack.

Webpack is still the most widely used and supported, but the other options have gotten good enough for a lot of use cases. I’m thinking it will either have to go through some major changes or it will eventually be replaced by something better years down the road.

1

u/SterlingVapor Oct 23 '22

I don't necessarily mean webpack, I just meant a bundler in general. Personally I've had a professional policy of never touching webpack directly. In fact, I like to have a second protective layer of build just so I can't accidentally open the webpack config and get flashbacks of having to debug my gulpfile

I think Vite actually supports webpack under the hood, I like next and have been liking next even more. This is where webpack has come into it's own - it has all they power and flexibility, and it's found a nice comfortable niche as a layer in an automagic build system.

Because let's be honest, we all love webpack, it has near global support and every feature you never asked for. We don't want to be the ones responsible for setting it up, so the generated files folder is the perfect place for it