###

» Tue Feb 07, 2012 12:19 pm

I have two important points for reducing formulas sizes.

In 90% of the time I find myself treating the X and the Y of objects in the same manner. In 90% of the time both parts of the formula (X and Y) get the same treatment.

When calculating the distance, for example, I get this:

Distance(ThisObject.X, ThisObeject.Y, ThatObject.X, ThatObject.Y)

I was wondering whether an introduction of a special word will help the code look more simple/clean/nice. The word can be one of these:

- Point

- Location

- Position

This will turn the previous line to something like this:

Distance(ThisObject.Point, ThatObject.Point)

In more complicated formulas this idea make them even cleaner.

This:

Angle(Touch.X,Touch.Y, Head.X,Head.Y)-Angle(StartX,StartY,Head.X, Head.Y)

Will turn into this:

Angle(Touch.Point, Head.Point)-Angle(Start.Point,Head.Point)

It looks more elegant.

This addition will also show the attribute "Point" in Object Expression. Instead of just X and Y, we'll have "Point". Wish to set position of one object to follow another? Simply set it to follow Object.Point or Object.Position

People who still need the inner X,Y separation can always use the regular X,Y reference as we do these days.

The second point I wish to bring up is - Function library. I was thinking it would be cool if people can share their functions with the community by saving/loading functions. This will help bring more power to current creations by using other's functions.

I already suggested this for objects so why not for functions.

Such Functions library will reduce formulas and turn the code into something fun.

The families (Great feature!) made the code cleaner. Hopefully these two points will contribute as well.HotGod2012-02-07 12:22:18