Re: docs (OE,Phix) // ? benefits of OOP but simpler
- Posted by irv Dec 16, 2016
- 1642 views
My working hypothesis for today is:
OOP languages achieve the benefits of Euphoria, at the cost of added complexity and some extra coding.
I'm beginning to suspect that the best (only) good part of oop is dot notation.
ha! Well said. X)
I wonder if Euphoria could use a dot instead of colon for namespace referencing. Then we could call it "object* referencing" and package it as OOP-lite.
datetime right_now = datetime:now()
becomes
datetime right_now = datetime.now()
*Would obviously need to differentiate between the built-in object variable.
I'm not sure that's a good idea. It gives the appearance of being 'oop' without actually having any of the features of oop.
Now, if you could write:
Date thanksgiving Date christmas Calendar cal thanksgiving.month = 11 christmas.month = 12 christmas.day = 25 cal.date = christmas
That would be more "oop-ish". Unfortunately Euphoria prevents the use of the dot (or any other character) in this fashion, otherwise, you could, via the type() function, implement most of the features of oop, I think.