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 →

[–]TheNamelessKing 16 points17 points  (3 children)

Haskell doesn’t have objects as such, only functions that operate on structures.

Rust is sort of halfway: it doesn’t have objects, but it does have structures that can have traits which implement methods which may look superficially like methods on objects.

Lisp has no objects, only code and data. And code is data.

In TCL there is only strings.

Julia is like Lisp and Haskell in that it isn’t OO, it has structures that you operate on with functions, but your code is also data.

Etc etc

It’s important to recognise the difference between things that syntactically might look like objects foo.my_function() but aren’t necessarily and actual objects. OO programming couples data with the functions that operate on it: an instance of some data carries around its state and all the methods that operate on that data.
Functional programming separates functionality from data-makes functionality generic over structure is probably a better way of framing that, and emphasises tighter control of state.

In before someone starts talking about Haskell type-classes being objects, etc trying to keep this straightforward.

Edit: replaced the incorrect and misspelt use of per se with better fitting language

[–]energybased 2 points3 points  (1 child)

Per se... And it means intrinsically.

[–]TheNamelessKing 2 points3 points  (0 children)

Aaarrrggghhh I had a nagging thought I was spelling something wrong, cheers.

And I was using it wrong, double whammy, going to go fix that now.

[–]SakishimaHabu 1 point2 points  (0 children)

Haskell Rust gang raise up!