4 ms·
Classless OOP [pdf]
- halosghost 12y agoAn interesting idea, though I actually feel like Lua implements much of this concept already. Admittedly, there are plenty of differences, but Lua has no `class` or `new` keywords, but you can implement Object Orientation very simply with Tables. Actually, that's one of many reasons I find Lua to be so elegant; but perhaps that's just me :P
- stormbrew 12y agoWhile the slideshow seems aimed at creating something new, I think (hope?) that's more of a rhetorical device, because prototype-based OO goes back to Self, and even the language that introduced classes (Smalltalk) resembles this more strongly than the more common class-based OO languages (C++ and Java). Lua is not really unique in following the same concept. Javascript and Python are also both based on the hash-with-blessed-class-member prototype-driven approach, even though they also both build class systems on top of it (JS more recently than Python).
- seanmcdirmid 12y agoThese are course notes for a grad-level PL class. I've seen something like this before...maybe 10 years ago. I don't think the encoding is particularly novel, just part of the material being taught.
- protomyth 12y agoReading over the notes, it looks like NewtonScript (and probably Self) also implements much of the concept. NewtonScript actually does 2 parent pointers and is well worth a look even if the parent platform long ago died.
- jameskilton 12y agoIsn't this exactly what the Self language is? http://en.wikipedia.org/wiki/Self_%28programming_language%29 http://en.wikipedia.org/wiki/Self_%28programming_language%29
- platz 12y agoor IO http://iolanguage.org/ http://iolanguage.org/ http://iolanguage.org/scm/io/docs/IoGuide.html#Objects-Overview http://iolanguage.org/scm/io/docs/IoGuide.html#Objects-Overv...
- seanmcdirmid 12y agoNot really, this seems more like an classless OO encoding in functional programming. Related but not the same.
- TazeTSchnitzel 12y agoPrototypes are only one approach to inheritance, of course! A fun other one (which Crockford quite likes) is Parasitic Inheritance, where Bar() is a function that takes the object Foo() returns and augments it.
- hayksaakian 12y agoJavaScript is an example of "class"-less OOP (at least before they actually added classes.)
- mewwts 12y agoES6 added the class keyword, but that doesn't mean that there are actual classes in JavaScript. I can highly recommend this book if you'd like to dive deeper, I just finished reading it: https://github.com/getify/You-Dont-Know-JS/tree/master/this%20%26%20object%20prototypes https://github.com/getify/You-Dont-Know-JS/tree/master/this%...
- zalmoxes 12y agoGo is an example of a classless OOP language. Here's a good example http://www.goinggo.net/2015/03/object-oriented-programming-mechanics.html http://www.goinggo.net/2015/03/object-oriented-programming-m...
- hacknat 12y agoYeah, it's surprising too. I was programming for a good week in Go before I discovered anonymous fields and how they worked. They really need to do a better job of explaining that they have a form of inheritance in the language that allows structs to exhibit polymorphism beyond being an interface as it isn't really explicitly stated anywhere in the docs. The section in the FAQ that answers if Go is an OO language never makes explicit reference to them, and in the language spec they don't get their own section.
- ExpiredLink 12y agoDoes he define what an 'object' is? This is anything but trivial.