|
metadata
Do you think that the operator `is` is just as useless then, Truefire (using your argument that you can always structure your code such that these results are attainable pre-compile)?
It’s hard to claim something is useless just because you have no use for it.
|
|
metadata
|
|
metadata
> *Originally posted by **[truefire](/forums/4/topics/202566?page=3#posts-4543801):***
>
> I still don’t get it.
`is` lets you see if an already created object is compatible with a type, allowing you to cast to a strictly typed variable and get speed benefits of it. in certain types of uses and areas of use, it _must_ be used at some point, by one of the programmers.
now, say instead of already having the object, you have the class. the class will take a known number of parameters of a type, between 0 and the limit (an obscenely high number, below a full 32 bits. you _should_ never encounter it). but, you need to know if it’s a subclass of another type, say DisplayObject so you can correctly handle created items. this is the use case. it’s just less common to come across because there’s no single operator way to do it, such as with `is`
|
|
metadata
> *Originally posted by **[truefire](/forums/4/topics/202566?page=3#posts-4543801):***
>
> I still don’t get it.
This was a response to Bob. Dealmaster just post-ninja’d me. (By 20 seconds, according to Kong)
|
|
metadata
> *Originally posted by **[truefire](/forums/4/topics/202566?page=3#posts-4544638):***
>
> This was a response to Bob. Dealmaster just post-ninja’d me. (By 20 seconds, according to Kong)
grumble grumble, making me go back a whole page. grumble mumble obscenities grumble.
what i said of `is` still applies. i use \* for data passed into my JSON class, then use `is` (and a hack for Vector) to determine the object’s type to encode it, and assign it to variables and pass it to functions to get speed boosts. and yes, sometimes deferring work to another function is faster than working with it in the current function. clean variable stack means you can use 1-3 and get the single-op and static lookup benefits they provide vs. the multi-byte encoded op and dynamic lookup of other variables, in combination with static retyping to get a proper type on the object that permits faster access of certain/all properties
at least if i understood what bob was saying
|
|
metadata
> *Originally posted by **[BobTheCoolGuy](/forums/4/topics/202566?page=2#posts-4543517):***
> > *Originally posted by **[truefire](/forums/4/topics/202566?page=2#posts-4543480):***
> >
> > If that was sarcasm (It better have been), I’m not getting the point you were trying to make.
>
> Yep :D
>
> I was just (ignoring the performance benefits of typing variables) saying that it primarily helps you to find and debug errors in code, along with handling different situations easier. Basically, you can get many of the same benefits as typing variables.
Happy? Lazy people…
|