How hard is learning the Lua scripting language compared to C#?


I’ve been here for a while but haven’t written anything but now I’ve decided and want to learn more about Defold. I want to learn and create small simple games 2d and possibly 2.5d later.

My question is how hard is learning the LUA scripting language compared to C#? Previously i tried to learn C# but gave up, became too difficult for me.

Compared to C# Lua us much easier to learn. I felt the same about C, Java and C++ back in the day.

Then ActionScript became popular, and I loved it. Lua is similar to ActionScript, but even easier to learn in my opinion.

If books are for you then this is a good one:

I think you’re in the right place!

1 Like

I only have experience with Python and Lua, and I learned Lua first. Python is truly painful compared to Lua. C# would be a tough one to get started with.

1 Like

Lua is easy. As long as you don’t get into metatable stuff, which you’ll likely never use in Defold anyway.

I’d suggest following some of the tutorials that Defold provides in the editor, you’ll find them under New Project > From Tutorial when you open Defold.

1 Like

I started with Defold with no programming experience aside from messing around with QBasic as a kid and I picked up Lua almost immediately.

1 Like

Thank you all, I’ll give it a go.

1 Like

I can’t speak for C# as I only used it for one project several years ago, but in my experience Lua has been the easiest language to learn by a large margin. It has fewer constructs than most other languages, its standard library is small, supports pretty error handling, and is quite forgiving of errors.

1 Like

Probably the main difference between them is that Lua better suited for functional programming and C# is mostly for OOP. There is definitely a lot more to learn in C# (more language features, coding principles like SOLID, Visual Studio as well), but the syntax is very nice and it’s MUCH easier than C++. :slight_smile:

Metatables aren’t really that bad either, really. I was scared of them a few months ago, but after just going for it and deciding to mess around with them they don’t seem bad. I see them kind of as fancy if statements that you just write a different way. The only potentially messy thing I could think of at my understanding is if you forget about a metamethod for a table being passed around liberally.

Night and day, Lua is easier to learn. It is good to separate out learning a programming language from learning to program. Lua in Defold is a a great way to go as there are working examples, instant results and people to ask. It does take time and consistency like everything does, Defold makes it fun as the result is a game. Later expand to other languages, it is not really useful to rank languages, unless you want make a you tube video about it (yawn). C++ is really fast but often the speed is not used, Rust has static analysis but if you are not doing threading and GPUing then who needs the syntax…