I've been asked to test candidates for projects in need of good Flex 2 and AS3 developers for several of my clients now and made a little checklist of things I believe are essential when reviewing their code which I thought I'd share with you guys.

Best practices of course aren't an exact science but these are some 'common sense' approaches I personally look for:

separate the data model from your view(s) This is absolutely essential, don't just mix it into your code logic -- you want to have it loosely coupled.

use public, private, protected and internal scope properly Think about encapsulation and don't just open everything up as public class members for convenience. Access control modifiers were introduced for a reason.

architect your application before you start Make sure you spend some time to draw out your project and get a helicopter view of what it is you are building. There's nothing worse than having to 'glue' on classes as you go along because you hadn't accomodated a particular feature.

event based programming Do not hardcode sequences of method calls, you want your methods to be self-contained bits of functionality.

naming conventions Use a consistent naming convention throughout the project, make the names of your class properties, methods and arguments self-explanatory and avoid at all cost using names like foo, bar, myWorkaroundMethod etc.

commenting your code Don't use code commenting to simply explain what your method does (the name itself should ideally tell you enough) but explain how to use it, what arguments to pass what return values to expect. Commenting your code is different from documenting code. If you need more than 5 lines of comments to explain how to use a method you might want to consider rearchitecting it.

While these practices don't only apply to Flex and AS3 development, without this basis I'll have difficultly recommending someone for any development job.

I'm planning to write a follow up post in a couple of days explaining what I particularly look for in Flex 2 and AS3 developers and some best practices for streamlining the development process when working in a team.

Anything you would add to this checklist?

Posted
AuthorPeter
CategoriesFlash, Flex