Cipherd@lemmy.ml to Programmer Humor@lemmy.ml · 5 days agofunctionslemmy.mlimagemessage-square37linkfedilinkarrow-up1295arrow-down14 cross-posted to: [email protected]
arrow-up1291arrow-down1imagefunctionslemmy.mlCipherd@lemmy.ml to Programmer Humor@lemmy.ml · 5 days agomessage-square37linkfedilink cross-posted to: [email protected]
minus-squaredavel@lemmy.mllinkfedilinkEnglisharrow-up13arrow-down1·5 days agoJavaScript can do better than that: () => {}
minus-squaredavel@lemmy.mllinkfedilinkEnglisharrow-up4·5 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·5 days agoThe intention was to provide a longer version for the first step of the ladder.
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.