Quote:
Originally Posted by DustyPorViva
It depends on how many values of the object I am changing.
|
Yup, same here. As a rule of thumb, if I'm changing three or more values, I use with.
I mean, really... which one looks better? It may be more lines, but I guess I'm a block kind of guy.
PHP Code:
function TheParentObject.onMove(newx, newy) {
TheObject.x = newx + TheParentObject.width + 10;
TheObject.y = newy;
TheObject.text = "Has been moved with parent object";
}
function TheParentObject.onMove(newx, newy) {
with(TheObject) {
this.x = newx + TheParentObject.width + 10;
this.y = newy;
this.text = "Has been moved with parent object";
}
}