Комментарии:
I can't even program my VCR back then, programming is far reach for me 😅 (half joke, half truth)
ОтветитьIn this case I like more C# because it more precise to types and can help me find error before running the project
ОтветитьGood point, I hope these features come in the Godot 4.0 version alongside more typesafe features
ОтветитьGood visuals in the video.
Your video is fundamentally wrong about how duck typing works -
GDSCRIPT
First Duck typing is has_method it is away to detect before calling - to check if it quacks like a duck.
Second you cannot call a function that does not exist - I feel you Basie to C# is showing
at runtime the GDscript will will validate the calls and method and give error - Error Invalid call. Nonexistent function '' in class ''
in C# we use refection give some duck typing but interface are the correct way to create a contract between different objects.
in GDScript with can use duck type to leverage composition over inheritance (SOLID principle ) this make your code easy to read and modular. this can also be done in C# with interface. but in GDScript it is a lot easier as we can leverage the resource class and not have to worry about memory management and drag and drop in the UI.
You do have autocompletion in GDScript, as long as you specify the type of variables.. Statically Typed GDScript
Ответить