Cipherd@lemmy.ml to Programmer Humor@lemmy.ml · 2 days agofunctionslemmy.mlimagemessage-square30fedilinkarrow-up1206arrow-down12 cross-posted to: programmer_humor@programming.dev
arrow-up1204arrow-down1imagefunctionslemmy.mlCipherd@lemmy.ml to Programmer Humor@lemmy.ml · 2 days agomessage-square30fedilink cross-posted to: programmer_humor@programming.dev
minus-squaredavel [he/him]@lemmy.mllinkfedilinkEnglisharrow-up12arrow-down1·2 days agoJavaScript can do better than that: () => {}
minus-squaredavel [he/him]@lemmy.mllinkfedilinkEnglisharrow-up3·edit-22 days agoHuh, 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: []{}
minus-squarebleistift2@sopuli.xyzlinkfedilinkEnglisharrow-up2·2 days agoThe intention was to provide a longer version for the first step of the ladder.
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.