RE: A question about certain language features

new topic     » topic index » view thread      » older message » newer message

tone.skoda at siol.net wrote:
> Euphoria is almost perfect programming language as it is now.
> It only needs a simple OOP addition.
> Of course, debuger and editor with IDE also are missing, but that is not
> part of language itself.

I appreciate your feelings, but I'm not sure what this has
to do with my original message/questions?

> Why call by reference, becuase VB has it?

I've never used VB.  I have used C, C++, Pascal, Modula 2
and Oberon, all of which feature call by reference (well, in
C you have to use pointers, but it amounts to the same thing
in actual use).

> It is complicated feature, I don't need it.

I am happy for you.  However, that was not the point.  I was
simply wondering why it was not included.  I've read that
functional languages don't allow call by reference because
of the side effect factor.  But they also (I'm not a
functional language expert - this is based on my readings of
the subject) don't allow assignment to global variables from
a subroutine, because it is a also a side effect.  So, I'm
simply wandering why Euphoria's author choose not to allow
call by reference.  Is it a style issue, a good programming
issue, is he trying to emulate some tenet of functional
programming, etc.

> I don't need goto either.

Good for you. But I did not ask about goto.

> Variables can not be initialized when declared, that is ok.

That may be.  But I did not ask if it was 'ok', I simply
asked why it is not allowed.  Is initializing a variable
when it is declared a 'bad thing'?  It is supported in other
languages I have used, and so I was wondering why not in
Euphoria.

> Local constants are really not needed.

True.  But again, I simply asked why the feature was not
supported.

> Things I most like with Euphoria: simplicity, sequences, type checking, 
> no
> waiting for compilation, speed...

Again, I am glad you like it, I like Euphoria also.  But
that is not what I was asking about.

And to make sure I'm clear - I'm not asking for these
features to be added to Euphoria.

For instance, I can see why the author would not choose to
add a goto to Euphoria.  Many programmers realize that
goto's, used unwisely, can cause hard to
follow/maintain/prove correct code.

I'm simply trying to understand if in general the author
feels that call by reference, variable initialization on
declaration, and locally declared Euphoria constants are bad
things, or would lead to poor programming style, or what
have you.

If I know why these things are not allowed, who knows,
perhaps I will adopt this style for my own use in the other
languages I program in.


>
> ----- Original Message -----
> From: "Ed Davis" <ed_davis2 at yahoo.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Monday, February 11, 2002 5:39 PM
> Subject: A question about certain language features
>
>
> > I've been reading the Euphoria documentation, and I have a
> > few questions about certain features of the language.
> >
> > I assume that the author made certain choices because he
> > felt that this encouraged a better way of programming.  I
> > don't want to start (or continue) an argument about this per
> > se, but I would like to try and understand the reasoning.
> > For instance, without debating their merit, I can understand
> > the author leaving out the goto statement, as abuse of goto
> > can lead to hard-to-read and hard-to-prove-correct code.  Of
> > course, the converse is possibly true too.
> >
> > The features I have questions about as to why there were
> > implemented that way are:
> >
> > 1) Variables can not be initialized when declared, but
> > rather, must be initialized via an assignment statement.
> > Based on other languages, this seems like one of those
> > convenience type issues.  Is there some programming
> > philosophy that says that an initialization in a declaration
> > is a 'bad thing'?  What is the 'bad thing'?  I also note
> > that standard Pascal does not allow variables to be
> > initialized when they are declared.
> >
> > 2) No support of call by reference.  I understand that call
> > by reference can lead to unexpected side-effects, but since
> > changing global variables in a subroutine seems to
> > essentially cause the same problem, I don't understand this
> > omission.
> >
> > 3) No support for local constants.
> >
> > Again, I'm not trying to start a debate, I'm just trying to
> > understand why these features/omissions are desirable.
> >
> > Thanks for any information!
> >
> >

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu