This used to be one of those after-midnight rambling posts, but I've boiled it down:
Branden once expressed to me that there can be too much OOP in Flash. Real-world development is about making your user/client happy. When Branden moved the Flash community towards object orientation with ACK, his framework complemented Flash technology. Against all odds, Nigel then laid the foundations for a component model that tried to fit within Flash technology, but Macromedia made the mistake of ignoring all the lessons learned from his first attempt. Instead, Macromedia avoided correcting architectural flaws in the Flash player, resulting in the MX 2004 component framework that fights against Flash technology rather than extending it.
Recent debates with Chris and Devon have led me to several observations: Computers were not meant to create a demand for coders; computers were meant to solve problems.., it's about getting your ideas implemented sooner so you can iterate sooner. Fortunatley, Flash is like the Perl of UI; easy to write, easy to deploy. However it's also difficult to re-purpose, and difficult to maintain. Using Flash as a UI Framework or IDE will result in much pain. Love it for what it is: a kick ass design tool. Creativity is at the heart of Flash. Macromedia will hopefully seize the opportunity to re-architect the flash player one day to support maintainability as well as creativity, but in the meantime for my situation, the most correct way to use Flash is to write incorrect code. That's fine, I still feel the Flash love :)
p.s. This freaks out people who write correct code:
Posted by samuel at September 10, 2004 12:09 AM
// fake dragging
var offset:Object;
function onPress() {
offset = {x:_x - _parent._xmouse, y:_y - _parent._ymouse}
this.onMouseMove = function() {
this._x = _parent._xmouse + offset.x;
this._y = _parent._ymouse + offset.y;
updateAfterEvent();
}
onRelease = function() {
onMouseMove = null;
onRelease = null;
}
}
As a Flash developer, I completely disagree with what you're saying here.
Posted by: Mike at September 10, 2004 10:03 AMThank you, Samuel!
I have been at odds w/ Flash lately - I often find myself saying "Why do it that (new) way, when this (old) way is faster, easier and it works?"
Yes, the idea of a completed application/project written in proper AS2 code is appealing. However, the early stages of the development process (storyboard > mockup > prototype) are significantly hampered by concerns over project/code architecture.
The strength of Flash development was always the immediacy of concept prototyping. Sure, it was difficult to port code from project to project, but w/ some forethought, certainly not impossible. The main issue is the net time it takes to build and deliver a single app to a single client. Maybe when building enterprise level applications w/ 6+ mos. development cycles and a team of Flash developers, AS2/OOP makes more sense. For most RIA development, however, I find it hard to justify the cost/benefit of "proper" code.
So what if the JAVA programmers wag their fingers at you, if you're delivering an outwardly superior product to market faster?
Posted by: craig babcock at September 10, 2004 12:04 PMYay! This is pretty much exactly my proposed topic for FlashForward 2005 :-). Thanks for publishing this Sam, I think its high time we started re-evaluating some of the classic methods.
Posted by: David Emberton at September 10, 2004 10:32 PMI think its funny that the person who disagrees with you has nothing more to write than just to say he completely disagrees. Why he disagrees would be a lot more useful to know than to just know he disagrees.
Posted by: Patrick at September 11, 2004 12:42 AMWhile I don't think it is significantly harder to write 'correct' code, it does require more planning. So the rule I use in Flash boils down to 'how large is the project'. Anything less than 1000 loc or so, and sure, whatever works. For anything bigger, I think there are real benefits to using a stricter oo system.
However! The big benefit of using an oo system is, imo, that your code is less likely to let you get away with mistakes. The nature of javascript goes the other way, where pretty much anything is ok. So the benifits in Flash are way smaller than in a language like Java or C#.
So if I did Flash all day, and I didn't know oo, I wouldn't be too worried about it. It might not be worth the learning curve. But if one understands oo already, not sure how/why you would want to do things another way. That kind of event code can get really confusing if you scale. If not, well yeah, let's just say I can't cast any stones ; ).
Posted by: Robin Debreuil at September 11, 2004 04:09 AMHey Robin :) I agree, it's all about scale, and choosing the right tool/methodology for the job.
"But if one understands oo already, not sure how/why you would want to do things another way."
If I understand how to drive a car, but all I have is a bicycle, I could do some cool tricks on the sidewalk but would be prudent not to ride on the highway.
Posted by: Samuel Wan at September 11, 2004 02:35 PMWe're forgetting a time when Flash was a joke, laughed at by most developers. Now it has true object orientation, standardized components (usability!), Flex, AS2, increased accessibility, etc. The possibilities with Flash 2004 have hardly been realized in real-life projects because the technology is still maturing. Design tool my a** -- this post rubbed me the wrong way, for obvious reasons. Forget corporate agendas and "flash killers" and help advance the technology rather than take the easy, cynical way out.
Posted by: Mike at September 23, 2004 01:28 PM"Advancing the technology" does not mean turning a blind eye to the weaknesses of flash. Flash is great for what it can do but contrary to what I thought just a year ago, flash is not the perfect answer to every problem.
I work at a major entertainment/information website and am finding that a backlash against flash -- primarily because of its issues with usability and search -- is definately beginning. Try finding any content in a flash website through Google and you'll see how flawed flash is for standard web site content.
Anyway, I agree with Samuel that flash is a killer design tool and can be great for interactive on-line and lightweight apps, but I do not believe that Macromedia will ever be able to push it as a major player in heavyweight applications --in fact its place in website design altogether is very much in doubt.
"When all you have is a hammer, everything looks like a nail" ; )
Posted by: brian at September 27, 2004 08:17 PMHi Samuel
love your OOP book, even though not AS2
came here to look at xilhouette you mention in the book (not in the download files, but found it here)
hope you aren't selling out on Flash
makes one wonder, and if Avalon is going to blow it all away
Flash does seem a unique and quite powerful tool
and the class based structure does give (and enforce) some clear structure without getting in the way very often
the tech world all changes pretty quickly but a pity for MS to swallow this as well
reminds me of the saying that some dominant cultural forms offer the same respectful terms for co-existence as the female praying mantis offers her "partner"
surely flash can be extended way beyond pretty graphics - your book is a stepping stone to its serious use, and i hope we're not saying it has no future
cheers and thanks
Rob
Posted by: rob at January 31, 2005 03:21 AM