Hacker News new | past | comments | ask | show | jobs | submit login

He mentions that in Smalltalk, everything is an object, "Except variables. And packages. And primitives. And numbers and classes are also not really objects, and so on." This statement isn't quite correct; for example, both classes and numbers are objects in Smalltalk, as are all the primitive types such as booleans. In fact, Smalltalk's if-then statement is achieved by sending boolean objects the ifTrue:ifFalse: message with code blocks as arguments, e.g.

    (5 < 6) ifTrue: ['yes'] ifFalse: ['no']
which returns the string 'yes' if the 5 object returns true after being sent the < message with 6 as an argument.

The problem—as Paul Graham pointed out—is one of terminology. "Object oriented" means different things to different people, and what would be appropriate for an all-you-can-do-is-send-a-message system like Smalltalk is not going to be appropriate in a weakly statically typed, early-binding system like Java, which makes reasoning about all of OOP at the same time a difficult proposition.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: