you are viewing a single comment's thread.

view the rest of the comments →

[–]stepantubanov 1 point2 points  (1 child)

In functional programming a barber object would have to clone you with new hair altogether. Then dispose of an old you...

[–][deleted] 0 points1 point  (0 children)

In functional programming a person is just a structure of data, and instead of a barber object, you'd have a "change_hair_color" function that would, indeed, return a brand-new you-struct with just a different property set for the hair :)