On Sun, Jan 8, 2017 at 4:47 PM, Wayne Stewart <[email protected]>
wrote:

> With all the recent object stuff, I notice most people are using either
> Cannon's excellent OBJ module or similar.
>
> I have extended it so I have one routine do both tasks, I like this as it
> means I only have one method to remember and not two.  There is obviously
> some overhead copying the variable into $0 but I've never seen any impact
> from this.  At least not with the variables I've used.
>
> Does anyone else do this?
>
> If you don't, why not?
>



Ivory tower from the folks folks who write about computer sciency stuff -
"a method should have one specific defined purpose".

Practical impact - when reading through legacy code, it can be hard enough
to understand what the former developer was doing. Having to switch modes
to know if I'm working with a method or a function does not make it easier
to read the code. One of my goals in designing code is to make things as
easy as possible to understand and having a method that goes both ways is a
fail.

Practical impact - I've created thousands of setters and getters since I
started using OT Scripter and I've *never* felt that I've got "too many
methods".


--
Douglas von Roeder
949-336-2902
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to