If you aren’t statically typing your GDScript… hey… it’s me… I’m emitting a signal for you to start doing that if you want better code for marginally more effort.
It’s hardly any more work, and it makes code that is:
-
Easier to read
-
Faster at runtime (a tiny bit)
-
Plays nicer with autocomplete etc.
-
More consistent
-
Less buggy
I made a little video about why and how to get your project fully statically typed.
It might not be worth it for very small toy projects but larger projects will benefit. And it’s just a good habit.
So set UNTYPED_DECLARATION to WARN and start typing your stuff!