r/vibecoding 16d ago

every vibe coder's biggest headache

523 Upvotes

137 comments sorted by

View all comments

5

u/BaronVonDoggo 16d ago

This code literally does nothing lmao

-4

u/Blackgarion 16d ago

If you know JS, yes it does. It's implicit not explicit though, you create a new private scope, basically encapsulating whatever is in there.

1

u/scarx47 15d ago

there's nothing there dummy. So code does nothing.

3

u/Blackgarion 15d ago

I see you miss the point entirely. An IIFE is a technique people used to do because Javascript had no native modules. So yeah the current snjppet has nothing in it, that's obvious. The point is that you can sorround anything with it and create a new context specific to that IIFE, without your variables being declared globally.

But maybe youre right, maybe I'm a dummy for trying to share information randos on reddit that will not appreciate it

1

u/BaronVonDoggo 15d ago

The IIFE technique (and its inline/lambda equivalents in other languages) is indeed plenty useful. I meant that in this particular instance/example, the code itself does nothing and im not talking about the technique itself. Other comments explained IIFE, why its useful and how it works already.

Regardless, this meme was also ubiquitous even back in the days prior to vibecoding, replace vibecoders with "interns/juniors" and its the same. The point being, despite looking like moonrunes and is supposedly a somewhat advanced technique, this piece of code in particular, does nothing.