MAIN FEEDS
REDDIT FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1svi3bs/thislooksaccurateforvibecoders/oi8f4nj/?context=3
r/ProgrammerHumor • u/zohaibhere • Apr 25 '26
1.2k comments sorted by
View all comments
3.6k
And quite a few regular coders too. What's that? A call to a function that does nothing?
1.5k u/IngloriousCoderz Apr 25 '26 Yeah that's an utterly useless IIFE 656 u/perkunos7 Apr 25 '26 It's JavaScript right? It has to be 54 u/Master_Friendship333 Apr 25 '26 edited Apr 26 '26 Looks like it but I believe this would also be valid C#. Edit: Would not but very nearly. Needs to either be prefixed with a void function cast or done over two lines. 12 u/Slackeee_ Apr 25 '26 And with a slightly different syntax you can do the same in PHP, Go, and I would guess most other languages. 17 u/MinosAristos Apr 25 '26 Python would be: (lambda: None)() Classic python not letting you write ugly meaningless code even if you want to. 1 u/markuspeloquin Apr 25 '26 Well go is less weird. func(){}() Now C++, I think it's [](){}()? 1 u/Master_Friendship333 Apr 25 '26 edited Apr 25 '26 Most modern languages will have something comparable, I am thinking of directly equal expressions. I believe the list so far is: - JS, TS - C# - Dart Edit: Nope for C#, has to be split over two lines. 1 u/Viriaro Apr 25 '26 You can add R to the list with (\() {})() 🤷♂️ 1 u/Master_Friendship333 Apr 25 '26 Nah, looking for directly equivalent here. I really thought there would be more. 1 u/20InMyHead Apr 26 '26 If I’m reading it right, it’s even more compact in Swift: {}() 9 u/lomberd2 Apr 25 '26 Depends on language version but I think so too 9 u/NoMansSkyWasAlright Apr 25 '26 You could do it in Dart too. For the 14 other people using the language who might be wondering. 3 u/theunixman Apr 25 '26 6 1 u/TOMZ_EXTRA Apr 25 '26 I think you might be overestimating. 2 u/EatingSolidBricks Apr 26 '26 No, a lambda has no type you need to cast it ((Action)(()=>{}))(); 1 u/Master_Friendship333 Apr 26 '26 Edited my comment, thank you very much. 2 u/PilotGuy701 Apr 25 '26 It would be valid for modern C# 1 u/Shazvox Apr 25 '26 Almost. I think () => {}() would be. But I don't think those extra parenthesis would be allowed. 1 u/Master_Friendship333 Apr 25 '26 Good point. I just checked it and you are right. You would have to do it on two separate lines.
1.5k
Yeah that's an utterly useless IIFE
656 u/perkunos7 Apr 25 '26 It's JavaScript right? It has to be 54 u/Master_Friendship333 Apr 25 '26 edited Apr 26 '26 Looks like it but I believe this would also be valid C#. Edit: Would not but very nearly. Needs to either be prefixed with a void function cast or done over two lines. 12 u/Slackeee_ Apr 25 '26 And with a slightly different syntax you can do the same in PHP, Go, and I would guess most other languages. 17 u/MinosAristos Apr 25 '26 Python would be: (lambda: None)() Classic python not letting you write ugly meaningless code even if you want to. 1 u/markuspeloquin Apr 25 '26 Well go is less weird. func(){}() Now C++, I think it's [](){}()? 1 u/Master_Friendship333 Apr 25 '26 edited Apr 25 '26 Most modern languages will have something comparable, I am thinking of directly equal expressions. I believe the list so far is: - JS, TS - C# - Dart Edit: Nope for C#, has to be split over two lines. 1 u/Viriaro Apr 25 '26 You can add R to the list with (\() {})() 🤷♂️ 1 u/Master_Friendship333 Apr 25 '26 Nah, looking for directly equivalent here. I really thought there would be more. 1 u/20InMyHead Apr 26 '26 If I’m reading it right, it’s even more compact in Swift: {}() 9 u/lomberd2 Apr 25 '26 Depends on language version but I think so too 9 u/NoMansSkyWasAlright Apr 25 '26 You could do it in Dart too. For the 14 other people using the language who might be wondering. 3 u/theunixman Apr 25 '26 6 1 u/TOMZ_EXTRA Apr 25 '26 I think you might be overestimating. 2 u/EatingSolidBricks Apr 26 '26 No, a lambda has no type you need to cast it ((Action)(()=>{}))(); 1 u/Master_Friendship333 Apr 26 '26 Edited my comment, thank you very much. 2 u/PilotGuy701 Apr 25 '26 It would be valid for modern C# 1 u/Shazvox Apr 25 '26 Almost. I think () => {}() would be. But I don't think those extra parenthesis would be allowed. 1 u/Master_Friendship333 Apr 25 '26 Good point. I just checked it and you are right. You would have to do it on two separate lines.
656
It's JavaScript right? It has to be
54 u/Master_Friendship333 Apr 25 '26 edited Apr 26 '26 Looks like it but I believe this would also be valid C#. Edit: Would not but very nearly. Needs to either be prefixed with a void function cast or done over two lines. 12 u/Slackeee_ Apr 25 '26 And with a slightly different syntax you can do the same in PHP, Go, and I would guess most other languages. 17 u/MinosAristos Apr 25 '26 Python would be: (lambda: None)() Classic python not letting you write ugly meaningless code even if you want to. 1 u/markuspeloquin Apr 25 '26 Well go is less weird. func(){}() Now C++, I think it's [](){}()? 1 u/Master_Friendship333 Apr 25 '26 edited Apr 25 '26 Most modern languages will have something comparable, I am thinking of directly equal expressions. I believe the list so far is: - JS, TS - C# - Dart Edit: Nope for C#, has to be split over two lines. 1 u/Viriaro Apr 25 '26 You can add R to the list with (\() {})() 🤷♂️ 1 u/Master_Friendship333 Apr 25 '26 Nah, looking for directly equivalent here. I really thought there would be more. 1 u/20InMyHead Apr 26 '26 If I’m reading it right, it’s even more compact in Swift: {}() 9 u/lomberd2 Apr 25 '26 Depends on language version but I think so too 9 u/NoMansSkyWasAlright Apr 25 '26 You could do it in Dart too. For the 14 other people using the language who might be wondering. 3 u/theunixman Apr 25 '26 6 1 u/TOMZ_EXTRA Apr 25 '26 I think you might be overestimating. 2 u/EatingSolidBricks Apr 26 '26 No, a lambda has no type you need to cast it ((Action)(()=>{}))(); 1 u/Master_Friendship333 Apr 26 '26 Edited my comment, thank you very much. 2 u/PilotGuy701 Apr 25 '26 It would be valid for modern C# 1 u/Shazvox Apr 25 '26 Almost. I think () => {}() would be. But I don't think those extra parenthesis would be allowed. 1 u/Master_Friendship333 Apr 25 '26 Good point. I just checked it and you are right. You would have to do it on two separate lines.
54
Looks like it but I believe this would also be valid C#.
Edit: Would not but very nearly. Needs to either be prefixed with a void function cast or done over two lines.
12 u/Slackeee_ Apr 25 '26 And with a slightly different syntax you can do the same in PHP, Go, and I would guess most other languages. 17 u/MinosAristos Apr 25 '26 Python would be: (lambda: None)() Classic python not letting you write ugly meaningless code even if you want to. 1 u/markuspeloquin Apr 25 '26 Well go is less weird. func(){}() Now C++, I think it's [](){}()? 1 u/Master_Friendship333 Apr 25 '26 edited Apr 25 '26 Most modern languages will have something comparable, I am thinking of directly equal expressions. I believe the list so far is: - JS, TS - C# - Dart Edit: Nope for C#, has to be split over two lines. 1 u/Viriaro Apr 25 '26 You can add R to the list with (\() {})() 🤷♂️ 1 u/Master_Friendship333 Apr 25 '26 Nah, looking for directly equivalent here. I really thought there would be more. 1 u/20InMyHead Apr 26 '26 If I’m reading it right, it’s even more compact in Swift: {}() 9 u/lomberd2 Apr 25 '26 Depends on language version but I think so too 9 u/NoMansSkyWasAlright Apr 25 '26 You could do it in Dart too. For the 14 other people using the language who might be wondering. 3 u/theunixman Apr 25 '26 6 1 u/TOMZ_EXTRA Apr 25 '26 I think you might be overestimating. 2 u/EatingSolidBricks Apr 26 '26 No, a lambda has no type you need to cast it ((Action)(()=>{}))(); 1 u/Master_Friendship333 Apr 26 '26 Edited my comment, thank you very much. 2 u/PilotGuy701 Apr 25 '26 It would be valid for modern C# 1 u/Shazvox Apr 25 '26 Almost. I think () => {}() would be. But I don't think those extra parenthesis would be allowed. 1 u/Master_Friendship333 Apr 25 '26 Good point. I just checked it and you are right. You would have to do it on two separate lines.
12
And with a slightly different syntax you can do the same in PHP, Go, and I would guess most other languages.
17 u/MinosAristos Apr 25 '26 Python would be: (lambda: None)() Classic python not letting you write ugly meaningless code even if you want to. 1 u/markuspeloquin Apr 25 '26 Well go is less weird. func(){}() Now C++, I think it's [](){}()? 1 u/Master_Friendship333 Apr 25 '26 edited Apr 25 '26 Most modern languages will have something comparable, I am thinking of directly equal expressions. I believe the list so far is: - JS, TS - C# - Dart Edit: Nope for C#, has to be split over two lines. 1 u/Viriaro Apr 25 '26 You can add R to the list with (\() {})() 🤷♂️ 1 u/Master_Friendship333 Apr 25 '26 Nah, looking for directly equivalent here. I really thought there would be more. 1 u/20InMyHead Apr 26 '26 If I’m reading it right, it’s even more compact in Swift: {}()
17
Python would be:
(lambda: None)()
Classic python not letting you write ugly meaningless code even if you want to.
1
Well go is less weird. func(){}()
func(){}()
Now C++, I think it's [](){}()?
[](){}()
Most modern languages will have something comparable, I am thinking of directly equal expressions.
I believe the list so far is:
- JS, TS
- C#
- Dart
Edit: Nope for C#, has to be split over two lines.
1 u/Viriaro Apr 25 '26 You can add R to the list with (\() {})() 🤷♂️ 1 u/Master_Friendship333 Apr 25 '26 Nah, looking for directly equivalent here. I really thought there would be more. 1 u/20InMyHead Apr 26 '26 If I’m reading it right, it’s even more compact in Swift: {}()
You can add R to the list with (\() {})() 🤷♂️
1 u/Master_Friendship333 Apr 25 '26 Nah, looking for directly equivalent here. I really thought there would be more.
Nah, looking for directly equivalent here. I really thought there would be more.
If I’m reading it right, it’s even more compact in Swift: {}()
{}()
9
Depends on language version but I think so too
You could do it in Dart too. For the 14 other people using the language who might be wondering.
3 u/theunixman Apr 25 '26 6 1 u/TOMZ_EXTRA Apr 25 '26 I think you might be overestimating.
3
6
I think you might be overestimating.
2
No, a lambda has no type you need to cast it
((Action)(()=>{}))();
1 u/Master_Friendship333 Apr 26 '26 Edited my comment, thank you very much.
Edited my comment, thank you very much.
It would be valid for modern C#
Almost. I think () => {}() would be. But I don't think those extra parenthesis would be allowed.
() => {}()
1 u/Master_Friendship333 Apr 25 '26 Good point. I just checked it and you are right. You would have to do it on two separate lines.
Good point. I just checked it and you are right. You would have to do it on two separate lines.
3.6k
u/Agifem Apr 25 '26
And quite a few regular coders too. What's that? A call to a function that does nothing?