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: Coding discussion: do you use semicolons?

Previous Thread :: Next Thread 
vexStudio is not online. vexStudio
Joined: 18 Mar 2012
Total Posts: 55
19 Mar 2012 06:11 PM
If you do/don't, why? I currently do *not* use semicolons, but I might get into the habit (primarily because other programming languages require it).

{ Scripting level - intermediate. }
Report Abuse
xSIXxStorage is not online. xSIXxStorage
Joined: 22 Aug 2010
Total Posts: 1811
19 Mar 2012 06:12 PM
not required in Lua, less typing to do, don't use them.
Report Abuse
vexStudio is not online. vexStudio
Joined: 18 Mar 2012
Total Posts: 55
19 Mar 2012 06:14 PM
I think they make your code look much neater and more professional.

Right now, I only use them for multi-line tables.

    local myTable = {
        "a";
        "b";
        "c"
    }

{ Scripting level - intermediate. }
Report Abuse
xSIXxStorage is not online. xSIXxStorage
Joined: 22 Aug 2010
Total Posts: 1811
19 Mar 2012 06:16 PM
my scripting is efficient, but the code looks so sloppy and unprofessional. lol
Report Abuse
enumeration is not online. enumeration
Joined: 17 Dec 2011
Total Posts: 2552
19 Mar 2012 06:16 PM
[ Content Deleted ]
Report Abuse
vexStudio is not online. vexStudio
Joined: 18 Mar 2012
Total Posts: 55
19 Mar 2012 07:15 PM
I think I may fall into the habit.

{ Scripting level - intermediate. }
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
19 Mar 2012 07:20 PM
I generally use a semicolon on a multiline table, when I have to script on a single line (script builder, etc) and when I'm reserving variable.

local int;
local tab = {
   "Some value";
   "Another value";
   "Last value";
}

local function update() int = #tab; table.insert(tab, math.random()); return tab[#tab] end

Haters gonn' hate.
Report Abuse
geicogeko is not online. geicogeko
Joined: 27 Apr 2010
Total Posts: 2727
19 Mar 2012 07:24 PM
I never use them in my C++(trollfaic), its a bad habit.

~Legal Lizard~
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
19 Mar 2012 07:25 PM
[ Content Deleted ]
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
19 Mar 2012 07:35 PM
Occasional I'll use semi-colons for multi-line tables, but not for generic code. Unless the language I'm coding in requires semi-colons, I don't use them.
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
19 Mar 2012 07:37 PM
Using them doesn't make your code look more professional, it just makes it look stupid.

Why would you put random semicolons at the end of every line? If anything, you'd do that when you'd want to obfuscate your code to make it less readable.
Report Abuse
1Ra is not online. 1Ra
Joined: 02 May 2010
Total Posts: 2400
19 Mar 2012 07:39 PM
I'm trying to get into the habit, because whenever I switch to something like C++, it gets really annoying.
Report Abuse
TheSuperBloxxa is not online. TheSuperBloxxa
Joined: 02 Mar 2011
Total Posts: 4484
19 Mar 2012 07:40 PM
During LUA, it's just to make your script look more tidy and nice. However I don't really think you need those, I use them.
Report Abuse
1Ra is not online. 1Ra
Joined: 02 May 2010
Total Posts: 2400
19 Mar 2012 07:41 PM
Lua*
Report Abuse
Legend26 is not online. Legend26
Joined: 08 Sep 2008
Total Posts: 10586
19 Mar 2012 07:45 PM
As vex does, I personally only use them on multilined tables.
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
19 Mar 2012 07:47 PM
I use semicolons on multiline tables, because you _HAVE TO_ use either semicolons, either commas, and I think semicolons look nicer.

However, using semicolons when you don't need them certainly doesn't make your code more professional.
Report Abuse
vexStudio is not online. vexStudio
Joined: 18 Mar 2012
Total Posts: 55
19 Mar 2012 07:54 PM
@JulienDethurens

How so? Explain to me how it doesn't. Most real world programmers use languages such as C++, which requires a semicolon after every statement. Even though (RBX.)Lua doesn't require it, it would most definitely make you seem more experienced and knowledgeable.

{ Scripting level - intermediate. }
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
19 Mar 2012 07:58 PM
Because in languages that semi-colons aren't needed for... well... why would you use them? There's no point. Also note that Lua isn't the only language that doesn't require semi-colons.
Report Abuse
vexStudio is not online. vexStudio
Joined: 18 Mar 2012
Total Posts: 55
19 Mar 2012 08:00 PM
@nate

I know not all require semicolons, I was stating that some do.

Hmmm... with all of the feedback I'm getting, I'm considering reconsidering my decision to use semicolons.

{ Scripting level - intermediate. }
Report Abuse
LPGhatguy is online. LPGhatguy
Forum Moderator
Joined: 27 Jun 2008
Total Posts: 4725
19 Mar 2012 08:02 PM
I don't use semicolons because they aren't needed. Although I find myself still using lots of parentheses (from Lisp.)
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
19 Mar 2012 08:51 PM
Just because some more complex languages use semicolons doesn't mean using semicolons in a language that doesn't need them will make the code look more professional.

Just like C++ code that looks like Lua code doesn't look professional, Lua code that looks like C++ code will certainly not look professional.
Report Abuse
myrkos is not online. myrkos
Joined: 06 Sep 2010
Total Posts: 8072
19 Mar 2012 08:52 PM
I used to put semicolons in Lua and C++ all the time, but now that I started C++ again after a short break from programming I sometimes even forget to put semicolons in C++.
Report Abuse
nightname is not online. nightname
Joined: 10 Jun 2008
Total Posts: 8960
19 Mar 2012 09:01 PM
You don't need them, and it doesn't make you look smart. However, I put them on my code anyway, just because it is a habit from Java.

Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
19 Mar 2012 10:07 PM
As I recall, SDuke uses semi-colons as well for Lua code as it is a habit from... Maybe it was PHP, can't remember.
Report Abuse
PurpleKiwi is not online. PurpleKiwi
Joined: 26 Jul 2008
Total Posts: 4022
19 Mar 2012 11:14 PM
I don't use semicolons in Lua, but after coding in a language that requires it (like Java and C#), I start doing it after ordinary sentences;
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