1. docs (OE,Phix) // ? benefits of OOP but simpler

There is description from long ago:

Eu|OE|Phix: "achieves many of the benefits of object-oriented programming, yet in a much simpler way."

I need a deeper understanding of what this means. How would you explain this to a person who does OOP programming?

_tom

new topic     » topic index » view message » categorize

2. Re: docs (OE,Phix) // ? benefits of OOP but simpler

How about "By doing away with it altogether?"

Chris

new topic     » goto parent     » topic index » view message » categorize

3. Re: docs (OE,Phix) // ? benefits of OOP but simpler

_tom said...

There is description from long ago:

Eu|OE|Phix: "achieves many of the benefits of object-oriented programming, yet in a much simpler way."

I need a deeper understanding of what this means. How would you explain this to a person who does OOP programming?

_tom

I think this was one of Rob Craig's advertising statements that Jeremy forgot to delete. blink

There have been some attempts by others to justify this in the past, however. Perhaps they will give you some ideas.

http://openeuphoria.org/forum/m/56324.wc

http://openeuphoria.org/forum/m/14853.wc

new topic     » goto parent     » topic index » view message » categorize

4. Re: docs (OE,Phix) // ? benefits of OOP but simpler

I removed this OOP reference from the HOPL wiki pages.

Pete: you have the same statement in your "Introduction" page of the Phix documentation.

_tom

new topic     » goto parent     » topic index » view message » categorize

5. Re: docs (OE,Phix) // ? benefits of OOP but simpler

_tom said...

I removed this OOP reference from the HOPL wiki pages.

Pete: you have the same statement in your "Introduction" page of the Phix documentation.

I'm not convinced it is an entirely bad thing to say. Anyway, regarding the original question:

Off the top of my head I might say:

Object orientation is typically described as encapsulation, inheritance, and polymorphism.

In Phix, encapsulation is achieved simply by placing code in a separate file. Unless you explicitly declare identifiers as global, they are invisible to the outside world, and of course you can modify anything private at any time and nothing else will ever know.

Phix programs are naturally polymorphic. For instance the standard sort() can accept integers, floating points, strings, and/or nested sequences, or any mix of them, without any trouble. In particular you simply do not need umpteen versions of a routine, one that accepts an integer, one a float, yet another one that takes a double, ad nauseum. And for the same reason, there simply is no need for generics, because Phix programs are naturally generic. Try making a list of mixed floats and strings in other programming languages and you will regret it.

In recent years, the latest catchphrase is "favour composition over inheritance", so the lack of any form of inheritance in Phix could even be viewed as an asset, and the ability to store anything at all as an element of a sequence means composition is a given, though it would need to be an index of some kind, rather than the whole thing.

It is fair to say that Phix does not provide any automated form of dynamic despatch, but it is not especially difficult to maintain a table of routine_ids - no more than, say, to declare all the available virtual methods in a separate header file. If you are a strong advocate of object orientated methodology, you may baulk at replacing thing.method() with having to select and include an oo framework and calling vproc(thing,"method",{}). More can and should be done on that front - as much as I may personally believe that it is all hogwash and snake oil, it is in fact a reasonable paradigm and a blanket refusal to add even "oo-lite" features into the core language is not exactly helpful. Note however that it is highly unlikely that Phix will ever enforce oo like some other programming languages do.

Ultimately, of course, if you are already married to the "one true way", whatever that may be in your opinion, no other language will replace the one you already love.

The truth is not that Phix can do all those wacky inside-out things that oop needs, but that it simply does not need them.

Disclaimer: the above may sound too apologetic over the lack of oo features, and we probably don't want that.
Maybe the best strategy for Phix/OE is to catch those who fall off the oo bandwagon and offer them something simpler but just as capable?
Maybe we should stop looking at the grass on the other side and focus on adding more and more capabilities here.

Pete

new topic     » goto parent     » topic index » view message » categorize

6. Re: docs (OE,Phix) // ? benefits of OOP but simpler

Long ago someone complained that Euphoria used "object" everywhere but there was no OOP to be found.

What if?

  1. OE had dot notation
  2. OE had a trivial way use identifiers to index a sequence



We do have:

  1. the pre-processor, which would start working if all routines had arguments arranged in a consistent and sensible fashion.
  2. the idea of using enum to create constants for indexing fails because I want to use "x" in different ways for different sequences



That suggests that Euphoria with some OOP eye-candy is all that is needed to become a hipster programming language.

Pure OOP languages say that all objects are derived one one fundamental object; you then end up with many objects. I am tempted to say that Euphoria has one object; you do not need many objects.

The fancy features of OOP add more typing and complexity--Euphoria gets the advantage here.

The trick is how to describe the situation to someone who has years of conditioning in the OOP way.

As it stands "benefits of OOP but simpler" is too glib. I just have not yet found a concise way to make the case for Euphoria vs OOP.

_tom

new topic     » goto parent     » topic index » view message » categorize

7. Re: docs (OE,Phix) // ? benefits of OOP but simpler

_tom said...

I just have not yet found a concise way to make the case for Euphoria vs OOP.

I wouldn't worry about that.
No-one has yet found a concise way to make the case for OOP.
(It takes years and sometimes decades of brainwashing blink)

new topic     » goto parent     » topic index » view message » categorize

8. Re: docs (OE,Phix) // ? benefits of OOP but simpler

_tom said...

We do have:

  1. the pre-processor, which would start working if all routines had arguments arranged in a consistent and sensible fashion.

I've said it before and I'll say it again: http://openeuphoria.org/forum/124823.wc#124823

ghaberek said...

On that note, I'd also like to point out that Euphoria's preprocessor system leaves a lot to be desired. Without a reliable means of chewing up the language and spitting it back out, every preprocessor author is left to his own devices. The barrier-of-entry on implementing new preprocessor-defined features shouldn't be so high. There's got to be a more formalized way to process the language.

-Greg

new topic     » goto parent     » topic index » view message » categorize

9. Re: docs (OE,Phix) // ? benefits of OOP but simpler

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.

_tom

new topic     » goto parent     » topic index » view message » categorize

10. Re: docs (OE,Phix) // ? benefits of OOP but simpler

petelomax said...

Maybe we should stop looking at the grass on the other side and focus on adding more and more capabilities here.

Every time I go out and have to use another language for programming, I love coming back to Euphoria. So easy to program. So fast to execute. The libraries are comprehensive (for my needs, so far).

The only thing not going for it is an IDE.

I'm slowly migrating all my in-house code to Xojo. Xojo is generally cross-platform (including mobile), and has a pretty nice IDE. I'm still using Euphoria on my server and in a few other places, but for developing apps, it's just easier to use Xojo.

I think if Euphoria could generate cross-platform code and there was a Euphoria+wxWidgets IDE, it could really compete. But that will never happen, which is unfortunate. But, that's life!

new topic     » goto parent     » topic index » view message » categorize

11. Re: docs (OE,Phix) // ? benefits of OOP but simpler

_tom said...

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.

new topic     » goto parent     » topic index » view message » categorize

12. Re: docs (OE,Phix) // ? benefits of OOP but simpler

euphoric said...
_tom said...

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.

new topic     » goto parent     » topic index » view message » categorize

13. Re: docs (OE,Phix) // ? benefits of OOP but simpler

One other thing I want to say is that (IMO) object orientation was devised in an era preceding such concepts as unit testing, refactoring, and fail fast development, and also largely (totally?) driven by an absolute fear and terror of introducing bugs.

To be fair, between the 60s and early 90s, covering oo from inception to widespread adoption, debugging was often a fairly nasty business.1

It seems that OpenEuphoria/Phix have, quite naturally and intuitively, the encapsulation necessary to prevent a simple edit from breaking some other completely unrelated part of the system, but perhaps more importantly, addressed the core problem: make debugging easier2, rather than jump though all the convoluted hoops of the object orientated paradigm in the vain hope of avoiding it altogether.

In contrast to the dreaded core dump, OpenEuphoria/Phix programs produce a human-readable ex.err file that should contain everything needed (except constants, which are unnecessary 99 out of 100 times, but would not be difficult to add).
Several more modern languages (but not C++) have admittedly greatly improved on the core dump, some even (gasp) show source code line numbers3.

Obviously adding bugs is in no sense a good idea, but it should not be so horrific, and so costly, that you not only impose draconian limits4 on what can be edited, but you force all programmers to completely change their way of thinking.

Pete

1 I could certainly tell you tales of inter-module jumps and variable updates in MicroCobol, and the time(days) they took to fix.
2 As a compiler developer, I see a pretty sharp divide between debugging the low-level backend (in assembly), and normal user code (in Phix).
3 Source code line numbers in runtime errors would have been very rare indeed, at the time of the initial widespread adoption of OOP.
4 In a roundabout manner by enforcing an object orientated paradigm

new topic     » goto parent     » topic index » view message » categorize

14. Re: docs (OE,Phix) // ? benefits of OOP but simpler

My latest promo for Euphoria

_tom



Euphoria is Programming

Wanted, a way to create computer applications with the least amount of learning, work, and fuss. The solution is programming Euphoria.

Programming becomes fun when it is Friendly, Flexible, and Fast. The only languages that can do this are OpenEuphoria and Phix; both are based on the original Euphoria language written by Robert Craig.

A Friendly language is:

  • small ... so you have less to learn
  • plain English ... saving you from brackets, strange punctuation, and invisible syntax rules
  • uniform ... everything works in the same coherent way
  • obvious ... no surprise variable creation or surprise changes in values
  • helpful ... error messages that are actually meaningful
  • aids ... debugging, tracing, profiling
  • polymorphic ... naturally generic
  • serious ... dynamic data storage, low level machine access, run-time checks
  • easy ... atoms and sequences do it all
    ... Euphoria

A Flexible language is:

  • interpreted ... to make programming quicker
  • compiled ... to make applications fast and easy to distribute
  • multiplatform ... Windows Linux OSX
    ... Euphoria

A Fast language is:

  • speed ... no-one complains about being the fastest
    ... Euphoria

Euphoria is a higher level than many conventional languages. That means the fundamental viewpoint of data|actions is smaller and simpler. The benefits of Euphoria follow directly from this design.

Machine Conventional Euphoria
boolean
integer
chr
real
...
record
array
list
string
tuple
tree
...
binary data-types structures atom sequence object


low level high level

Yes Virginia its true. You can count, weigh, and measure the advantages of Euphoria. With a conventional language you can achieve some of Euphoria's benefits. Examples and benchmark programs are provided so you can decide for yourself. The proof is in your own evaluation. If you prefer Friendly|Flexible|Fast only Euphoria delivers.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu