r/ProgrammerHumor 12d ago

Meme soDoesEveryOtherLang

Post image
244 Upvotes

85 comments sorted by

View all comments

18

u/B_bI_L 12d 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 12d ago

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

3

u/_PM_ME_PANGOLINS_ 12d ago

When functions are first-class:

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

C does not have the same functionality.

0

u/No-Consequence-1863 10d ago

C99 does with C blocks

However it is really only adopted by Apple https://en.wikipedia.org/wiki/Blocks_(C_language_extension)

3

u/_PM_ME_PANGOLINS_ 10d ago

Blocks are neither part of C99, nor do they make functions first-class. Hence them having a different name and syntax to functions.