Type checking question

I’ve been reading about type checking recently and it seems as though the main benefit of using it is for debugging large scripts. Am I right?

1 Like

Lua doesn’t have a type system, though you can implement one. In general, type systems help maintain and keep large code bases organized and usually it will throw errors before compiling, essentially making sure everything is being passed correctly (think function arguments being of specific types, so passing an invalid type, would present you with an error BEFORE compiling).

You can read this:

Type system - Wikipedia

The main purpose of a type system in a programming language is to reduce possibilities for bugs in computer programs due to type errors.[2] The given type system in question determines what constitutes a type error, but in general, the aim is to prevent operations expecting a certain kind of value from being used with values of which that operation does not make sense (validity errors).