Hacker News new | ask | show | jobs
by recursive 810 days ago
I mean some languages don't.

I have ideas but I don't think I'm getting them through. Most of the problems functional proselytizers have with objects come from inheritance and mutability. Instance methods from classes don't seem to conflict with any of the functional tenets.

As for mutability, I think it's good sometimes. Dates should have been immutable, but Maps are a good fit for mutation. Immutable maps might make sense too sometimes.

But I find it difficult to communicate about any of this when fundamental terminology is used in novel ways.

1 comments

what languages don't use objects to implement non-primitive data structures?

like a binary tree for example

C# allows you to implement some data structures using `struct`s instead of `object`s. Probably not binary tree though.

I honestly still don't understand what you're getting at.

> a data structure in that context is clearly an ordered grouping of objects versus an unordered/loose grouping of objects.

What's an "ordered grouping"? What does "loose" mean? These are not gotchas. I'm trying my best here.

For me, if I were implementing a data structure, I would probably use objects. In fact, I'd probably use a class. I'm not trying to argue that data structures shouldn't be implemented in terms of objects or anything. My point is just that the tonal.js description is kind of nonsensical. Or at least hard to understand.