Mutable and Immutable

preview_player
Показать описание
mutable vs immutable programming and some popular javascript ui frameworks that support the paradigms.
Рекомендации по теме
Комментарии
Автор

A valid extra on immutable objects is that immutable objects are thread safe. So there`s no chance of you trying to change a value from an object that`s being used on another thread.

sauloAndrioli
Автор

Just started learning functional programming and this is pure gold!!

jozhaoyuansong
Автор

It's also important to use immutable data structures for better performance since they're designed for that

spikygoldfish
Автор

Slight correction. ‘Immutable’ objects can actually reduce memory footprint when used for any information that is unchanging, used more than once and larger than the reference/pointer size of the particular language. As a simple example, consider a string that is used over and over in your code. If it is larger than your reference/pointer size then you only need one copy of that string in memory even if you have, say, thousands of threads using it. A more complex example might be a game rule book, being referenced by multiple players. Basically most information that is conceptually static (independent of representation) can save memory by being treated as immutable and using object pooling. By ‘independent of representation’ what I mean is the difference between numbers and numerals. There is only one number 5 in the entire universe. There are many numeral representations: “5”, “5.0”, “five”, “Five”, “V”, etc.

melmartinez
Автор

Thank you for the video, I noticed students have a bit of difficulty grasping variables. As is it so foreign to basic logic.

daniellaurin
Автор

What's this compiler switch on Svelte? This sounds interesting.

torb-no
Автор

As a Vue programmer, I can say Vue encourages changing the state of ref all the time 😂

Vietnamkid
Автор

Learned 🫡 in one short so much information

vrajpatel