6 ms·
I never found a way to sense the differences between OOP flavours (NPI). Are you thinking of ST/Ruby where it's object and method all the way down ?
by agumonkey 12y ago
I never found a way to sense the differences between OOP flavours (NPI). Are you thinking of ST/Ruby where it's object and method all the way down ?
- pjmlp 12y agoThere are many models: - OO like in Smalltalk - OO like in SELF - OO like in BETA - OO like in CLOS - OO like in COM - OO like in Haskell - OO like in C++ - OO like in Eiffel - OO like in Ada - OO like in Sather A few more models might exist.
- seanmcdirmid 12y agoHyperCard and AppleScript. And JavaScript is pretty unique at this point. Scala's OO is also pretty unique with traits and type members.
- pjmlp 12y agoHow unique is JavaScript from SELF? In regards to Scala, I would say OCaml has similar capabilities.
- seanmcdirmid 12y agoScala's capabilities are not really comparable to OCaml, which doesn't even have traits. JavaScript has many influences beyond Self, and is enough of a mishmash even in its original form to have its own point in the list (at best, a not very similar descendant of self).
- deleted 12y ago[deleted]
- pjmlp 12y ago> Scala's capabilities are not really comparable to OCaml, which doesn't even have traits. Yes, it has a bit of everything anyone thought about in FP in it. However you can make use of traits like feature by mixing in modules and objects, while taking advantage of first class modules in OCaml. > JavaScript has many influences beyond Self Sure, but I am unaware of any that make it such a great language.
- seanmcdirmid 12y agoScala's OO features are more like Java's done better. OCaml is this weird object system that is structural most of the time sometimes nominative, and then there is that weird ML module system. Ah...I totally forgot about Moby. [1] JavaScript has been very successful, and got a whole generation of programmers playing around with prototypes without knowing it. [1] http://moby.cs.uchicago.edu http://moby.cs.uchicago.edu
- pjmlp 12y agoThanks for pointing out to Moby. JavaScript's success has less to do with how good the language is, rather sharing the same fate as successful systems programming languages, by being the only gate to the kingdom.
- frowaway001 12y agoI think the biggest difference between Scala and OCaml is that Scala users don't (have to) tell beginners to avoid the OO part at all costs. OO in OCaml feels as if the designers thought "we think OO sucks, so let's implement terrible support for OO to get our point across".
- lpw25 12y agoOCaml's object/class system is actually pretty good. It isn't used very often in OCaml because most of what OO gives you can be more naturally expressed in other parts of the language, but that doesn't mean that it's bad. In particular, classes are still the best mechanism for open recursion in OCaml, and should be used when that is what is required.
- adwn 12y ago> OO like in Haskell Please explain. Are you referring to type classes?
- pjmlp 12y agoYes. Type classes is a way of doing polymorphism in Haskell, the central point of OO.
- adwn 12y agoI thought the central point of OOP was to encapsulate functions ("methods") and the data ("objects") they operate on, thereby providing a way to structure code? That's why it's called "Object Oriented Programming" and not "Polymorphism X Y". Wikipedia at least seems to agree with me.
- pjmlp 12y agoThat is only in the case of OOP as introduced by Smalltalk. For example, OOP with multi-methods, does not imply such encapsulation.
- kasey_junk 12y agoI think one problem that people have when they are talking about object oriented (or FP for that matter), is that there isn't a clear definition around what it means. Most developers agree that it is some mix of encapsulation, polymorphism and inheritance. There is a lot of disagreement about which of those is more important. For me polymorphism is the most important, encapsulation is useful sometimes, and inheritance might be a negative attribute. For you encapsulation.
- agumonkey 12y agoI had that revelation at my college Lab, teacher discussing why OOP was such a beautiful thing, none of them could agree on definition of OOP nor the qualities. FP is smaller and stricter, it's almost formally defined (you have denotational semantics for FP VM for what it's worth).