Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Get a devDuck
Rubber duck debugging has never been so cute! Get your favorite coding language devDuckBuy Now
Search - "mutability"
I just attended a meet up yesterday and I learnt a life lesson by the speaker: "Never share two things is life. Toothbrush and database" 😂2
"In programming mutable state is evil. In future programming we need to avoid mutable state because we will throw cores at our code which will work on it in parallel."
Holy shit. I just watched a video on Rust and I think I am in love.
Tracked mutability, reference counting, guaranteed thread safety, all in a compiled type-safe language with the performance of C++? 😍
Why did I not check this out sooner??11
Strings in most languages:
(☞ﾟヮﾟ)☞ foo: string = "bar"
Strings in rust:
borrowed value does not live long enough
types differ in mutability
cannot assign twice to immutable variable9
Scala's default Seq is MUTABLE. Why the fuck do I want mutability in my functional scala code!?
Now I have to riddle my code with imports to scala.collection.immutable.Seq which looks just ugly.
I just spent an hour debugging a Vuex model due to a fucking error with nested mutability. Wtf...
I need cyclic data structures but algebraic data types are my first love and tying the knot is impossible with the eagerness F# has. The interfaces and classes I abandoned C# for are the ones I am now writing in F#. What a job well done on my part in avoiding mutability :(6
One of my supervisors once said: "A computer without mutable state is just a glorified electrical heater."
Meaning that at some level you'll need some mutability.
A processor/memory unit without mutability is not worth very much, except if you want to build a new one for every clock tick...3
So I get that python's scope/mutability/binding semantics are … idiosyncratic.
But 'a += b' may or may not rebind the name 'a' DEPENDING ON ITS DYNAMIC TYPE.
Yeah, that makes total sense. Much intuit. So design.9