I was wondering what the best practices for declaring variables types in godot is? It's similar to Python in that variables types can be set dynamically. I find myself wanting to explicitly declare what a variable's type because I know that it's only going to be an int or something and I don't want to accidentally set it to the wrong type somewhere. This makes me think however that I'm wasting the "duck typing" aspect of the language. I don't think not explicitly setting the type if I'm using variables is the answer. However maybe setting up a bunch of variables like this in the first place is the wrong approach? Should I try to be using a more functional approach with GDScript?
Godot Variable Declaration Type Best Practices
- Edited
https://docs.godotengine.org/en/stable/getting_started/scripting/gdscript/static_typing.html
---
This discussion was caught in the moderation queue since you have not confirmed your account yet.
Upon creating your account you should have received an account verification email. The confirmation email may have been incorrectly flagged as spam, so please also check your spam filter. Without confirming your account, future posts may also be caught in the moderation queue. You can resend a confirmation email when you log into your account if you cannot find the first verification email.
If you need any help, please let us know! You can find ways to contact forum staff on the Contact page. Thanks! :smile:
2 years later
Megalomaniak added the Godot Help tag .