incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: [CODE] Short cleanup
Date Fri, 24 Feb 2012 06:17:44 GMT



On 2/23/12 9:28 PM, "Martin Heidegger" <mh@leichtgewicht.at> wrote:

> However I wondered about a few things related to the Flex coding style:
> 
>   - Spaces or tabs? I found that various files currently mix spaces and
> tabs, some have more tabs some more spaces (what was the policy again?)
Somehow, the policy became 4 spaces.  Personally I don't care if it is a
four-space tab or four spaces, but definitely not 8 spaces although some of
that did get in there.
>   - include: It is not my personal style to use includes in the SDK,
> however: Wouldn't it be good if we moved them to classes not named
> "*.as" but rather "*.as.inc"?
Includes should only be in two places: version.as, and some interfaces that
mirror some flash.display.* classes.  I don't think any of the latter
includes are used more than twice, so it might be simpler to just copy and
paste the includes into the files that use them and get rid of the includes.

>   - Version.as: What for do we need that included in every class? Isn't
> that a little excessive? What do we gain from it?
It is used to detect if someone mixed classes from different versions (and
didn't get some earlier failure).  I want to have a version stamp in each
class.  You proposed a compiler change that could eliminate version.as, I
think.

>   - Use of if( "" in obj) or if(obj.hasOwnProperty("")) - which is
> recommended?
Way back when, we were told to use if ( "" in obj) for "sealed" classes and
hasOwnProperty for dynamic objects.  The documentation doesn't say that and
I haven't tested speed.  And, hasOwnProperty must be used in some prototype
inheritance cases.

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Mime
View raw message