Processing classes as first class objects

I read the GoF book and at the beginning of the prototype section I read this:

This advantage primarily applies to languages ​​such as C ++ that do not treat classes as first-class objects.

I have never used C ++, but I have a pretty good understanding of OO programming, but it really doesn't make any sense to me. Can anyone there dwell on this in detail (I used \ use: C, Python, Java, SQL, if that helps).

+5
source share
6 answers

, , , ( ) , .

Java. . java.lang.Class.

+8

, heres :

" . Factory (107) , . , Factory . , . , ++, . , , Smalltalk C, , . ." - GoF, . 120.

,

, // ++. , GoF, // . /you/./I/, , .

, . , , ++ , , . IOW, Java //.

+7

Java , java.lang.Class, , .. . ++ ; ( ) . RTTI ( ), - , , , .

+4

python, . , .. new_instance() , .

class Klass1:
    pass

class Klass2:
    pass

def new_instance(k):
    return k()

instance_k1 = new_instance(Klass1)
instance_k2 = new_instance(Klass2)

print type(instance_k1), instance_k1.__class__
print type(instance_k2), instance_k2.__class__
+2

# Java- , .NET Java reflection, , ( .NET, Java, , -, ).

, , *. , . ++ , , ++ **.

...

* , , " " . , - .

** . , - , . MFC .

+2

++ , , , , , ( , , ). , .

+2

All Articles