Azenris
Member
Which of the following do you use?
Does it have a performance impact ( over the course of an entire project )?
Does this answer change between VM/YYC?
Does the answer change if there are more of less variables?
Do you find one more readable than the other?
note: there is only ever 1 obj_scene, gms2
or
I was just curious. I have been doing the first one out of habbit,
but never wondered if changing the context using with would affect readability / performance.
I know not to be craycray over early performance, I just do it everywhere, and if it does play a part
in things, I could switch my habbit earlier.
Does it have a performance impact ( over the course of an entire project )?
Does this answer change between VM/YYC?
Does the answer change if there are more of less variables?
Do you find one more readable than the other?
note: there is only ever 1 obj_scene, gms2
Code:
with ( obj_scene )
{
var _flooring_tilemap = tiles_flooring_tilemap;
var _collision_tilemap = collision_tilemap;
var _watered_tilemap = tiles_watered_tilemap;
var _lyr = depth_sorted_layer;
}
Code:
var _flooring_tilemap = obj_scene.tiles_flooring_tilemap;
var _collision_tilemap = obj_scene.collision_tilemap;
var _watered_tilemap = obj_scene.tiles_watered_tilemap;
var _lyr = obj_scene.depth_sorted_layer;
but never wondered if changing the context using with would affect readability / performance.
I know not to be craycray over early performance, I just do it everywhere, and if it does play a part
in things, I could switch my habbit earlier.