No Clean Feed - Stop Internet Censorship in Australia
«
»

AS3, Flash, Flex

as3 coding style: curly braces in flex builder

04.17.08 | 18 Comments

This is a trivial matter, but it’s been bothering me for some time.

Why does Flex Builder insist on putting the opening curly brace of a function declaration on the next line:

function foo():void
{

.. instead of:

function foo():void {

What is the point of this waste of space, which doesn’t make anything easier to read, but justs wastes space on the IDE and therefore requires more scrolling to read code? It is listed as one of the coding conventions for contributions to the Flex SDK; as the document points out, consistency is the rationale for choosing one over the other: a choice has to be made, and stuck to.

That’s all very well for the conventions for a single project; but this is a styling choice that is hard-wired into Flex Builder. I prefer Sun’s convention. When I’m coding I have two choices: (1) modify the line spacing style for every god damn package, class and method declaration; or (2) accept someone else’s arbitrary standard for my own projects. Why isn’t there an option for this, as per the Java editor in Flex Builder?

[ Update: According to the Flex Builder bug database, this problem has been fixed. Doesn't look like it me, though. ]

related

18 Comments

have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

:

:


«
»
Close
E-mail It