Can immutable be a memory hog?

Posted by ciscoheat on Stack Overflow See other posts from Stack Overflow or by ciscoheat
Published on 2010-03-26T23:18:51Z Indexed on 2010/03/26 23:23 UTC
Read the original article Hit count: 441

Let's say we have a memory-intensive class like an Image, with chainable methods like Resize() and ConvertTo().

If this class is immutable, won't it take a huge amount of memory when I start doing things like i.Resize(500, 800).Rotate(90).ConvertTo(Gif), compared to a mutable one which modifies itself? How to handle a situation like this in a functional language?

© Stack Overflow or respective owner

Related posts about immutable

Related posts about functional-programming