• Structuring the code in the LUA files
    39 replies, posted
[QUOTE=CowThing;17022066]It would be nice if all those Gmod Lua specific editors that have been started would actually finish.[/QUOTE] GLuaR gets painfully updated. Though parts of it are outdated with the libraries it uses it would be a bigger pain to have to rewrite all of it again.
[QUOTE=ninjerss;17002678] edit: but don't put ;'s after each line that is fucking gay[/QUOTE] It's an optional language feature. It's not [b]gay[/b]. Personally, I use semi-colon line terminators. If given the choice, I will ALWAYS use them. I'm not telling you to use them, but don't get on people's backs about using them.
The only time i've really used ';'s are when writing a bit of code in the console with lua_run/_cl
I use them all the time, it's just a habit from c++ now.
[QUOTE=Kogitsune;17021749]I don't know about you, but I'd absolutely lovely Visual Studio-styled intellisense / auto-complete. Would make my life so much easier.[/QUOTE]Real coders can code in emacs.
[QUOTE=Doug52392;17028468]Real coders can code in emacs.[/QUOTE] Before the incoming xkcd post, they use butterflies, duh :P.
I like this style [lua]function SomeFunction( args, stuff, moar ) if( stuff == true ) then print( args, stuff, moar ) else print( "Too bad" ) end player.GetAll()[1]:ChatPrint( "Hey" ) end SomeFunction( "I", true, "like pie" )[/lua]
[QUOTE=Waffler;17039849]I like this style [lua]function SomeFunction( args, stuff, moar ) if( stuff == true ) then print( args, stuff, moar ) else print( "Too bad" ) end player.GetAll()[1]:ChatPrint( "Hey" ) end SomeFunction( "I", true, "like pie" )[/lua][/QUOTE] That's exactly my style except when there's only one function argument, IE. Print("lol") I use no spaces.
That is not to say the above posts are the only way to code Lua. This is probably how I'd code something small like that. Not to everyone's tastes, but I prefer this to C-Style. [lua] local function a(a,b,c) if b then print(a,b,c) else print"Too Bad" end player.GetAll()[1]:ChatPrint"Hey" end a("I",true,"like pie")[/lua]
[lua] function Lol( Text, Shit, Lmao ) print( Lmao ) for k, v in pairs( Text ) do print( k ) print( v ) end end [/lua] This be meh style.. But who cares, we all just have OCD deep down =D
Sorry, you need to Log In to post a reply to this thread.