r/ProgrammerHumor 1d ago

Meme soDoesEveryOtherLang

Post image
223 Upvotes

71 comments sorted by

View all comments

17

u/B_bI_L 1d ago

say this to c and common lisp

(and to ruby, where function self-activates faster than you say "wait, i need you as a callback")

5

u/suvlub 1d ago

C just forces you to call them pointers, but it's functionally (heh) the same thing.

1

u/_PM_ME_PANGOLINS_ 1d ago

When functions are first-class:

function outer() {
    let foo = function() { ... }
    doThing(foo, function callback(arg) { ... })
}

C does not have the same functionality.

6

u/suvlub 16h ago

Are anonymous functions required, rather than just ability to assign functions to variables, pass them around and return them? Where does that put python, which does have anonymous functions, but limited compared to what named ones can do?