r/learnprogramming • • 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

14 comments sorted by

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/Feralz2 23d ago

Based

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.

1

u/Mathie1729 23d ago

Nah, making games is still programming. You're writing logic, state, event handling, and debugging the same kinds of problems, just with an editor on top. If the goal is to learn C#, Unity is a perfectly reasonable path and can keep you motivated way longer than console exercises.

1

u/8Erigon 23d ago

You do need to programm but you also have to do other things which means more stuff to learn.

And exercises aren't optimal for learning. Making and coming up with own stuff and learning how to do it os the best way of learning. 

Console applocations are just simpler and you can still make games (just only turn based or text adventures).  Make simples things first. You don't have to give up fun for that. 

1

u/Feralz2 23d ago

programming for the sake of programming is the most inane thing you could do, its a complete waste of time, the point of programming is to build something. You have a backwards mentality.

1

u/Zerocchi 17d ago

They wanted to make games. You program stuff to make things regardless of abstractions.