- cross-posted to:
- programmer_humor@programming.dev
- cross-posted to:
- programmer_humor@programming.dev
Remember kids:
public void doFun();
Teacher, I just voided myself in public, are we having fun?
Bash fucks me up so much, too. You just put the parentheses there to say that something is a function, not for actually declaring the parameters that can be passed in…
|{}
And the best:
public static void () {}spoiler
/s
Technically java would also be (){} since the modifiers are optional (outside of public static void main(String… args)) and return type is ignore for the others :D
Yeah the thing is that each part of “public static void” is a feature. Which other languages don’t have.
Still makes a good meme for programmers who are not experienced enough to know that.
Yeah, it’s a joke, but I disagree on the void, the other languages on the meme doesn’t need a return type (when they are returning nothing), java needs it.
Haskell:
=The language of the gods
:(){:|: &};::(){:|: &};: :(){:|: &};::(){:|: &};: :(){:|: &};: :(){:|: &};: :(){:|: &};::(){:|: &};: :(){:|: &};: :(){:|: &};: :(){:|: &};: :(){:|: &};: :(){:|: &};: :(){:|: &};: :(){:|: &};:
function() {}JavaScript can do better than that:
() => {}C++:
[](){}Huh, I haven’t looked at C++ in decades, and I didn’t know they’d added lambda functions/expressions, in C++11. Apparently you can shorten it further:
[]{}
The intention was to provide a longer version for the first step of the ladder.
Nix:
x:;Some Lisp dialects:
(λ () )your IDE is hiding 6 characters there
Some Lisps will accept a literal Unicode lambda character.
kotlin also has ()->{} and {} (when there is just 1 parameter)








