Author Topic: Basic command script...  (Read 2900 times)

I really don't understand how you guys couldn't figure out what he wanted. To me, just seeing "helloworld" in the function name gave it away
Also this, yea

I hate when people place their brackets like that. Also, please stop being a script kiddie, spamming servers with your joining and leaving stuff, thanks.
I place my brackets like that because that's how I've always learned to script.

I place my brackets like that because that's how I've always learned to script.
You learned a bad habit and will never get rid of it

You learned a bad habit and will never get rid of it
Bad habit? Anything I make will work just as fine with brackets placed like that as if brackets were placed on seperate lines. One time ipquarx was helping me with a script, and he didn't like my bracket placement, so he just changed it to match his. Anyone else could do that if they really think the script is that unreadable.

You learned a bad habit and will never get rid of it
It's not a bad habit.

You learned a bad habit and will never get rid of it
All habits can be broken.

I really don't understand how you guys couldn't figure out what he wanted. To me, just seeing "helloworld" in the function name gave it away
We don't know how he wanted it to display.
In console as an echo? A warn? An error?
In chat in yellow? Centreprint? What?

Bad habit? Anything I make will work just as fine with brackets placed like that as if brackets were placed on seperate lines. One time ipquarx was helping me with a script, and he didn't like my bracket placement, so he just changed it to match his. Anyone else could do that if they really think the script is that unreadable.
Then when you make something actually good and 10k lines... changing it becomes a little more difficult. The part that bothers me is that the { is at the end of a line and } is at the start of a new line
. It really doesn't make sense to me
. Have fun saving two bytes in order to make things harder to read
.

Then when you make something actually good and 10k lines... changing it becomes a little more difficult. The part that bothers me is that the { is at the end of a line and } is at the start of a new line
. It really doesn't make sense to me
. Have fun saving two bytes in order to make things harder to read
.
I'm sorry, but
that's how I've always learned to script.
If it really bothers you that much, complain to this guy for teaching it that way.
My first programming language is Java anyways, and eclipse automatically places brackets like that when you create a new class.
Code: [Select]
public class stuff {

}
« Last Edit: September 09, 2012, 01:34:53 PM by Scars75 »

Hm, like which?
As ^ said, it's the industry standard for Java, Rust users do it the same way, a lot of people do it in JavaScript too.

It's worth noting that the source code for .cs files that may come with Torque engines uses Allman formatting.

from the Solitaire example in TGB:
Code: [Select]
//-----------------------------------------------------------------------------
// Torque Game Builder
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------

/// Set up the cards on the table to play solitaire.

// Sets up the game board to the "start" state of all the cards in the deck.
function Solitaire::resetDeck()
{
   %checkStacks = "aces aceh acec aced stack0 stack1 stack2 stack3 stack4 stack5 stack6 discard";
   for (%i=0; %i<getWordCount(%checkStacks); %i++)
   {
      %stack = getWord(%checkStacks, %i);
      if (%stack.getNumCards() > 0)
      {
         // move every card in the stack back to the deck.
         %stack.transferTo(deck, 0, RESTOFSTACK);
      }
   }
   
   for (%i=0; %i<deck.getNumCards(); %i++)
   {
      deck.getCard(%i).setFacing("down");
   }
}

It's really just a matter of personal preference though. I think with every language, there's a consensus of what formatting is most acceptable for that specific language, but some won't always go by it.

As ^ said, it's the industry standard for Java, Rust users do it the same way, a lot of people do it in JavaScript too.
You said proper syntax, not standard format

BSD K & R format is perfectly valid, too.  It's a de facto standard for C.

Personally, I use both.  I prefer how Allman formatting looks, but once I get into 1000+ lines of code, I'm more likely to use BSD to keep from having to scroll forever through the source code.
« Last Edit: September 09, 2012, 07:26:13 PM by Sevara »

poor op
you tried so hard
and yet failed so badly
:'(

amazing how this topic went from "what the loving hell is the op" to an intelligent discussion on formatting

i like allman formatting