Why Use Standards?
As a programmer, attention to detail, consistency, and thoroughness are critical attributes. Coding standards (aka “coding conventions” or “coding style”) aid and develop these abilities. They make it easier to recognize when something is out of place or incomplete.
Additionally, standards simplify and strengthen team development. If everyone on the team writes with the same style, it can greatly reduce the time it takes to understand each other’s code. If multiple styles exist within a given project, class, or even a single function, a great amount of time might be wasted interpreting the style, before one can even attempt to understand the functionality.
Finally, good standards and naming conventions encourage code that is well thought out and self-documented.
Which Style is Correct?
It should be noted that there aren’t really correct or incorrect styles. The important thing is that the team agrees to comply with a single set of standards, setting aside personal bias for the greater good of the team.
Having said this, there is also no reason to reinvent the wheel or go against the grain. Most languages or industries have standards published by the big players within that industry. For example:
- Adobe (AS3 & Flex Coding Conventions)
- Microsoft (MSDN Coding Style Conventions)
- Apple (Coding Guidelines for Cocoa)
- Google (C++ Style Guide)
The purpose of this document is to suggest a simplified set of standards to be followed for ActionScript 3.0 (AS3) programming. The majority of the standards are directly taken from Adobe’s Coding Conventions (link above), with simplification in certain areas and expansion in others.
Adhering to coding conventions may seem like a time sink, but it doesn’t have to be. A good set of code snippets/templates for your IDE of choice can make much of this process automatic. My editor of choice is FlashDevelop. I have created a robust set of code snippets over the years that adheres to these standards perfectly. You can download my snippets here if you would like utilize them.
AppleInsider just released some details about CS4. They’re saying that insiders call it a “minor update.” Over on Keith Peter’s blog, he argues the point by praising these new features, “bones, 3D, PixelBender, sound synthesis, new text engine, new drawing API.” In response, Steven Sacks comments “Wait a sec, Keith. You’re talking about features of the player/actionscript. Let’s not confuse the language or the runtime with the IDE. You can access the features you listed without using Flash CS4.”
I agree that most of the features I’m really excited about are in FlashPlayer 10 and not necessarily in Flash CS4. But take my company for example. We create Flash games. We heavily rely on inheritance, code reuse, and modularization. We have a great system setup where you can open any smaller module that you want to reuse in a future Flash game, copy a single folder from the Flash Library to your new game, import and initialize the object in the new game, and you’re off and running. This makes creating the ground floor of a future flash game extremely quick and efficient. After 3 years of refining this process, we have arrived at what we believe to be a fantastic work flow from design to engineering.
I am extremely excited and intend on using immediately many of the new features of FP10. The only reason we haven’t already is because, currently, this requires Flex. It would take us countless hours and tons of money to get everything converted to Flex. This simply is not an option for us. So if a new Flash IDE called CS4 came out and was exactly the same as Flash CS3 except that I could leverage all of the new FP10 features *directly from the Flash IDE*, I would be sold without hesitation. As Keith claims, for many, FlashPlayer 10 = Flash CS4. If you use Flex instead of Flash CS3, then feel free to review the latest version of FlexBuilder. But as for a person who leads a team of people who use Flash CS3 40+ hours / week, we are all very excited about the new version.
Although I went on a rant about Adobe yesterday, I really do like and respect the company–even more so today. If you haven’t heard yet, Adobe just open sourced the Flex SDK as of this press release. This is definitely a bold move. From the release:
“The definition and evolution of Flex has been influenced by our incredibly talented developer community from day one,” said David Mendels, senior vice president, Enterprise and Developer Business Unit at Adobe. “The decision to open source Flex was a completely natural next step. I am incredibly excited to deeply collaborate with the developer community on Flex, and further fuel its momentum and innovation.”
Now, although this would normally make sense to me, it doesn’t make half as much sense as it would for Adobe to have open sourced the FlashPlayer, which is not a direct source of income for them. The Linux community has been shouting loud for this to happen for some time now (with good reason, imho). If Adobe doesn’t want to support the FlashPlayer on Linux (which I *completely* understand and even agree with to some degree), they should just open source the FlashPlayer. Doing so would allow the community to create a better Linux player, integrate Flash content into more unique /non-traditional applications on any OS, and generally increase the spread of Flash content across all media platforms. Then, the demand for the ability to create Flash content would increase. If Adobe maintained the control of the applications used to develop the content that is used by these players, this would definitely increase their revenue. This seems like more of a “natural next step” then releasing the Flex SDK.
I say this only to question the true motives for going open source, not just to be another complainer. It doesn’t seem a complete coincidence that Microsoft Silverlight was officially released 11 days ago. But regardless of their motives, I tip my hat to Adobe for this bold move. Like Josh Tynjala talked about, there is definitely the possibility that people will be able to develop Flex and perhaps even Flash content without need for Adobe products. And although they will still have a monopoly on their FlashPlayer, this is not the product that brings in money for them.
In any case, I do agree that this will “further fuel its momentum and innovation.” Which, not so coincidentally, will help Flash platform development to remain more attractive than Silverlight (unless Microsoft follows suit). Way to go Adobe.