Coding Conventions for Flex 4 SDK, some points has no meaning at all

Filed under 3.0, ASDoc, Actionscript, Flex, Flex 4, Open Source Stuffs

Flex Team released the doc for coding conventions in the next Flex 4 SDK, but there’s some points in the document that to me has no meaning at all.

Some folks point out their opinion about the code guide. I disagree with Bit-101 about Adobe fixation on Flex word to avoid this and use as3 as one language. You’re right Keith when you say that but the document as well is only for Flex 4 SDK code guide for Actionscript classes placed on the SDK as well, not the language at all.
But some of point I mean there’s no meaning is the Array part, like you see:

Array indexing
Don’t put any spaces before or after the left bracket or before the right bracket.

Do this:

a[0]
Not this:

a[ 0 ]

Blank spaces are really necessery to worry about it? When you’re working with developers using Mac and PC, you will extra characters over the pile and this point should leave it. Who use both platform will see this in action.

And in the next section of doc they did what they adviced before in array literals

Array literals
Put a single space after the left bracket and a single space before the right bracket, and put a single space after (but none before) each comma.

Do this:

[ 1, 2, 3 ]
Not these:

[1, 2, 3]

[1,2,3]
An empty array is a special case.

Do this:

[]
Not this:

[ ]

Make some confusion here that is missing the point.

And other points are still confusing. Hope not offend anyone who wrote this. Just my view that this document need improvements.

One Comment

  1. Posted April 16, 2008 at 11:50 pm | Permalink

    Personally, I agree with the suggested conventions. Yes, you can argue that white spaces are not directly important to the function of the code, but working in code which looks consistent across all classes and functions is much nicer than code where each contributor has their own style.

    The benefits make the task of building a few small habbits well worth the effort

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*