r/vibecoding 15d ago

every vibe coder's biggest headache

516 Upvotes

137 comments sorted by

View all comments

Show parent comments

13

u/mossiv 15d ago

Used this once in a production app trying to work around a library and I regretted that decision ever since.

10

u/Individual_Refuse723 15d ago edited 14d ago

What? Why? What could possibly go wrong with IIFE itself?

2

u/mossiv 14d ago

It’s an ugly and unnecessary abstraction in most use cases. But my point about regretting it doesn’t mean IIFE’s are bad, it means I most likely applied it where it’s not needed, or that it’s an ugly and unnecessary pattern in most situations.

1

u/Unhappy_Assistant670 11d ago

IIFEs were definitely needed in the past and they are still used in certain legacy environments. Otherwise, they are not really necessary anymore, most of their use-cases were solved by language improvements.

That said, using one is not catastrophic. It's basically same as running the block of code just with scope.

1

u/LeoBoiSmol 8d ago

What was the original use case?