On Sat, Jun 10, 2017 at 1:54 AM, Martin Schreiber <mse00...@gmail.com> wrote:
>
> I don't like "sub" much but found nothing better up to now. I think that
> object methods deserve an own token "method" because of the implicit "self"
> parameter. Comming from a Pascal background "procedure" implies that there
> must be a "function" too but there is none in MSElang. Maybe "proc" instead
> of "sub" and "meth" instead of "method" what do you think?

My "vote" is to use "function" anywhere.

You've said:

> ...object methods deserve an own token "method" because of the implicit 
> "self" parameter.

But the object itself is a context to the functions (methods) so, I
can't see any problems.

About the procedures vs functions vs "sub"... well, as I've said, just
use "function".
If you have a return, use the same as Pascal:
function Foo: Boolean;

If you don't have a return, don't write the last part:
function Foo;

IMHO a function that doesn't have a return — doesn't matter if is a
method or a "sub" — isn't a good design.
You need to have a return. If you have a object with a method "exec",
eg, why not return the object itself? Just return something.
But, for procedural programmers, just don't write the last part as I proposed.

Best regards,
Marcos Douglas

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to