|
| 19 Dec 2012 05:49 PM |
Does anyone else do this? I put my waits on the line above them like this:
chicken.Dead = true; wait(3) chicken:Revive()
I also put meh ends like this:
if true then if true then if true then end end end
Anyone else have weird habits too? |
|
|
| Report Abuse |
|
|
Tenal
|
  |
| Joined: 15 May 2011 |
| Total Posts: 18684 |
|
|
| 19 Dec 2012 05:52 PM |
| I disapprove of multiple ends on the same line. |
|
|
| Report Abuse |
|
|
|
| 19 Dec 2012 05:53 PM |
I do neither and personally HATE more than 1 end on a line.
~ Moo logic = logical logic ~ |
|
|
| Report Abuse |
|
|
|
| 19 Dec 2012 05:54 PM |
Really! I like it that way. I don't like long lines then short ones, I like it where they are almost equal lengths.
- thedestroyer115 |
|
|
| Report Abuse |
|
|
LPGhatguy
|
  |
 |
| Joined: 27 Jun 2008 |
| Total Posts: 4725 |
|
|
| 19 Dec 2012 05:54 PM |
| I like the idea of having one statement per line. |
|
|
| Report Abuse |
|
|
| |
|
Tenal
|
  |
| Joined: 15 May 2011 |
| Total Posts: 18684 |
|
|
| 19 Dec 2012 05:55 PM |
@18c high five
what I do that may or may not be considered strange would be ternaries. Absolutely unsure why I do it all the time; maybe because I hate the looks of:
if foo == "bar" then foo = "bar" else foo = "foo" end |
|
|
| Report Abuse |
|
|
|
| 19 Dec 2012 05:56 PM |
| I tab my code so I can tell which end is for what. |
|
|
| Report Abuse |
|
|
|
| 19 Dec 2012 05:57 PM |
I don't like indentation when there are multiple if thens right after each other. Like this:
if true then if true then if true then --code end end end
|
|
|
| Report Abuse |
|
|
|
| 19 Dec 2012 05:58 PM |
My indents didn't show up, lol.
- thedestroyer115
|
|
|
| Report Abuse |
|
|
Tenal
|
  |
| Joined: 15 May 2011 |
| Total Posts: 18684 |
|
|
| 19 Dec 2012 06:00 PM |
@the to me they look great either way, but the biggest problem with the lack of indentation is the fact that ends line up with the actual if, when, while statements. Ever since I adopted the habit of tabbing (maybe two years ago? I didn't tab before around then) I've never gotten a single error of having too little or too many ends. |
|
|
| Report Abuse |
|
|
|
| 19 Dec 2012 06:07 PM |
| I haven't had syntax errors and I don't tab... |
|
|
| Report Abuse |
|
|
|
| 19 Dec 2012 06:18 PM |
| I used to not tab. I figured, "why should I tab when I don't have to?" I switched later though because it looked neater and readable and it gave me less stress and errors. |
|
|
| Report Abuse |
|
|
|
| 19 Dec 2012 06:19 PM |
| When I work with others on a project I will tab. |
|
|
| Report Abuse |
|
|
|
| 19 Dec 2012 06:41 PM |
If you don't like tabbing, you are in for a surprise if you start using python.
If you have multiple if thens directly after each other why not format like this: if cond1 and cond2 and cond3 then
end
rather than: if cond1 then if cond2 then if cond3 then end end end
That is one thing i like to do. |
|
|
| Report Abuse |
|
|
Aerideyn
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 1882 |
|
|
| 19 Dec 2012 06:41 PM |
I used to get bugs where i would mistakenly place an end on the wrong line when working with nested statements/loops and get my scopes all wrong.
while wait() do if true then for x=1,2 do --some stuff end for y = 1,2 do -- more stuff end end
is very different from
while wait() do if true then for x=1,2 do --some stuff for y = 1,2 do -- more stuff end end end
with tabbing that problem shows itself the moment you type it.. you save so much time not debugging. (this is obviously a simple and visible example - sometimes these scope errors can be so obscure..) |
|
|
| Report Abuse |
|
|
UnAdmin
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 4706 |
|
|
| 19 Dec 2012 06:55 PM |
Your ends are fantastic. But usually when I use ; I use it to put a whole function on one line.
~Domo Arigoto Mr. Roboto |
|
|
| Report Abuse |
|
|
|
| 19 Dec 2012 06:56 PM |
| I don't really find a difference, even in large scripts. When it does become a problem to me I might make some changes. |
|
|
| Report Abuse |
|
|
|
| 19 Dec 2012 07:05 PM |
I tab like this: if true then if true then if true then end end end |
|
|
| Report Abuse |
|
|
|
| 19 Dec 2012 07:09 PM |
No tabs. Darn: Pastebin: pastebin dot com slash T2H9Q4Mv |
|
|
| Report Abuse |
|
|
|
| 19 Dec 2012 09:45 PM |
Idk why, but I've always liked tenal, if you dare go back to C&G, I'd probably not care.
*Late high five*
~ Moo logic = logical logic ~ |
|
|
| Report Abuse |
|
|
|
| 20 Dec 2012 08:12 AM |
| Seeing as I tab EVERYTHING, ends go the same amount of tabs out as the opening statement. In Java, the opening brace also goes on the same line as the opening statement as I see them as the same thing. "{" is analogous to "then" or "do" and "}" is analogous to "end" |
|
|
| Report Abuse |
|
|
|
| 20 Dec 2012 09:20 AM |
Wrong:
if(true) { System.out.println("!") }
Is equivalent to:
if(true) { System.out.println("!") }
|
|
|
| Report Abuse |
|
|
|
| 20 Dec 2012 09:29 AM |
Try this one out, lol
if true then print "Hello world!" end |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 20 Dec 2012 10:08 AM |
I tab each control structure in, (Which is common across all languages), and it helps you read the structure of the code.
Also, if you don't tab in your code, you ARE in for a surprise when you try to work professionally or you work on a large project.
Please, tab stuff in. |
|
|
| Report Abuse |
|
|