Welltoday, I wantedtotalkabout a propertyfactualprogramandcallthemutabilityandhowthemutabilityhelpsaffectconcurrencymodelsandyouradvantagesanddisadvantagesofhavingimmutablestate.
Allof a sudden, whentheywereteachingyoutoprogram, whatyougotwas X isequalto X squaredminusone, andallof a suddentheyintroducedmutabilityintotheholycreationwhereyouhadvalues.
Butthenyouwentinandchangethevalues.
Thisstartedcausingkindofconfusion.
It's wrong.
Thatkindofdefiesthelawsofmathematics.
Thisiswrong.
Youknow, itshouldn't bethatway.
Evenwhenyouprogram, youshouldhave, youknowwhyisequalto X squaredminusone, andthisisyourexampleofanymutablestate.
Soyou'vegot a processrunninginNottinghimandyou'vegotoneprocessrunninginLondonontheneedtosharememorywhereyouplaceyoursharedmemorybecomes a bithardversusimmutablestate, whereyou'vegotNottinghamandyou'vegotLondon.
Butitwillworkonlyifyou'rerunning a friendson a singlemachinesthatwithout a networkandassumingnothinggoeswrongonmany, manyusecaseswhereyouneedthatapproach, especiallythoseusecaseswherecopingmemoryisnotefficientnearwhereyourcomputationshavebeextremelyfast.
Soit's not a questionoffoneoftheother.
It's it's a questionverymuchofusingtherighttoolforthejob.
Statethesairdecidedecisionsyouneedtomakewhenyougoalongwithsomeexamplesofwhereyoumightchoose a mutablestate, mostlikely, I mean, youwoulduse a mutablestatewheresayingthefinancebasewhereyou'redoing a greatmetradingcomputationtimeiscriticalandcomplexaswell, whereifsomethingcrashesandgowrong, justdon't dothetrade.
Yougainspeedfrommulticore, andwithmultipleprogramming, youneed a differentapproach.
Andwhatyoudoisyoustartparalyzingyourcomputations.
So, youknow, desktopswithverysoonof 64 cornerswillbeseeingmachineswith 1,000,000 coreswithinourlifetimes.
Youknowyoustartyoutill I insteadofyourmaking a singleFreddieprogram, whichfirmsextremelyfast, youknow, stopparalyzingyourprogramsonDSOyoustartbreakingupyourcomputationsintomanysmallercomputations.
Andthisnotetheonlywaytodothatisah, concurrentlyprogrammingwithimmutablestatewiththeconcurrenceofmodelbasedon a beautifulstate.
Uh, yeah, thatyouseemtohaveAh, yeah.
Yousee, Beenhomebyyourown.
WasitcalledBusted?
Yes.
Welltoday, I wantedtotalkabout a propertyfactualprogramandcallthemutabilityandhowthemutabilityhelpsaffectconcurrencymodelsandyouradvantagesanddisadvantagesofhavingimmutablestate.
Subtitles and vocabulary
Click the word to look it upClick the word to find further inforamtion about it