On 8/20/07, Steven Sacks <[EMAIL PROTECTED]> wrote:
> If these students have no experience programming, you just can't start
> with OOP.

Sure you can. Just look at what Alan Kay did with kids and Squeak
(essentially Smalltalk). Here's a good talk by him, btw, much about
learning and computer/interface history:
<http://www.archive.org/details/AlanKeyD1987>
<http://www.archive.org/details/AlanKeyD1987_2>
(Get the Mpeg2, it contains very old footage filmed off a screen)

> I disagree with the statement that AS2 is on the way out.

That it'll take it some time to make it through the door doesn't mean
it's not on the way out.
Yes, some folks will use it for a long time to come, because of legacy
code bases, admins refusing to allow FP9 on their systems, and
unwillingness to learn. But those kids don't have a code base yet,
they don't have corporate clients and they have to learn anyway.

> If you were teaching Java or Ruby, I would say go OOP right away.

Because Java and Ruby don't have arrays? :)

> But
> Flash is only now becoming OOP strong and AS3, while a good step in the
> right direction, is not the absolute best OOP language to teach because
> of all the other things that make up Flash development that have less to
> do with Actionscript and more to do with Flash itself.  Ruby is a
> fantastic OOP language, though it might be a bit heady for newbies.

He's not teaching them Flash development, he'll be teaching them
(OOP-) Programming and using ActionScript as an example. There's a
difference.
But you have a point, at least as long as we're talking about AS2. We
still have a question open, and it explains why AS3 would have been
more appropriate:

"On a serious note, how do you get an "enter_frame" event handler to
work inside an AS file?"

If by AS file you mean a class instance where you would like to call a
method called 'handleEnterFrame', here's how you'd do it with AS3
(from within the class, say, in the constructor):

anyDisplayObject.addEventListener( Event.ENTER_FRAME, handleEnterFrame );

In AS2, it's a bit more complicated. If the class inherits from
MovieClip and assigned to a clip in the library, then you can just
give it a method called 'onEnterFrame'. Otherwise you have to deal
with the scope, which caused problems for so many that they introduced
Delegate to help you with it:

anyMovieClip.onEnterFrame = Delegate.create( this. handleEnterFrame );

For AS2, keep in mind that you can have only one onEnterFrame per
MovieClip, so if you have multiple instance that need the event, you
have to have one MovieClip for each. Or write a class that relays the
event to multiple listeners, essentially mimicking the behaviour AS3
would give you out of the box. (Btw, it may be a good idea to provide
such a class to the students)

Finally, the Bruce Eckel book Johannes mentioned is available online:
<http://www.mindview.net/Books/TIJ/>

Regarding patterns, I would mention them but not put much emphasis on
the subject, at least not if it's a beginner course.

Anyway, I think Flash is a good choice. Mainly because you get to see
results so quickly. It's very easy to make something appear and move
it around, so you have a feeling of accomplishment very early.

Mark


On 8/20/07, Steven Sacks <[EMAIL PROTECTED]> wrote:
> If these students have no experience programming, you just can't start
> with OOP.  They have no foundation to understand the concepts.  You have
> to walk before you can run, and OOP is definitely runners territory.
> Students with no programming experience are barely crawling.  Arrays,
> Strings, Objects, Functions, Variables - these things are your first
> steps.  You can't learn those while learning about Classes, Inheritance,
>   and Design Patterns.  Those things are based on solid foundations.
>
> Anyone here who says they would have been better off if they learned OOP
> from the get-go is dismissing everything it took to get where they are.
>   Procedural code has its purpose sometimes and knowing how and when to
> use it is important, especially in Flash.
>
> I disagree with the statement that AS2 is on the way out.  Jesse Warden
> blogged about that very subject which mirrored my own feelings on the
> subject.  AS2 will be around for some time to come.  The fact is, AS3 is
> such a leap from AS2 most Flash developers will not be able to (or want
> to) make the leap.  Only senior level coders will, and certain bright
> designer/coder types.  Eventually, people might, but agencies will be
> able to turn out great Flash sites with AS2 (even AS1) for years to come.
>
> The fact is, you can still do a lot in Flash by hacking AS1 procedural
> code, and this skill is an absolute requirement in agency work where
> you're working with short timelines, ridiculous client changes
> throughout the process, and the site is a churn and burn never to be
> touched again after it goes live.  AS2/AS1 is going to remain king in
> that very large sect of Flash development for some time to come.
>
> If you were teaching Java or Ruby, I would say go OOP right away.  But
> Flash is only now becoming OOP strong and AS3, while a good step in the
> right direction, is not the absolute best OOP language to teach because
> of all the other things that make up Flash development that have less to
> do with Actionscript and more to do with Flash itself.  Ruby is a
> fantastic OOP language, though it might be a bit heady for newbies.
>
> I think you should consider teaching programming basics, focusing on
> clean code, best practices, naming conventions, etc. and touch on OOP
> towards the end.  The people who are most interested will seek out more
> information, but I think you will lose people if you try to teach OOP
> concepts right out the gate before they even know how to iterate through
> an Array, or before they know what a subroutine is.
>
>
> Steven Sacks
> Flash Maestro
> Los Angeles, CA
> --
> blog: http://www.stevensacks.net
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to