Re: Pass by Reference

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

Personally, i have no problem with not having pass by reference. There are times when i would use it if it was available, but since it isn't, i just find other ways to do what i want. I actually like how Euphoria doesn't have lots of different ways of doing things with "syntax sugar", but has the power to emulate many things that other languages do, such as OOP for example. Even if it takes a little bit of extra typing, i like the fact that i am able to see exactly what the code is doing because it is all written out in sequences, slices, elements, enums, etc. I can clearly see when something is a reference to an index vs. an ID, and i can see exactly how the sequence stores everything, and i know nothing else is sneaking behind my back to do something.

As an example, in my Redy environment, i use pseudo-OOP all the time. I don't need to pass by reference, all the data is right there, in sequences. All i need to do is search for an ID to find the index of whatever object i want to access, and pass that idx to a routine if i want to. I can use enum to define valid values for certain types of data and i can create routines such as create and destroy and other routines to modify the object "properties" however i want to. I don't have to learn about polymorphism and stuff like that or follow tons of OOP rules and syntax to do whatever OOP kind of stuff i want to do. I'm not even sure how my code compares to how you would do things in an OOP languages, and i don't really care. I just follow some basic rules to access sequences with complete control and understanding of what is going on.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu