News for hackers. Stuff that matters.
Re:Ask HN: What is the state of the art in OOP? by CyberFonic on Wednesday June 29, 2011 @04:25AM (#2708767)
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.

Re:Ask HN: What is the state of the art in OOP? by redthrowaway on Wednesday June 29, 2011 @05:01AM (#2708818)
I 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.
Re:Ask HN: What is the state of the art in OOP? by beza1e1 on Wednesday June 29, 2011 @05:28AM (#2708861)
What 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.

Re:Ask HN: What is the state of the art in OOP? by cies on Wednesday June 29, 2011 @05:53AM (#2708905)
i 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 :)

Re:Ask HN: What is the state of the art in OOP? by CyberFonic on Thursday June 30, 2011 @08:26PM (#2716360)
I think that the canonical OOP experience is with Smalltalk, e.g. Pharo which is far nicer IMHO than Squeak.
Re:Ask HN: What is the state of the art in OOP? by eLobato on Wednesday June 29, 2011 @05:29AM (#2708864)
That'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.