merari42@lemmy.world to Programmer Humor@programming.dev · 10 days agoThe state should be purely passed through function inputs and outputslemmy.worldimagemessage-square31fedilinkarrow-up17arrow-down10
arrow-up17arrow-down1imageThe state should be purely passed through function inputs and outputslemmy.worldmerari42@lemmy.world to Programmer Humor@programming.dev · 10 days agomessage-square31fedilink
minus-squareZagorath@aussie.zonelinkfedilinkarrow-up0·10 days agoNothing wrong with classes in functional programming though. Just return a new instance of the class from your method, rather than mutating an existing instance.
minus-squarexmunk@sh.itjust.workslinkfedilinkarrow-up2·9 days agoJavascript: I heard you like mutating class data so I’m mutating the data you can put in your class data, dawg.
minus-squareAmon@lemmy.worldlinkfedilinkarrow-up1·9 days agoClasses are just another way to define an object. Heck even Lisp has objects!
Nothing wrong with classes in functional programming though. Just return a new instance of the class from your method, rather than mutating an existing instance.
Javascript:
I heard you like mutating class data so I’m mutating the data you can put in your class data, dawg.
Classes are just another way to define an object. Heck even Lisp has objects!