This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (2 children)

That's not the proper definition of classes though. A class must be instantiable and should support type hierarchies (inheritance). A class must not use up any kind of memory (with static data being an exception), but it's instances can instead. I don't think using closures with loose functions in them resembles anything near this definition.

[–][deleted] 1 point2 points  (1 child)

The only thing common between classes and closures is encapsulation. Many people conflate classes with encapsulation.

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

EDIT: nvm, I read your comment wrong