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 |
|
|
|
| 19 Mar 2012 06:12 PM |
| not required in Lua, less typing to do, don't use them. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 19 Mar 2012 06:16 PM |
| my scripting is efficient, but the code looks so sloppy and unprofessional. lol |
|
|
| Report Abuse |
|
|
| |
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 15 May 2011 |
| Total Posts: 18684 |
|
| |
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 02 May 2010 |
| Total Posts: 2400 |
|
| |
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
 |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|