Blog

  • Prototype Solutions

    Reading the Pragmatic Programmer on and off for the past few months. I have an extremely short attention span, so when I’m burnt out of coding, the History Channel, and the Legend of Dragoon all at the same time, that’s when I read. Fallen tree in my backyard, bills, sending invoices, laundry, and the rest are only done in dire circumstances.

    I haven’t gotten all the way through it, but I managed to hit the part about “Tracer Bullets”. They discuss the two traditional ways of developing (enterprise) software (as of 2000).

    The first is where you gather a few non-specific lists of requirements from the customer, document it to hell in the form of “business requirements”, sign off, code for years in a dark cave, bring all the modules together, fix the bugs enough to get a working build, and deliver to the customer. Naturally, there are tons of problems with this approach, but I see this repeated time and time again in larger companies.

    The second is their tracer bullet approach. You basically build a shell of the app you think will work, get enough of the skeleton working so you can compile, and show to the user to get feedback as well as understand any performance issues (if any). While slower on the uptake for the developer since you’re building the real framework, it’s quicker for the user & management to actually see progress. The user’s can more quickly give feedback, and you can more accurately see if you are “on target”, and where you should adjust accordingly, with real, already working code. You continue with the same code base you started and the user accepted the first initial build. Sounds a lot like Agile Development.

    The third is the prototype. Disposable code, written for the sheer point of proving, or disproving, theories. Will this design work? Will this algorithm scale?

    Prototypes are great to get a design in front of a customer with fake data to see if the wire frames/storyboards accurately depicted what the user wants without spending copious amounts of time implementing the GUI. This plays more of role in things like C or Java where GUI work is more time intensive than something like Director or Flash, which buys you more time to try more ideas, or further refine existing ones at a cheaper cost.

    The second is to test your algorithms. Whether that be in the same language (ActionScript) or you’re just using AS1 because it’s lighter weight and quick, like JavaScript just to do a proof of concept. Strict data typing, classes, and the like get in the way if getting something done quickly. They help you during debugging & maintenance, that’s why you use them. If you want something done, and done fast, using a loosely typed language frees you from unnecessary restraints to get a prototype done quickly.

    It can also be said that prototypes offer a low-risk entry point to software. If you spend 2 weeks of balls-to-the-wall development to get a prototype in front of a potential client, and it fails, you only lost 2 weeks vs. 3 months. If however your client wants tons of features for v1 and expects them to happen in another week, you’ll have a tough time explaining why it’ll take 3 months just to get to the point where you are now so you can then spend another month adding those features. Thankfully, that’s not my job… yet.

    Game development is another potential area which can benefit from prototypes since you have to be pretty much half-done to pitch an idea, even when applying for a license to an existing brand.

    Now, in my profession I do everything in the same environment and language. I code in Flash or Flex Builder, usually in AS2. ActionScript is flexible enough of a language to allow you to write both the quick stuff, and the more time consuming strict typing stuff. Apparently in other professions, you realize that you can spend 3 days writing your algorithm in something like Python vs. C, and save that much more time down the road. When comparing AS1 to AS3, I can understand why.

    Spending copious amounts of time writing:

    en override public function getName ( id : Number ) : String

    vs.

    function getName ( id )

    …or a 500 line app that you have no intentions of maintaining, debugging, nor putting into production. Not to mention the fact AS1 is case-insensitive if compiled in Flash Player 6 or below.

    I think a lot of my career was built on prototypes… at least, according to the Pragmatic Programmer.

    Yes, I’ve written software that was not a prototype, but I still think the majority of my work, even if not viewed as a prototype, was if using the above criteria. Now, hindsight is 20/20 (to the beholder anyway), this doesn’t mean me, my former teams, or any of the companies I’ve worked for could of done anything different at the time. It’s just an reflection I have finding commonalities with my experiences and the concepts in the book.

    Adobe (at the time Macromedia) once akin Central to having the aptitude for disposable apps. At the time, there were 2 specific applications for Central that had a warm reception for the most part. One was an application for conference information on MXDU 2004. The second was one for MAX.

    When you look at it from the 30,000ft. view, it makes sense. You code a minimalist back-end to get just enough working data, bust out a design, implement in Flash, code enough to get her working, and deploy for a hard deadline. Hard meaning, non-negotiable, non-changing. After the deployment date, the app has exceeded it’s usefulness, and thus its lifespan. At that point, it’s merely a point in history with which to use for reference in essays like this.

    It’s disposable. It’s a prototype.

    …but it’s also a solution. It worked, satisfied the goals of the project, solved the problems the software was created to solve, and was successful. There were no tracer bullets fired, business requirements were 1 page or less, consisting more of a contract-to-hire and days of furious coding.

    I’ve seen that same scenario played out over my technology tenure, except with non-hard deadlines, particularly with Flash projects. One of the reasons I transitioned from Director to Flash for my multimedia projects was because it was faster to get things done, and I could have my entire team work with me. It was RAD, rapid application development, to a point. Flash empowers you to get things done, and get them done quickly with a lower barrier of entry (unless you’re a server-side, anti-GUI/pro-AJAX Java developer, in which case when you wake up in a cold sweat, know that the timeline is out there… in the dark… waiting…).

    I’ve seen cases where documentation was done out of sheer CYA (cover yer arse) from past negative experiences. In the end, it didn’t help. All that mattered was how fast you coded, and how well she worked. If the user didn’t like it, you either re-coded, or spent long nights & mornings untangling spaghetti code to “friggin’ work!”.

    The point of a prototype is to challenge assumptions, identify risk(s), and confirm good technical decisions. The point is not to deliver software because of the results of the above described process.

    From a business retrospect, I don’t think it’s sad. If you look at a lot of some of the older projects that have been done with Flash, from movie websites, games, e-learning, and modules into larger applications… they were launched, the customer was happy, and people got paid. Flash, for those who were in the know, got a great reputation. I don’t think all were developed as prototypes by the Pragmatic Programmer’s definition, but I know many that were, and the untrained eye wouldn’t know the difference on most (aka, the user).

    Still, I think it de-values good software in a way. I’ve made the comment copious amount of times about how, “I never ‘maintain’ Flash projects I’ve created. Preposterous, just re-write!”. While true, I’ve also found re-writing easy and fast, mainly from the tool & language, but also from a development perspective; developers like to create, most don’t like to maintain, and we all always hate our work and want to do it over, better the next time.

    That attitude has actually served me well, but only because I’ve been mainly in the service industry vs. the product industry. Meaning, every job I get, full time or contract, is always something new for a new client rather than a software product I create on my own terms and maintain.

    The mere fact I know OOP, MVC, ARP/Cairngorm, and other design patterns, while having everything to do with wanting to do things “better”, has resulted in usually larger scope prototypes rather than converting me to product work where such things are more applicable. I am merely more adept at handling & reacting positively to scope creep. Granted, a lot of service work is to create enterprise solutions for large customers which have long life spans… but I’d argue those are products. Still, it can go both ways. You can use Cairngorm in a Flex prototype as well as in a finished product.

    Is this bad? Do customers really know they are getting prototypes? Do they care?

    For most projects, I’d say no. Working software is working software. Given the challenges, that right there is success. A lot of the smaller scale Flash projects I’ve seen or done aren’t usually maintained, or changed a whole lot later in life. This could mean a lot of things, like they got it right the first time, the goals need to be hit one time, or there really isn’t room to grow (room meaning budget), etc.

    Do customers care? Don’t think so. I do think however clients I work for do. 3 months up front costs you less after the fact vs. 2 weeks. The project will still take 3 months no matter what resources you throw at it. If you want it done faster, you have 2 options:
    – create a prototype in a short timeframe knowing that the cost of changes & maintenance will be astronomical in the time they take post-deadline. Therefore, you’re better off coding from scratch after you hit the deadline. (See the pattern?)
    – hire some serious bad-asses who can create prototype code, using existing portable classes from their repertoire, and pass it off as a product vs. a prototype. This’ll cost you more bling as well.

    So, if customers are users, no. If customers are clients you are coding for, yes.

    I haven’t gotten to the chapter of “Good Enough Software”, so maybe that will provide more insight. I will say, though, that the only reason I’ve been able to survive this long is because of Flash & Flex’ flexibility combined with my learned skills to manage scope creep. If I were trying to do the same career over, except in something lower level like Java, I think I’d kill myself. Not on purpose, mind you, just because of the stress my body would just shut down. Object.prototype, MovieClips, and a portable runtime (Flash Player) have gotten me out of more jams under insane timelines.

    If I ever start a company, I’ll clearly articulate the difference between a prototype and a product to my customers since I still feel it is not within an engineer’s decision jurisdiction to make the call on what is more appropriate for a project; prototype of non. Sometimes deadlines are make or break, non-negotiable, failure is not an option endeavors. In that case, there is no question, only action.

    The prototype is cheaper and faster to build, and time has shown prototypes can function quite well in deployment. The trade-off is they don’t scale (sometimes), and the change & feature addition cost is extremely expensive.

    A product on the other hand takes more time to build, and time has shown that visually & functionally it nigh impossible to tell the difference between a prototype and product to non-developers; if it works, it works. The gain is more scaleable code, and shorter timelines to make changes & add features.

    After reading Web Development 2.0 from Web-2.0-Propaganda-Central, it seems like a combination of the above techniques is needed to be successful in the ASP model; software as a service.

  • Firefly: Lego Serenity

    This bloke named Chris Doyle made the spaceship named Serenity from the sci-fi TV show Firefly out of Legos. It was also made into a movie named Serenity. He made the cast, has it light up, and even created wallpapers. I love the interweb.

    Via her majesty.

  • Simultaneous Fork

    I am developing in ActionScript 2 and ActionScript 3 at the same time. I decided to branch the project when I got a stable build. However, upon finding a bug during conversion (Flex Builder 2 rules), I had to document the change (quick note in Notepad) and go back and fix it in the AS2 codebase.

    Upon a 4 hour development stint in the AS2 codebase, I found 3 bugs and fixed them in 3 different classes. I forgot to document them. Now, I’m contemplating the best way to handle a forked build in the allotted timeframe.

    It seems the best thing to do is get the AS2 codebase to a working point, freeze it, and then start converting the existing AS2 codebase from that point forward to AS3. The mantra “garbage in, garbage out” seems to come into play here. Starting with an already flawed codebase seems a guarenteed failure scenario. I’ve read about a successful venture using the Subversion branch feature. They had to fork the build since they wanted to try something else, found out it wasn’t such a good idea, and removed the build without affecting the main codebase.

    The key now becomes being able to successfully do a time estimate so you know when you have to freeze so you allot yourself enough time to convert the code base, test, and get it to a freezing point as well.

    Anyone had experience writing in dual-languages for the same codebase before? How did you handle it?

  • Flex 2 Beta 1: The 411

    Adobe has released the Flex 2 Beta 1 at the labs. What is Flex 2? Just read the first paragraph if you’re in a hurry.

    The big news is that the Flex SDK will include the Flex Framework 2 and the command line compiler (compc) + documentation for free with no licensing or extra charges to develop and deploy applications.

    So what’s new & cool and what’s changed from Alpha to Beta? You can find out on the labs, but I’ll go into more detail here.

    Flex Enterprise Services 2

    Flex Enterprise Services 2 is basically a Remote Shared Object server. Yes, there are other hooks for connecting to various back-ends with the goal of getting the server pushing data to clients, but to me, it’s a bigger deal. For years I’ve been in love with Flash Communication Server, now called Flash Media Server 2, because of it’s Remote Shared Object. Basically, an RSO is an object that has it’s data synced amongst n-clients in real-time. You don’t have to write sync code, you merely get events when it’s updated, and any client can update the object. This is awesome.

    However, Flash Media Server, a.k.a. Flashcom, had a lot of feature baggage involved with creating licenses. The majority of the apps I wanted to create had absolutely nothing to do with real-time video and audio conferencing, thus paying for those features seemed dumb. XMLSocket and Jabber are alternatives, but I hate parsing XML, even if it’s abstracted in a library. I like it low-level, simple, and fast. Flex abstracts this into 1 tag. Sick! Even cooler is the ability to use it free of charge for a limited amount of users on a non-clustered server. YUM!

    So, I like to think of FMS as Video + Audio server whereas FES is a Remote Shared Object server. My future’s more clear. I know what I’m talking about at MXDU 2007. Let’s hope Influxis.com (or MediaTemple.net) implements this into their product plans. I’d be willing to pay more since this is exactly what I want and need for projects.

    Flex Framework 2

    The ultimate component set has some new features you can now utilize in the beta. The inline MXML item renderers is basically an easier way to do cellrenderers. Instead of having to create a class and associate with your List or DataGrid, you can now build it inline, meaning pure MXML. A lot cleaner, a lot more centralized, and less dependencies. You can even define an <mx:Script> tag in there to support methods if need be. Dig it.

    The layouts for Application and Panel now support the big 3; absolute, vertical, and horizontal. Typically in the past, you’d nest a VBox, HBox, or a Canvas in there to do your layout. Now it’s just a property of the containers which results in less tags, better performance of your app, and faster to design.

    Also, you can now make Ghost Children; basically CSS’ visible:none. For Containers, you can now designate children as Ghosts, and they won’t be included in the layout. This makes them tons more flexible since sometimes you want things in a component, but don’t want to be forced to have it included in the layout routines.

    Flex Builder 2

    You can now treat projects, MXML and ActionScript, as SWC resources. SWC’s are to Flex as JAR’s are to Java. Basically, you can treat your project as 1 big SWC, and all resources, classes, etc. are packaged up into an SWC; a zip file that other projects can then use. This helps when development components and utility classes because it greatly reduces the amount of folders and files in your project, and for larger projects, keeps things modular, more organized. You can now just link to the SWC as a project library. It’s supported for Remote Shared Libraries too, but in my opinion, the infrastructure to keep them organized for large projects isn’t there… yet.

    I’ve already talked about the View Source built-in, which is my favorite addition.

    The code hinting has gotten tons better. If you type in a class, and it’s not imported, it’ll automatically add the import up top. Additionally, when writing nested MXML tags, it’ll only show the tags that are associated with that component you are currently in which helps a ton if you’ve forgotten the property name, and quickly types it for you.

    We also now have the HTML template source in our projects to control the HTML wrapper that our SWF’s are embedded in. The good news is HistoryManager is included in this, but you can also tweak if need be.

    The Help is really nice. If you select something, and hit F1, the Help tab will open and show topics for what you highlighted. If you keep it open, and highlight other stuff, it’ll re-search. Don’t forget to highlight the WHOLE classpath; meaning, highligh flash.events.Event instead of just Event.

    ActionScript 3

    There is the Void to void which I mentioned yesterday. It’s merely a find and replace to change those, although, getting out of habit typing uppercase is hard… 3 years of habit isn’t undone in 1 day.

    Object can no longer store undefined, but it can store null. As such a new type, no type, called “*” is introduced. This also has the benefit of telling the compiler, “Yes, I untyped it for a reason, bro, trust me.” So:

    private var v:*;
    
    public function f(p:*):*
    {
            ...
    }

    Is the same as:

    private var v;
    
    public function f(p)
    {
            ...
    }

    Only the compiler will leave you alone for the first one.

    The coercion rules are a little weird, so I’ll defer to the docs for those who care.

    Event’s have been cleaned up; there are no “Type” classes. Meaning, EventType is gone, and everything is in Event, like Event.COMPLETE for example. Same goes for KeyboardEvent, and MouseEvent, etc. It’s easier to just delete the Type imports up top in your class, then do a find and replace; pretty quick.

    Effects now use play and end vs. playEffect and endEffect… less to type! Additionally, they now support pausing, reversing, and resuming. Hell to the yeah.

    Conclusion

    That’s the good stuff. Yes, ColdFusion now supports ValueObjects, and the Charting Components are there, too. We still need a simplier framework or set of ANT scripts for RSL’s, but I’m still learning all the ramifications and specifications that go into it, so hopefully either someone will blog a solution soon, or it’ll be in the next beta. For a full list of changes, check the docs and the labs site.

    BTW, this is where the Flash Platform shows it is a more innovative and useful model vs. AJAX. When new features are released, getting the public to upgrade their Flash Players to the latest version to take advantage of those features happens light years quicker and easier than getting those same customers to upgrade their browser(s). Some numbers to corraborate.

    Other bloggers with converage: