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 » Scripting Helpers
Home Search
 

Re: ; after variables

Previous Thread :: Next Thread 
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
13 Apr 2014 05:24 PM
Why do people have their variables like this?

variable1 = 5;
variable2 = 10;
variable3 = 20;
variable4 = 40;
variable5 = 80;
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
13 Apr 2014 05:27 PM
because semi-colons are for bosses

#nerdsunited
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
13 Apr 2014 05:28 PM
I need a real answer :l
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Apr 2014 05:30 PM
because most other languages require them and they're used to it
Report Abuse
gamehero is not online. gamehero
Joined: 12 Jun 2007
Total Posts: 1455
13 Apr 2014 05:31 PM
Usually it's out of habit from C++, because it doesn't run when you forget them. But that's not the case for Lua.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Apr 2014 05:34 PM
'Usually it's out of habit from C++'
No, there are so many other languages people use that require them. So many.
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
13 Apr 2014 05:39 PM
So it doesnt matter?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Apr 2014 05:41 PM
Not much in Lua, though in some cases it does. Like:

x = 5;y=10 works but
x=5y=10 doesn't
Report Abuse
gamehero is not online. gamehero
Joined: 12 Jun 2007
Total Posts: 1455
13 Apr 2014 05:42 PM
Yeah, it doesn't matter. Although some people may criticize you for using semicolons in Lua, because of how unnecessary they are.
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
13 Apr 2014 05:46 PM
Okei
Report Abuse
gamehero is not online. gamehero
Joined: 12 Jun 2007
Total Posts: 1455
13 Apr 2014 05:49 PM
However... It may be good practice to use semicolons like this though...
You can see the breaks between the inner tables better.

t = {{0,0,0,0};{1,2,3,4};{8,2,3,7}}

Instead of this...
t = {{0,0,0,0},{1,2,3,4},{8,2,3,7}}



But it's very minor...
Report Abuse
Cr4shImp4ct is not online. Cr4shImp4ct
Joined: 23 Nov 2013
Total Posts: 107
13 Apr 2014 05:50 PM
Semicolons are aesthetically pleasing, and are required in most other languages (esp. Java- and C-based languages).
To have people learn to use semicolons this early into a programming career, assuming they would like to get into a career along this line, would help them a lot.
Report Abuse
oxcool1 is not online. oxcool1
Joined: 05 Nov 2009
Total Posts: 15444
13 Apr 2014 06:45 PM
In Lua, semicolons can be used to fix 'ambiguous errors'.

Ex:

print("test")
(print)("Hi")

> error: ambiguous syntax (function call x new statement) near '('


print("test");
(print)("Hi")

> test
> Hi
Report Abuse
HeavenlyRobloxrox3 is not online. HeavenlyRobloxrox3
Joined: 02 May 2012
Total Posts: 101
13 Apr 2014 06:45 PM
It's a habit from Java and PHP and C++ and other languages like that.
Report Abuse
InternalSequence is not online. InternalSequence
Joined: 01 Nov 2012
Total Posts: 744
13 Apr 2014 07:07 PM
I'm a PHP programmer. PHP requires semicolons to successfully compile a web application. Semicolons don't matter much in Lua; but as cntkillme said, they may when you're using the Studio Command Bar.


- InternalSequence *Web Developer*
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
13 Apr 2014 07:36 PM
"Although some people may criticize you for using semicolons in Lua, because of how unnecessary they are."

Those morons aren't real programmers and cannot seek a future in software engineering or anything to do with any kind of programming/scripting language in a computer.


@OP
You can use semicolons to separate key-value pairs in a table and get the same results as using an ordinary comma.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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