Be a Supporter!

FlashDevelop cuddle curly brackets

  • 1,191 Views
  • 13 Replies
New Topic Respond to this Topic
DavidHan
DavidHan
  • Member since: Sep. 19, 2011
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
FlashDevelop cuddle curly brackets 2012-06-16 20:03:02 Reply

Hi,

Is there a way to set the auto generated code in FD to cuddle curly brackets (same line curly brackets)?

Do I have to go into each individual preset actionscript file and change it?

MintPaw
MintPaw
  • Member since: Jun. 11, 2006
  • Offline.
Forum Stats
Member
Level 10
Programmer
Response to FlashDevelop cuddle curly brackets 2012-06-16 20:22:19 Reply

At 6/16/12 08:03 PM, DavidHan wrote: Hi,

Is there a way to set the auto generated code in FD to cuddle curly brackets (same line curly brackets)?

Do I have to go into each individual preset actionscript file and change it?

Change presets if you really want. Flash CS cuddles by default, I'm guessing that's what you're used to. I've never seen any coding IDE cuddle, and I suggest you leave it un-cuddled, the whitespace helps reading. You'll get used to it.


If ya have something to say, PM me. I have a lot of time to spare.
Also never PM egg82.

BBS Signature
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to FlashDevelop cuddle curly brackets 2012-06-16 20:24:54 Reply

At 6/16/12 08:22 PM, MintPaw wrote: the whitespace helps reading. You'll get used to it.

I cuddle then leave a space...

DavidHan
DavidHan
  • Member since: Sep. 19, 2011
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to FlashDevelop cuddle curly brackets 2012-06-16 20:39:52 Reply

At 6/16/12 08:22 PM, MintPaw wrote:
At 6/16/12 08:03 PM, DavidHan wrote: Hi,

Is there a way to set the auto generated code in FD to cuddle curly brackets (same line curly brackets)?

Do I have to go into each individual preset actionscript file and change it?
Change presets if you really want. Flash CS cuddles by default, I'm guessing that's what you're used to. I've never seen any coding IDE cuddle, and I suggest you leave it un-cuddled, the whitespace helps reading. You'll get used to it.

I would like to know how approximately how many presets there are to change.
I know about the debate on which method is better, and I am more used to and comfortable with the brackets cuddled. I would simply like to know if it is possible to change it in FD and how much work it would entail. If not, then I'd have to just live with it.

Kirk-Cocaine
Kirk-Cocaine
  • Member since: Aug. 17, 2003
  • Offline.
Forum Stats
Moderator
Level 38
Programmer
Response to FlashDevelop cuddle curly brackets 2012-06-16 20:45:37 Reply

At 6/16/12 08:03 PM, DavidHan wrote: Hi,

Is there a way to set the auto generated code in FD to cuddle curly brackets (same line curly brackets)?

Do I have to go into each individual preset actionscript file and change it?

If you go Tools > Program Settings > Flash Develop and then scroll to indenting and set coding style type to BracesOnLine.

At 6/16/12 08:22 PM, MintPaw wrote: I suggest you leave it un-cuddled, the whitespace helps reading. You'll get used to it.

Fuck you man! Fuck you.

This is awesome:

private function goodBraces():void{
trace("Cool beans");
}

This is vomit:

private function badBraces():void
{
trace("This is a plague");
}

Know the difference. It could save your life.


The water in Majorca don't taste like what it oughta.

| AS3: Main | AS2: Main | Flash Tutorials |

BBS Signature
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to FlashDevelop cuddle curly brackets 2012-06-16 20:50:51 Reply

At 6/16/12 08:45 PM, Kirk-Cocaine wrote: Fuck you man! Fuck you.

This is awesome:

private function goodBraces():void{
trace("Cool beans");
}

This is vomit:

private function badBraces():void
{
trace("This is a plague");
}

Know the difference. It could save your life.

I honestly feel the same way...one time someone sent me his code to look at, and I changed all of his braces to on-line because I couldn't look at the code otherwise. I have a system for adding white space, so my code will always look as pretty and organized s possible :D (I think out of my 3600 lines, about 1/6 is white space)

ProfessorFlash
ProfessorFlash
  • Member since: Oct. 6, 2007
  • Offline.
Forum Stats
Member
Level 32
Programmer
Response to FlashDevelop cuddle curly brackets 2012-06-16 21:04:25 Reply

At 6/16/12 08:45 PM, Kirk-Cocaine wrote: This is awesome:

private function goodBraces():void{
trace("Cool beans");
}

This is vomit:

private function badBraces():void
{
trace("This is a plague");
}

Naw man. Your cool beans give people diarrhea. The plague is of pleasure and everybody enjoys it.


You can solve pretty much any problem you may have with AS3 by consulting the AS3 Language reference.

MintPaw
MintPaw
  • Member since: Jun. 11, 2006
  • Offline.
Forum Stats
Member
Level 10
Programmer
Response to FlashDevelop cuddle curly brackets 2012-06-16 22:42:49 Reply

At 6/16/12 08:45 PM, Kirk-Cocaine wrote: Fuck you man! Fuck you.

Whoa whoa, calm yourself. I was just stating my opinion. Chill, it's default on ever IDE I've ever used, so I assume most uncuddle.


If ya have something to say, PM me. I have a lot of time to spare.
Also never PM egg82.

BBS Signature
egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Supporter
Level 05
Game Developer
Response to FlashDevelop cuddle curly brackets 2012-06-16 23:48:41 Reply

At 6/16/12 08:45 PM, Kirk-Cocaine wrote: Fuck you man! Fuck you.

The fuck is strong with this one >.>

Anyway, i'd have to agree with Kirk on this. Cuddling with or without a space is my preferred way. Though I think i'm starting to like "with"


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
DavidHan
DavidHan
  • Member since: Sep. 19, 2011
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to FlashDevelop cuddle curly brackets 2012-06-17 01:24:31 Reply

At 6/16/12 08:45 PM, Kirk-Cocaine wrote:
If you go Tools > Program Settings > Flash Develop and then scroll to indenting and set coding style type to BracesOnLine.
Know the difference. It could save your life.

Thanks, but I noticed that mine was already set to "onLine". I think it's just the presets that come with uncuddled.

Sandremss128
Sandremss128
  • Member since: Aug. 22, 2009
  • Offline.
Forum Stats
Supporter
Level 11
Programmer
Response to FlashDevelop cuddle curly brackets 2012-06-17 06:04:42 Reply

I used to have a whitespace after an opening bracket always because it makes you see the scope of a function immediately. When I went to the university and had to hand in some code I actually got point reduction because of this.. I argued its a matter of personal opinion but they said its the standard and I should comply with it.
When you are more experienced with reading and writing code you don't benefit much from the clearer scope and you'd benefit more from more code on your screen.
Especially when writing code with others you have to have strict conventions and its the industrial standard to have the braces online.

But still I think its fair to state the ultimate code formatting:

private function onPerfectFormatting(event : MouseEvent) : void {
	//ultimate formatting
}
HAROfficial
HAROfficial
  • Member since: Jun. 16, 2011
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to FlashDevelop cuddle curly brackets 2012-06-17 14:25:32 Reply

OKAY, I don't see why people are arguing here. Neither styles are better, it's down to personal preference. As long as people who cuddle are able to read the code of those who don't and vice-versa, I seriously do not see the issue here -_-


Stage3D is awesome.

Sam
Sam
  • Member since: Oct. 1, 2005
  • Offline.
Forum Stats
Moderator
Level 19
Programmer
Response to FlashDevelop cuddle curly brackets 2012-06-17 17:13:40 Reply

At 6/16/12 11:48 PM, egg82 wrote: The fuck is strong with this one >.>
At 6/16/12 10:42 PM, MintPaw wrote: Whoa whoa, calm yourself. I was just stating my opinion. Chill, it's default on ever IDE I've ever used, so I assume most uncuddle.

Pretty sure he was just taking the piss.

I can read either, personally - I write cuddled but prefer reading it un-cuddled.

MintPaw
MintPaw
  • Member since: Jun. 11, 2006
  • Offline.
Forum Stats
Member
Level 10
Programmer
Response to FlashDevelop cuddle curly brackets 2012-06-17 17:31:52 Reply

At 6/17/12 06:04 AM, Sandremss128 wrote: private function onPerfectFormatting(event : MouseEvent) : void {
//ultimate formatting
}

Egh, the spacing with the colon like it's an operator really bugs me.

private function preferredMethod(event:MouseEvent):void
{
//ultimate formatting
}


If ya have something to say, PM me. I have a lot of time to spare.
Also never PM egg82.

BBS Signature