Is everything an Object?

I have been reading two books, Object Thinking by David West and Clean Code by Robert C. Martin. In these two great books, the authors mention the phrase: “Everything is an object”. What caught my attention was that both express very different thoughts about this phrase. In his book, David West, afirm that everything is an object and is a prerequisite if you want to be part of the object thinking culture. On the other hand, in his book, Robert C. Martin, says: “Mature programmers know that the idea that everything is an object is a myth. Sometimes you really do want simple data structures with procedures operating on them”.

A bit of background of these two gentlemen. Robert C. Martin has written many books on software development, agile methodologies and object oriented design and has founded Object Mentor, which is a company for mentoring and consulting about object oriented technologies. David West, Ph.D., is a consultant, educator and trainer in object oriented technologies. He founded and directed the Object Lab at the University of St. Thomas and cofounded the original Object Technology User Group (However if you look into, you will find that the guy who wrote the Object Thinking book is the basketball player… funny bug).

I thought, how can this be possible. Such a difference from two very experienced people on the same field.  You might be thinking the same I’m thinking… Object Thinking is a book with examples written in Smalltalk while Clean Code is a book with examples written in Java. In addition to this, based on some research on the web (and this might not be correct) seems that Robert C. Martin’s experience is based on C++/Java. This says a lot about their opinions.  Their minds are modeled differently due to diferent experiences in the past ? Is harder to see everything as an object if you came from Object Oriented languages like C++ ?

Well… just to mention a small thing, the way you create an object in C++ is using the keyword new while in Smalltalk you send the message new to a class (which is also an object… of course, everything is an object). Big difference.

After droping these notes here I continue reading David West’s book and I found this paragraph: “Claiming that there are clear criteria for determining whether software is object oriented is not the same as saying all software should be object oriented. Expecting a device driver implemented with 100 lines of assembly language to reflect full object thinking is probably pointless.”

Right ! It seems we finally have an agreement… and I’m convinced that they will agree if they discuss about this topic. However, even when they might agree on this, they (both) assign to the phrase “everything is an object” very different rate.

If I take both toughts, I would say that mature programmers knows when to apply object oriented thought and when not.

Posted in Object Oriented Programming Tagged with: