Hi, I’m a beginner programmer and i saw that Godot supports c# (and I think C++ too)
and since i took “Learn GD script from zero!” i thought to myself “I WANT TO TRY A DIFFERENT LANGUAGE!” And I see a lot of people use C# and C++
But is it worth learning?
And will it be easier to learn?
if you can C#, then GDScript should be easy for you too.
GDScript will also has more solutions (if you found any problem) than C#, because it’s the default language for Godot Engine
What will be your project platform targets?
and Which Godot Engine version will you use?
Neither of those languages will be easier than GDScript. Only you can answer whether learning a different language will be worth learning.
In my opinion, the biggest advantage of learning C# is that you’ll understand basic programming concepts better than with GDScript.
A great example would be OOP, or Object Oriented Programming, you’ll understand different type of variables better since in C# you can’t just change the type of a variable at random.
Another huge positive is that whatever you learn in C# now you can use in other fields later, since C# is widely used everywhere, from game development to web development, desktop applications and anything you can imagine.
If you’re serious about programming, learning C# will help you. A lot. It won’t be easy, but you’ll learn.
Learning new languages can be fun, and will help you improve your skills. It’ll also teach you deeper lessons about programming. In that sense, any programming language is worth learning, even if you never wind up using it for anything practical.
A lot of the answer to your question, though, is what you want to do with the language you learn. If you mainly plan to continue in Godot, C++ probably isn’t the best choice; you get a lot more control (and speed), but at the cost of significantly more work. C# would be a better choice, but it restricts which platforms you can use; Godot’s C# support doesn’t work on platforms that don’t have .NET or an equivalent.
If you’re looking beyond Godot, all sorts of other possible languages become possibilities.
To be fair I cannot think of a single platform where dotnet isn’t supported. In fact, I’d say .NET is supported on more platforms than Godot is, so that point is a bit silly.
i am using godot 4.0
if you wanted to export/build for web, then i suggest to use godot 3 if you wanted to use c#, else gdscript should work fine for all builds on Godot 4 and 3
As I already did lots of programming in various languages:
I recently started using Godot and I think C# is very nice as a language. It’s easy (compared to C++, C) and I still have all options I might need later, when I get deeper into a project and I need to customize something for me.
Especially when I think that I want “something” to be done in the background with message queuing, or networking, I feel like I have more options and I can precisely select what is right for the task I want to accomplish.
C# is something I can use more often, GDScript only in Godot.
If you have no experience whatsoever with programming, go straight to gdscript, ignore and avoid C#, and don’t even think about C++.
it doesn’t matter what language you use, it matters that you learn the basics of coding like conditions, expressions, functions, variables and objects.
programming is not about what the code looks like but how it does what it does. once you learn that you can move to another very easily.
I started with python, once I was experienced with it it was so much easier to learn C++ and then C. and knowing C++ it was very easy to move to C#.
people often call gdscript “basicaly python”, but it’s nothing like python, it is so much better in every way, one important example is how it has both static and dynamic typing. types (of variables) can be optional or obligatory, but the var
will tell you where a variable was defined, and you can also define an empty array and fill it later. In python types are always static and you define them by giving them a value, so it’s never clear where a variable was defined or what type it is and code that’s over 50 lines long becomes impossible to debug.
python:
tmp = 50
speed = 0.5
gdscript:
var tmp : int = 50
var speed : float = 0.5
it also has OOP (which python doesn’t, at least not in a sane useful way).
so for learning the basics, and some more advanced features like inheritance, gdscript is perfect.
if you go to a different language after learning it, there will be some new things like pointers and references and more requirements for keywords, but the rest will just be learning the language’s “lingo”, for example, here’s a foreach loop with 3 languages (gdscript, C# and C++)
gdscript
func iterate() -> void:
var arr : Array = [1, 2, 3, 4, 5, 6]
for i : int in arr:
print(i)
C#
void iterate() {
int[6] arr = {1, 2, 3, 4, 5, 6};
foreach (int i in arr)
{
GD.Print(i);
}
}
C++
void iterate()
{
int arr[6] = {1, 2, 3, 4, 5, 6};
for (int i : arr)
{
std::cout << i;
}
}
notice how C++ needs a library (std) to print text to the console, in the case of C# we are using the godot library. also notice how we define the variable type in each case but gdscript is more clear thanks to the var
and func
keywords. also how gdscript can use the Array
class while the other languages have a built-in system based on pointers that needs more time to learn AND libraries like Map
, or in the case of C# there’s also built-in types like Queue
.
I would say avoid C#, because if and once you learn it, it has so many options that are built-in, that it will be very difficult to learn something different later, specially if you are self-taught.
also, for godot, you need to learn C# on it’s own before jumping in to make a game, godot won’t held your hand and you must know what you are doing.
I recommend that (if you decide on C#) doing a tutorial on C#, finishing it and making an app in C#, before you try to make games with it, otherwise you will get stuck.
I do wish GDScript had the option to use braced scope. I mostly like GDScript, but whitespace-based scope is Not My Favorite. I can’t tell you how many bugs I’ve had where I was alt-tabbing to a different window and must have fat-fingered the key combo, and suddenly:
if custom_camera:
cam_y = custom_camera
else:
cam_y = CAM_HEIGHT
$Camera.position.y = cam_y
became:
if custom_camera:
cam_y = custom_camera
else:
cam_y = CAM_HEIGHT
$Camera.position.y = cam_y
and huh, why did custom camera heights stop working?
C# for godot was mistake in my opinion. Creators should have focused on some advanced visual scripting system instead of C#.
Visual Scripting is only really useful when combined with an actual programming language. A great example of this done right is the Unreal Engine, where you can write your actual functions using C++, then later connect them together through Blueprints.
Visual Scripting will often make it much, much more difficult to make a coplex game, as it’s basically impossible to keep your “codebase” clean.
I do wonder why you think C# for Godot is bad, have you tried it? How much did you use it? How much experience do you have with the language and .NET as a whole?
funny, visual scripting is really bad. unreal devs tend to speak bad of it, and as someone who was on bge for a while, visual scripting there was also bad and very limited compared to actual scripting.
I don’t think C# on godot is bad, but it should be treated just like python for godot or rust for godot or BASIC for godot (I don’t think this last one exists yet), an option for whoever finds it more comfortable, but not something with its own version for download in the main page. It should be maintained by a bunch of C# enthusiasts or some third party with connections to game companies that want it. As it is currently, it pollutes the github with requests for style changes and improvements, some kind of angry sounding.
The devs have been talking about removing the mono version for a while now, and are getting closer and closer to it, fortunately. Soon C# godot will become a gdextension.
OK thanks my dude!
Could you throw me the Source for this claim? If that happens I’m jumping ship to unity unfortunately.
claim? they’ve been talking about it for a while.
2 second search.
C# is hindering development of godot, this change improves integration, improves performance, it makes code easier to debug and takes a weight off the back of C++ developers who no longer have to maintain the glue to keep the mono version working. this also allows for new features to be added to godot.
C# is not going away, it’s becoming a gdextension. you download it and put a file in the project and that allows C# to work.
the proposal goes into detail of all the advantages this brings not just for godot but also for C# devs.
Just to clarify, I think you are referring to our plans to unify the editor flavors. So you are correct that eventually we’ll get rid of the mono version, but not because we’re dropping C# support. It’s more like the opposite, there will only be one editor flavor which will support C# out of the box.
When the editor unification project is finished, you won’t have to manually download anything. The editor will fetch the required dependencies as needed. So users that only use GDScript won’t have to download any additional dependencies, and users that use C# will have the same experience they’ve always had.
I know it can be confusing when we use the term GDExtension to refer to the new bindings, but this is only an implementation detail so don’t look too much into it.
I agree with jesusemora.
To throw in my 2¢, you should absolutely use GDScript and not think about C# or C++ until you are more advanced. There is a lot of tribalism in programming languages, so many people in this thread are coming out to recruit you for their camp. For your own good, it’s best to go with the biggest group. Most godot users, by far, use GDScript.
It will be difficult since you will learn Godot at the same time that you are learning basic programming. No matter, GDScript is the obvious choice because it has the largest number of users and the best documentation. The official documentation and guides for Godot are so good, they are your best friend for learning Godot.
I can attest to this. I am using LabVIEW for a couple of university projects and it uses a visual scripting system. Needless to say, it’s AWFULLY clunky and ends up being more tedious to do even mundane things. The bigger a codebase becomes, the more ground visual scripting loses to text scripting when it comes to accessibility.
As for the original question, I agree with the other posters.
GDScript can do nearly everything one can do with the engine (even very low level stuff), so there’s really no reason to go to C#, as it’s also much easier. It’s like Python, but without the stank of Python; you can even make it very type strict and show very useful errors (like unused variables) if you fumble around the settings. Plus, since it’s the default language of Godot, most solutions you can find around for coding problems you may face will almost always be implemented in GDScript. Also, I am pretty sure that Godot compiles GDScripts to an intermediate format when exporting a game, so the performance difference between C# and Godot shouldn’t be very noticable, if existent.
On the other hand, whilst you can make a game in C++, C++ is meant more for module creation for the engine (and the engine itself, of course); in other words, there’s really no reason to learn C++ unless you explicitly want to change the internals of the engine.
As a sidenote, there’s also GDExtension, which offers you the capability to use any language you want (which can produce a dynamic library [dll
files on Windows, so
files on Linux]) without needing to change the engine itself. However, this is really only meant as a performance enhancer for features that really need it, plus it can get pretty hectic trying to understand how it’s meant to work, so it’s really not something that needs concern you as you are starting out.