http://www.perlmonks.org?node_id=318454


in reply to Re: The world is not object oriented
in thread The world is not object oriented

A famous philosopher believed that discussion progressed by starting with a thesis, confronting it with its antithesis. And then they mix into a synthesis. As much as I don't care for that philosopher's political philosophy, there is quite a bit of truth to the concept that the best way to expose people to diversity is to expose them to conflicting views. And interesting discussions frequently start with a significant disagreement, carefully explored.

Let's take your example a little further. Time is a class. A Time object has properties like "year", "month", "day", "hour", etc. What is the relationship then between Time and TimeZone? Does Time only have an hour in the context of a TimeZone? Or is the same split second in London a different Time than that split second in Los Angeles?

Going further, time is a more complex thing than your model holds. For a layman, this NY Times article doesn't do a bad job of explaining why. Attempting to produce a Time class that models the intricities of, say, metrics and varying versions of local time is very hard. Using such a beast is even more insane. Now for 99.9999% of the code out there (maybe more, maybe fewer 9's) the complications don't matter and it makes perfect sense to have a naive concept of Time. But for the fraction of a percent that does, you have a lot of fun waiting. An example in that fraction of a percent is the code used internally by the GPS satellites. (Did you know that GPS not only has to take into account corrections from Einstein's Special theory of Relativity, but also the general? Yup, the satellites are able to detect that their clocks run faster due to being farther out of the Earth's gravitational well!)

On misuse of the tool of OO design, my statement is not that I misuse the tool. It is that the tool simply has natural limitations. Typically those limitations don't prevent us from being able to do what we want (though they may complicate it). Rarely they do. Much more often, people who haven't yet learned a good balance between theory and practice create theoretical but impractical designs.

And finally I admit that if you limit your perceptions, you can shoehorn everything into an OO framework. I've seen people who seem to do this. I have no way to know whether you do - all that I can judge you by is what you write. However your post staked out an extreme position, and I certainly can critique the position that I understood your post to be making. This I have tried to do.

  • Comment on Re: Re: The world is not object oriented

Replies are listed 'Best First'.
Re: Re: Re: The world is not object oriented
by seattlejohn (Deacon) on Jan 05, 2004 at 03:01 UTC
    Regarding the difficulty of providing a Time class that accurately captures all the real-world complexity (and at the risk of dragging this OT): Isn't that precisely the goal of the Perl DateTime Project?

    I haven't had occasion to use the modules they've produced yet, but what I've read looks promising.

            $perlmonks{seattlejohn} = 'John Clyman';

      That seems to be trying to encapsulate the complexity of human representations of time.

      That doesn't catch the sophistications to the physical descriptions of time added by special relativity, general relativity, or quantum mechanics. (It is rare in normal programming to encounters those, so the omission makes a lot of sense.)