Why do people choose LUA?

my friend says the best way to learn lua is to work with a skilled coder, and just play around with a bunch of different code.

There is a bunch of games that use it.


The main reason for me calling PHP inconsistent is shit like
for finding $needle in $haystack having another argument-order than e.g.

You can’t rely on consistency how it is in Lua. In Lua, the first argument is always the thing you want to perform an action on (using the second and following arguments). In PHP, it’s totally mixed up.

Also: Redundancy - implode() and join() are an example of two different functions doing the same.

One more argument against PHP: Function names are teh shit. “strpos” sounds so much less intuitive compared to “string.find()”. Sure, string.find() is longer BUT: the_string:find(what_to_find) is even shorter than strpos(the_string).

One more “function names” stuff: In Lua, most functions are organized in tables. In PHP, such a thing is missing. In Lua, the tables are like namespaces in C++.


I use it as a scripting-language on my computer, because I’m too lazy to learn MS Powershell or coding ugly batchfiles.

And other games such as WoW or FarCry use it too.

Actually there is a function which seems to ignore consistency in Lua.
string.Explode( delim, str )

Very annoying :S

I have overwritten that fuction and swapped the arguments around :slight_smile:

I hate lua , even more so when used with garrysmod. I find its all so “bitty”. No one ever seems sure exactly how stuff should be and starting up my game just to find I missed the word “end” because its 12 pm at night and im tired makes me rage.

I much prefer C++, I learnt the basics about a few months ago from the book “C++ For Dummies” I highly reccomend it although the guy seems to then go into some very advanced stuff for almost the entire second half. The reason I like it better is because whenever I made a mistake the solution was allways clear and made me kind feel of stupid afterwards. Lua however never really seems to explain itself too well and I find myself unsatisfied with the solutions to problems. If any of that makes sense.

Then again you could just void my entire argument since ive been doing this all for under half a year.

The default Lua string library does not have an Explode function. Garry made it that way. http://luabin.foszor.com/code/lua/includes/extensions/string.lua#20

One of the reasons you hate Lua is because you might forget an end, but forgetting a semi-colon in C++ is okay? Have GMod open in windowed mode and put your code editor next to it. Then you can test for bugs quickly.

How is the solution unclear in Lua? It tells you the line where the problem is. I believe that you will not find it hard to solve problems once you gain a better understanding of the language.

I only use Lua because I wanted to make stuff for Gmod in my spare time. My main language is C++ which I’ve done for 3 years on my degree. I also have done Python and C#.

Lua is ok, scripting languages are used in industry so artists can help with some of the coding work, as the art department usually finishes earlier on in production.

My bad, I thought it was a built in Lua function.

Well actually gmod crashes when I do the window mode thing. Maybe I need a clean out or my pc sucks. I dunno.

And in my defense I solve errors the console gives out in seconds. They dont bother me. Its just with lua I continually have problems where nothing gives an error but just refuses to work.

Although I must admit my general lua knowledge is much more patchy than my c++ knowledge but only because theres no fully complete Gmod lua tutorial. (in my opinion anyway)

Because “LUA” doesn’t exist.

It’s Lua.

And because like said above, it’s a very simplistic, minimalistic, and easy-to-learn Language.

And it’s used virtually everywhere in the software industry.

Yes. I know. That’s annoying me too like hell. It’s because of garry added it manually to lua.

I have to agree with all the function names and whatnot in PHP, it’s annoying when you’re “searching” for a function but you can’t find it, because it has some insanely stupid name. I hope they’ll change it, although I doubt it. You get used to it though :slight_smile:

As for the order of arguments, Garry seems to have fucked it up in some bits of GMod anyway, I’ve never noticed this as a problem honestly.

I’ve never really thought about it, though with about a dozen languages under my belt it didn’t come as any shock. C/C++/C#, jscript/javascript, VB/VBA/VBS/VB.Net, SGML/XML/XSL/Html/Dhtml/XHtml, perl, sed, awk, ruby, sql, php, makefiles… there’s a few others too I might had forgotten.

There just comes a certain point where one language look like the other and the brain switches gears transparently. The main reason I use lua with GMod is because it’s there. No other reason why.

Is there easier languages to implement? I don’t know, I didn’t code it, garry did. You would have to ask him.

The question was Why people choose Lua. And not Why do you use Lua. Its fact that you have to use Lua to modify gmod. So the most answers are nil (haha lolz)
Lua is easy if you understand it. I code a Month now. And sure not everything is easy… But its very Light and Small. But a Very Good language to modify everything you need.

You can also use C++ to achieve the same effect (With more work)

I tried to learn PHP to make a simple data sniffer for Omeggle, my friend would host it and I would send people links to “a picture of me” that came from somewhere on Google. I got lost on “Wtf, thats uhh… Basic. Very basic.” tutorial. Lua is a pick-up-and-go language ( as long as you know about the gmod wiki :smiley: )

VAC doesn’t touch Lua, so you don’t need to worry about telling people X program you made that does Y, making Z game (GMod, in this case) easier. Some people would call Y cheating, some people wouldn’t. Those who do could, if insinuated, inquire about a VAC. I personally believe that making “aimbots” and “wallhacks” should be encouraged, just as long as they are not released. Average Joe users don’t need to be able to have cheats like that – those who know how to build programs that do Y should be encouraged, yet keep the actual program on their computer, not anybody else’s. VAC checks into other kinds of programming languages, so “aimbots” and “wallhacks” would entail a risk.

Lua is (appearently) easy to learn and use and making gamemodes for my favorite game is like a dream :slight_smile:

Grim Fandango used Lua, I believe.