hasty_pudding
Joined 2 years ago
Joined 2 years ago
like a binary tree for example
I guess maybe low level c and assembly where you implement everything as bits in physical memory?
the point is obvious.
Being that every single language on Earth uses objects for non-primitive data structures that should be inferrable to a reasonable person.
a data structure in that context is clearly an ordered grouping of objects versus an unordered/loose grouping of objects.
You could have a completely stateless class/object that would manipulate those nodes and add them and remove them from the data structure.
The functions are kept pure and the data is kept pure.
As opposed to an object oriented programming style in which data and functions share the same object and create bug ridden state machines thats not as easy to reason about.
Some further explanation about this:
https://www.goodreads.com/quotes/702062-immutable-objects-ar...
a semi-nuanced discussion:
https://www.reddit.com/r/scala/comments/ejwsp1/is_mutability...
you can just Google mutable state to find more info.
separating your data structures and functions in many cases will make your code cleaner and more bug free.
God i love to see this
Thanks for posting another side of this.
What you're saying makes a lot of sense.