r/learnprogramming • u/ezreth • 24d ago
Trying to decide what language to use for Unity.
So I was learning c++, but Im not very far. I am switching to Unity to build a game, and the options are c#, c++, and rust. Im fairly new to programming, and want to just sit down and learn. which one is easiest to learn, and which is most optimal for my purposes. also what is the gap between them in difficulty
2
Upvotes
9
u/FilthyWunderCat 24d ago
C++ for Unreal, C# for Unity
5
u/ferfykins 24d ago
C++ is the hardest, i would definitely not recommend it.... Also C++ is for unreal engine
For you, using unity, you'll be using C#, definitely go with C#, way easier
4
u/NomaTyx 24d ago
For one, Unity doesn't support scripting in c++ and rust, so it'd be a kerfuffle to set up especially if you don't know exactly what you want to do with the languages and why. For two, C++ and Rust (pretty sure) are not beginner friendly languages.
3
u/ErrorDontPanic 24d ago
For Unity, just use C#.
Tons of resources, easy to use language, all the documentation is right there.
3
u/Realistic_Speaker_12 24d ago
If you want to learn c++, use c++.
If you want to „get stuff done“, use c#.
1
u/Outofmana1 24d ago
C# because Unity is built off of C#
1
u/FreeLogicGate 23d ago
The top tier of game engines includes Unreal, Unity and Godot. Two of those engines support C#.
C# is based on C++ so there are many similarites between them, but fundamentally, C# compiles to bytecode that requires a runtime engine to execute. This is a similar approach to the one taken by Java (which is also a language based on C++).
All languages that have their own runtimes, handle memory allocation for you, using reference tracking and garbage collection built into the runtime. C++ (like C) compiles into a native operating system program, and you must manage memory allocation and disposal yourself.
So to your basic question, learning C# will support your desire to use Unity, and it's also one of the primary languages for the Godot engine. C# is also the language most used in the corporate world, when those companies are reliant on Microsoft servers and networks, as it's paired with .NET.
You can always learn C++ more fully, and your experience with C++ will aid you in learning C#
0
u/8Erigon 23d ago edited 23d ago
If you want to learn programming then program, don't make games. (edit: don't make games using a game engine. Something like pygame isn't overwhelming I think) Learning to use a game engine is a thing for itself.