Комментарии:
Thank you so much for your generous time and effort!
ОтветитьThere is string buffer in Java too I think but also StringBuilder I always use.
Is it that much of an issue? Is there no garbage collection in Python ?
Good to see you have a series of technical terms to clarify.
Great explanation buddy .... Keep up the great work
ОтветитьYou explained this so clearly. Thanks 😊
Ответитьyour explanation was Awesome.
Ответить2022
ОтветитьThis video feels like finding gold among the archives. Though the tools are outdated (python 2) but the concept remains a timeless asset.
ОтветитьGreat video!!
ОтветитьExcellent explanation..thank you
ОтветитьMy main question about this mutable and immutable stuff, is why would you want to have an immutable value over a mutable one?-
ОтветитьImmutable mean, don't use that language.
ОтветитьYou're amazing
ОтветитьThank you so much this was briliantly clear <3
Ответитьthanks!
ОтветитьA very helpful video, thank you!
ОтветитьMany thanks
ОтветитьVery informative, Thanks!
ОтветитьThank you @Corey, this is a wonderful explanation
ОтветитьCan you explain dynamically typed programming
ОтветитьThanks so much for explaining why its important to know which objects are mutable and which are not.
Ответитьthank you, king
ОтветитьExcellent explanation thanks!
Ответитьand I didn't get the answer what I can use in python instead of str (like StringBuilder in java) ?
ОтветитьThanks
ОтветитьGreat explanation, thanks!
Ответитьnice.
ОтветитьGreat Explination 5 articles = 1 Video
ОтветитьThank you for compiling such a beautiful example for explaining the topic.
ОтветитьIs
ОтветитьAdding one more point, immutability makes the data thread safe.
Ответитьthank you very much very very much
ОтветитьBest explanation !!
ОтветитьWhy not make strings mutable?
What can I use in C# to make the string mutable? What about char[], is this mutable? Any consequences of not using string but using char[]?
By far the best explanation of immutability for beginners. Thanks!
ОтветитьI already had a good grasp of mutable and immutable, but I'll admit; your explanation definitely made the distinction clear. Especially with regards to how immutable objects occupy a distinct space of memory and how trying to modify them can create multiple objects in memory. Overall, I learned a lot so thank you very much for posting these. :)
ОтветитьThis was clear, thanks!
Ответитьgreat video
ОтветитьI'm getting a syntax error when I go to print a. wants me to add (). please advise
ОтветитьSummary:
1. 'Mutable' means that an object can be modified, while 'immutable means it can't.
2. We can check whether a data is mutable or not by printing out the id(memory address) of an object after performing an modification to the data type.
3. Example#1. Strings are immutable in Python. But we can still reassign a whole new string value oto a variable that holds a string. However, it is not possible to modify a substring while keeping the memory address the same.
4. Example#2. Lists are mutable in Python. We can change one item of the list while keeping the memory address of the entire list the same.
5. Why should we know this concept? There are 2 reasons
5-1 We can avoid and fix errors caused by modifying an immutable data type.
5-2 We can speed up our programs. Memories are being shifted when performing operations on immutable objects means that it is going to take a lot more amount of time, and making our program slower. By avoiding operations on immutable data and thus the memory shift, we can improve our program speed.
This is the greatest explanation on this top! Can you give more examples when using mutable and immutable variables are good or bad when processing large amounts of data?
ОтветитьWhat’s happening in the employee example? I mean how could I make the list mutable?
ОтветитьThanks for clearing the concepts. -the 1000th liker.
Ответитьbest video to explain the concept . Thank you
ОтветитьThank you Corey for your time and effort. Keep spreading the knowledge.
ОтветитьThe difference between mutable and immutable objects is very nicely explained in the first half of the video. You are absolutely correct that an application which keeps appending value to an immutable object runs slow as it constantly copies the existing value to a new memory space. However, there is no guarantee that by changing it to a mutable object the application will run fast. Using list, it is indeed the case as list in Python is essentially a variable-sized array which has extra spaces to add new elements. So its operation to append is "amortized" O(1). But if one uses numpy array, then it is essentially the same as using string which copies the existing elements over to a new memory location whenever new elements are appended (i.e. O(N) operation).
ОтветитьVery well explained...!
ОтветитьSuper helpful. Thanks. UK CS teacher.
ОтветитьWhen'd the garbage collector release the previous addresses when concatenating the string(the example with the html list)?
ОтветитьDear Corey,
May I please have your mail id, so that I may ask a few things.
Thank You