4 ms·
I think OOP has become so mainstream as to become invisible. For example, HTML5, DOM, SVG, etc are OO (although defined in terms of interfaces). When you writ
by CyberFonic 15y ago
I think OOP has become so mainstream as to become invisible. For example, HTML5, DOM, SVG, etc are OO (although defined in terms of interfaces). When you write JS code, you are mostly manipulating objects and relationships between objects.
You mention Python, it allows you to write both OOP and FP code. Functions can invoke methods on objects.
As for "state of the art" I'm learning more from reading open source project code than by reading books. I find that different languages have evolved different styles / patterns.
- redthrowaway 15y agoI find Python's OOPiness has a tacked-on feel, with copy.copy and self.x taking the place of more rational syntax. I've only looked at Ruby briefly, but it seems to be both lispier and oopier than python in an intriguing way. We'll see how I feel after using it in the real world for a bit.
- beza1e1 15y agoWhat is tacked-on about this? copy.copy: Who don't you "from copy import copy"? self.x: It explicitly distuingishes between local variable and field access, which is the Right Thing in my opinion. I do not understand, what this has to do with OOP at all.
- cies 15y agoi get this tacked-on-OO-feeling when i do: def something(self, ...) # inside a class or len(str) # instead of str.len (i know i can do str.__len__) not very convincing reasons right? to me python has a strong foundation in OO. you want a tacked-on-OO-feeling? try php and/or perl :)
- CyberFonic 15y agoI think that the canonical OOP experience is with Smalltalk, e.g. Pharo which is far nicer IMHO than Squeak.
- eLobato 15y agoThat's a bit misleading comment IMO. All the things that you mentioned, like JS, are OO, true. But I wouldn't say that they represent the state of the art of this paradigm at all, basically for two reasons. The first one is that pretty much everyone uses these languages in a more or less "procedural programming" manner. I cannot find many examples of people taking advantage of what objects, inheritance and polymorphism are. The second reason deals pretty much with this last statement. Even though people are not using properly the advantages of OOP in this kind of languages (myself included), most of the developers that I have contact with are using properly and taking advantage of the variety of characteristics of OOP in their Java, C#, programs. No matter if they are web projects or not. Nowadays I am trying to push myself harder to use OOP when programming in Ruby but it doesn't feel as natural as when I write code in Java.