Disclaimer: That’s not feature request, i just want to hear your general opinion on godot typing and types overall
So after godot added types for variables it made many people use them, still i find them very messy to write and with not that wide screen it’s very hard to work on a game and code with types (at least for me) so i don’t use them, i also don’t like that they take so much space unlike other languages where types are added as variable initiation making up for semicolons or var keyword
even comparison of C++ vs GDscript
int numbers[1] = {5};
vs
var numbers: Array[int] = {5}
of course the difference is small, but still it is noticable, do you have the same problem or not?
The language I’ve used by far the most in my career is Java (and then TypeScript), so its fine for me!
I appreciate boilerplate can get annoying for some people, but I personally am fine with a bit of extra typing to have things more explicit. I also think having strict types is worth any amount of boilerplate, as they make things so much simpler and safer (especially in a team!)
I was about to write almost the same thing @gentlemanhal just sent . I think I might also be used to more verbose languages so I don’t find it too bad, but I also think the type safety is worth the extra characters.
Godot’s type system is definitely a bit more primitive than some other languages I’m used to though. To me the main annoyance has been when I have a typed array and need to assign another array that hasn’t been typed to begin with. It works, but needs a bit more work than I like.
All things considered, I find it good enough for the things I do in my games. I only feel the limitations sometimes when working on plugins and more generic solutions/apis.
That’s not a C++ equivalent. It declares a fixed size array, whereas GDScript’s Array is not fixed. The (close enough) equivalent would actually be:
std::vector<int> numbers = {5};
Which is about the same length.
If you count in the header include line, it becomes substantially clunkier than GDScript:
#include <vector>
std::vector<int> numbers = {5};
To nitpick you even further , your GDScript line is a syntax error. The Array initializer uses square brackets, not curly ones
Don’t forget that typing in GDScript is not mandatory whatsoever, although many people tend to act as if it is. It’s perfectly fine not to use it, in some cases even preferable as it lets you leverage the benefits of duck typing.
It’s pascal-style typing, it’s in fashion now and for good reason. It’s very easy to read from left to right, unlike C style declaration’s insane “spiral” method. However GDScript does not have very complicated types with pointers or const qualifiers, but types being optional over all makes things complicated.
That’s… probably the first and only time I’ve heard anybody say that C++ is ergonomic on the wrists and fingers. If you work with C++ and absolutely hate your coworkers, then one day you’ll end up writing something like this:
and see no problem with it whatsoever. (C++ is so verbose, the language has multiple keywords that serve no purpose beyond keeping your code readable.)
I used Python for a few years and I am currently learning C# and honestly, yes I feel that gdscript is a bit bulky. And restrictive in the names and call functions. But I can not deny how many quality of life things they have, the ability to click and drag the node into the script to call it directly, the default node scripts actually working and can be edited easily without jumping through so many hoops.