Crummy Freelancers, Coding Guidelines and Actionscript Libraries

March 8th, 2007 | by Matt |

As of late I've been thinking about just how important it may be to have some structure for fellow Flash Developers at Rokkan. Naturally, this means two things: 1) A coding standards/guidelines document, and 2) some sort of "company" Actionscript library to pull from to support the guidelines and techniques. I really like the idea of these two things, especially after a little incident that happened recently when we hired a freelance Flash guy to help out during a busy spell.

Unfortunately I had no part in hiring the guy so I couldn't give him a quick quiz or anything like that. But while he was working with us he took care of a few small things that we're pretty much just busy work. I didn't work with him directly, but I had once overheard him say to a designer that he felt like he was behind in his skills and wanted to "redo" the code he had written for a small project. I thought that was a good thing. But to my dismay, when I had to make a change to the work he did when he was not available, I had one hell of a time trying to figure out the approach, let alone all the code. I didn't think people still put code on movieclip instances! So what should have been a simple promo manager was turned into a complete and utter mess of illogical variable names, horrible encapsulation and bizarre XML techniques. It took me over three hours to make a change that should have taken 20 minutes. This is what sparked my concern.

Its probably like this with most other types of projects and other programming languages, but I almost feel like Flash projects need extra attention in order for multiple people to be involved and have everyone understand just exactly whats going on, where to find code, where to put code, where to save assets, etc. So far it seems that every shop, every freelancer, has there own way of doing the same things. Thats the beauty of Flash, right? Yeah, I guess so. Is it bad that I'm finding it annoying when you can't look at someone elses code and immediately understand it? I often find myself going through someones source code and restyling it, and sometimes changing routines to my liking.

At any rate, over the past week or so I've been writing a guidelines document to try and prevent things like this from happening again. At first the idea was a bit daunting, but luckily a developer at dClick posted his guidelines doc on the company blog. This was specifically for MXML and AS3, so I just used the AS3 section as reference for my AS2 guidelines. I also added a bunch of other stuff, like our preferred project folder structure and library folder structure. Forcing myself to create this document was a good exercise is self evaluation too. I started to realize just how lazy I can get sometimes with my code, especially with techniques (I'm pretty anal about my style). So while it was one really tedious project, I'm actually very happy that I forced myself to do it.

Now that I'm happy with the state of the guidelines doc, I've started to move on to working on compiling an AS library that supports the techniques and what not. The first thing that came to mind was an events package. After getting into AS3, I discovered the advantages of event types. I'll never go back to generic event objects. The second thing that came to mind was a utils package. I started organizing a bunch of utility classes that we had created over the course of a few projects into one package. These included StringUtil, ArrayUtil, Timer, LoadQueue, HTMLFormat and DateUtil. I hope to keep adding to this package. The third thing, which I'm moving onto now, is a UI package. This is a bit more complicated, as a lot of UI controls that we created were somewhat custom, and often do not include a substantial amount of flexibility for use in a different context. This will definitely take some time, but I'm up for it!

I'm pretty stoked on the idea of having all this available for contractors, freelancers, and other employees. Although, at times I almost think its total overkill. I'd like to hear some opinions about this type of stuff. In all your experiences, is a guidelines document necessary? Is it good to force people to use a standard code library for things like utils, events, etc? Am I overreacting? Do I need to take things further?

Also, if you'd like to download and critique my guidelines: .PDF or .DOC

  1. 4 Responses to “Crummy Freelancers, Coding Guidelines and Actionscript Libraries”

  2. By Brian Dunphy on Mar 8, 2007 | Reply

    I think it’s important when hiring on a resource, whether it be full time or on a contract, that the team lead (or whoever might be in the right position) sit down with said resource and go through coding standards and guidelines, technologies used, etc. The last company I was involved with (first as a freelancer, then as a full time employee) did this quite informally, but it was a great way to get a feel for how they wanted things to be done.

    Different backgrounds lead to different techniques in programming. It sounds like your resource was a designer turned developer, and maybe some old habits carried over.

  3. By Chris Jenkins on Mar 8, 2007 | Reply

    You are doing exactly the right thing, I did this some years ago and have never looked back. The really difficult part is keeping everyone on a par with their approach, libraries and guidelines will only get you so far, but you really need to develop or adopt a standardized approach to the whole development process. Flex makes this easier as it is based on a pretty standard OOP methodology which has been around for decades. Id say you can never be too strict, police it like all hell, your company will benefit as it saves time in development costs, your developers will also benefit as they get to go home on time, and having a common approach really helps foster a good community at work, which is important.

  4. By Simon H on Mar 8, 2007 | Reply

    These guidelines are good. Last time I checked Macromedia/Adobe hadn’t updated their guidelines, which still refer to AS1 style syntax(correct me if i’m wrong).

    I think it’s a shift in mindset that’s required really, similar to switching from a table based layout approach to css approach. AS1 gave/gives you a lot of freedom to be quite random with code layout, whereas AS2/3, if used correctly, guides you into thinking a different way about how you structure your whole app/game/site as well as code.

    Flash has always been good at allowing you to get ideas out quickly. AS1 was great for that, putting code in movieclips was great for that.

    It’s difficult, but I wouldn’t be too hard on those people who haven’t made the switch, some don’t need to or even want to.

    AS2 is, so far, the best thing that’s happend to Flash, hopefully those people still using older methods will see the light soon.

    As for untidy libraries, I can’t stand them! They are really my pet hate. Nice to see someone attempting to standardise them (If that’s even possible). Good luck with it.

  5. By Mike on Aug 28, 2007 | Reply

    The larger the team, not only the harder it gets to get everyone on the same page (in style, quality, documentation, etc), but in the Flash world (and I suspect other languages suffer the same narcissistic fate) everyone thinks they’re king.

    Documentation is forgotten on all, except only on the few who stayed awake long enough in some CSE class. Yet how many of the masses utterly depend on the livedocs / API reference? Scores I would assume.

    Like many sentiments already expressed be diligent, and for the Flex / AS3 world as well as AS2 (see as2doc) with some outside help, use the consistency of JavaDoc style comments, it helps with not only maintaining source, but the continual update to the documentation as well. Where I was last at, I was the only engineer (amongst designers, designer turned developer) and I even took it a step further to create pseudo UML diagrams in visio to convey complex components and frameworks.

Post a Comment