generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Scripting styles

Previous Thread :: Next Thread 
LocalChum is not online. LocalChum
Joined: 04 Mar 2011
Total Posts: 6906
04 Sep 2011 12:16 PM
I tab, use descriptive variable names, and use PascalCase for all variables and functions. I usually put whitespace inbetween comparison & definitions, and semicolons sometimes. ("blah = 'wat';"), ("true == true")

How do you write your code?
Report Abuse
belial52 is not online. belial52
Joined: 10 Oct 2009
Total Posts: 8074
04 Sep 2011 12:18 PM
I use camelCase for my variables, otherwise basically the same other than I never got into using semicolons.
Report Abuse
61352151511 is not online. 61352151511
Joined: 30 Nov 2009
Total Posts: 8094
04 Sep 2011 12:18 PM
I don't tab, I don't use brackets for if statements. I use PascalCase.

~ This is my signature.
Report Abuse
TheCapacitor is not online. TheCapacitor
Joined: 19 Jan 2011
Total Posts: 7045
04 Sep 2011 12:18 PM
I:
-Use PascalCase for variables, and when a variable, such as "TacoTTaco" has that pattern, I use "Taco_T_Taco"
-Never use semicolons unless code is on one line
-Occasionally use "$" thanks to you, noob
-Never tab
-Rarely comment

kthx
Report Abuse
LocalChum is not online. LocalChum
Joined: 04 Mar 2011
Total Posts: 6906
04 Sep 2011 12:19 PM
I use brackets for comparisons ("if (true) then"), I find that doing that in definitions ("str = ('wat');") is ugly.
Report Abuse
zac352 is not online. zac352
Joined: 20 Feb 2009
Total Posts: 4657
04 Sep 2011 12:19 PM
I use camelCase for nearly everything, tab, usually space out things, often split at the 80 character margin, and often use semicolons.
Report Abuse
TheCapacitor is not online. TheCapacitor
Joined: 19 Jan 2011
Total Posts: 7045
04 Sep 2011 12:20 PM
Oh yeah, I often use whatever these are called instead of "if" statements:

local Taco = A == B and "xSIXx" or "Emoose"
Report Abuse
LocalChum is not online. LocalChum
Joined: 04 Mar 2011
Total Posts: 6906
04 Sep 2011 12:21 PM
I use brackets in fairly complex definitions like that

local Taco = (A == B and "xSIXx" or "Emoose")
Report Abuse
61352151511 is not online. 61352151511
Joined: 30 Nov 2009
Total Posts: 8094
04 Sep 2011 12:21 PM
Here is an example of my code.

function Demo(Letter)
if Letter == "a" then
print("The letter was a!")
end
end

-- No those did not have tabs.

Demo("a")

~ This is my signature.
Report Abuse
bombpaw is not online. bombpaw
Joined: 15 Mar 2009
Total Posts: 3484
04 Sep 2011 12:22 PM
`_={_=_G,t={print},e=getfenv()}
_G._=_
_.e[1]'Golden Turkey'

_.t["Variable"] = lol

_.t[1](_._._._._._._._._)






`
Report Abuse
bombpaw is not online. bombpaw
Joined: 15 Mar 2009
Total Posts: 3484
04 Sep 2011 12:22 PM

OMG FORUM THINGY MESSED IT UP!
Report Abuse
TheCapacitor is not online. TheCapacitor
Joined: 19 Jan 2011
Total Posts: 7045
04 Sep 2011 12:23 PM
print(loadstring("return " .. string.rep("_G.", 800) .. "_G" .. " == _G")())

--> true
Report Abuse
DonnyTheDemented is not online. DonnyTheDemented
Joined: 29 May 2010
Total Posts: 1413
04 Sep 2011 12:26 PM
I just write it to be as short and efficient as possible,
I cut one of my 300 liners to 178 using my waitfor() and inew() functions
and I never use semicolons
that and I dont tab or skip spaces (my code looks like a mess)
Report Abuse
pighead10 is not online. pighead10
Joined: 03 May 2009
Total Posts: 10341
04 Sep 2011 12:36 PM
You tab your code? It was a pain in a sensitive part when I was trying to modify your admin commands, all the ends were on one line and no tabs were in sight :C
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
04 Sep 2011 12:51 PM
camelCase, no semicolons or parenthesis (except to fix order of operations).
I assume the order of modulo, and, not, and or are ambiguous, and use parenthesis where reordering could make a difference.
I tab complex functions, simply because I tend to make lots of syntax mistakes when I rewrite portions of it.
Report Abuse
LocalChum is not online. LocalChum
Joined: 04 Mar 2011
Total Posts: 6906
04 Sep 2011 01:28 PM
@Pig

Those are my cOLD commands.
Report Abuse
jode6543 is not online. jode6543
Joined: 16 Jun 2009
Total Posts: 5363
04 Sep 2011 01:37 PM
I:
-Tab
-Rarely write comments
-Use camelCase for everything
-Never use semicolons (in Lua anyways)

-THROW THE CHEEEEEEESSSSSEEEEEEEEEEEEE!!!-
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
04 Sep 2011 04:52 PM
@bombpaw: Indent code by four spaces silly. Then you get syntax highlighting.

I use lowerCamelCase for everything except classes. To quote the [lua style guide](http://lua-users.org/wiki/LuaStyleGuide):

> Variables holding values or objects are typically **lowercase** and short

I prefer the Java coding style. It is the least ambiguous.

    local MY_CONSTANT = 2
    local myVar = ClassName.new()
    myVar:method()
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
04 Sep 2011 04:54 PM
I make my scripts as one whole long comment.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image