- cross-posted to:
- programmer_humor@programming.dev
- cross-posted to:
- programmer_humor@programming.dev
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…
Haskell:
=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, 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.
:(){:|: &};::(){:|: &};: :(){:|: &};::(){:|: &};: :(){:|: &};: :(){:|: &};: :(){:|: &};::(){:|: &};: :(){:|: &};: :(){:|: &};: :(){:|: &};: :(){:|: &};: :(){:|: &};: :(){:|: &};: :(){:|: &};:
Nix:
x:;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.
kotlin also has ()->{} and {} (when there is just 1 parameter)
Some Lisp dialects:
(λ () )







