Casting should only be used if you want to directly impact the object you are casting to, like changing variables in it or making it run a function.
If you only want to compare to that object, just use a == node. Casting is far more impactful to performance and on larger projects, you’re going to want to optimise everything as much as possible. On smaller projects it won’t make a difference.