Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-22 Thread Ian Thomas
In reply to Steven:
- Firstly, Wikipedia isn't a great source to quote. :-D
- Secondly, OOP as a style has basic stuff, and it has advanced stuff. I'm
not saying teach inheritance and polymorphism on day 1, I'm saying teach
that objects have properties (and then objects have methods). Not
necessarily because it's _better_ than procedural (we could argue that
forever) but because _almost all day-to-day programming languages that the
students will encounter will involve objects, properties and methods_.

In reply to Alan:

Your first example applies equally to OOP or procedural - it's a code
snippet, not a coding style.

Your second example is overcomplicated - why teach getters and setters from
the word go when a property (public var age:Number;) is far simpler/more
obvious? Yes, getters and setters are part of the OOP paradigm, but not a
requirement.

Ian


On 8/21/07, Alan MacDougall [EMAIL PROTECTED] wrote:


 So rather than engage in an argument as to whether OOP or procedural is
 better, we're basically asking: Do the additional distractions of OOP
 justify the payoff from learning it up front? If you're teaching fellow
 geeks, then yes. If you're teaching people with a more casual interest
 in programming, or (shudder) people who are required to take the class,
 you may want to keep it script-simple. Compare:

___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-22 Thread dr.ache

Dave Mennenoh schrieb:
I usually find it pretty awkward to try and objectify an entire 
project - it just doesn't help. I find the combo works quite well for 
me - and besides, it's still all oop if you think about it...
how big must a project be, so you start objectify your code? you do 
not need OOP for
flash banners(in some context debatable) nor for a little flash menu 
which controls a html page.


but at the moment you program a flash site with different pages and 
content, i cannot even

imagine doing it completely procedural.


Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/
___
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


Re: [Flashcoders] Intro to OOP using ActionScript: patterns derail!

2007-08-22 Thread Dave Mennenoh
How do you handle onLoad's famous scope? ... It is not magic or advanced. 
If a pattern was shown to a new programmer without giving it a fancy name, 
they would just accept it as the best way to do the task and would never 
give it moment's thought.


Right. Delegate - ie Proxy. I agree. I wasn't saying patterns shouldn't be 
taught, or used - I doubt you could teach a Flash class these days without 
teaching Observer, but you might not ever call it that. In fact, I wonder 
who does call it that in a class? Actually, the more I think about it, I 
think for students it might be best not to call these patterns and just 
teach them. Then, once they know how to use them, tell them what they are. 
It's a bit like teaching encapsulation I think - if you just show your 
students how to write classes, and they see how classes work for organizing 
code, they will likely just use them.




Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ 


___
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


Re: [Flashcoders] Intro to OOP using ActionScript: patterns derail!

2007-08-22 Thread Ron Wheeler



Dave Mennenoh wrote:
How do you handle onLoad's famous scope? ... It is not magic or 
advanced. If a pattern was shown to a new programmer without giving 
it a fancy name, they would just accept it as the best way to do the 
task and would never give it moment's thought.


Right. Delegate - ie Proxy. I agree. I wasn't saying patterns 
shouldn't be taught, or used - I doubt you could teach a Flash class 
these days without teaching Observer, but you might not ever call it 
that. In fact, I wonder who does call it that in a class? Actually, 
the more I think about it, I think for students it might be best not 
to call these patterns and just teach them. Then, once they know how 
to use them, tell them what they are. It's a bit like teaching 
encapsulation I think - if you just show your students how to write 
classes, and they see how classes work for organizing code, they will 
likely just use them.



That is what I have been saying from the start of this discussion.  You 
do not have to teach the fancy names. Just teach them to use proper 
coding practices. OOP and Design Patterns are just names that we use to 
group a bunch of best practices into theories so we can discuss the 
theory and have a framework to critique code. I have a feeling that for 
most of us, the word polymorphism is not much of a help and I see no 
reason to even use the word on 14 year olds until the last week of class 
and only then as a warning that someday someone might try to use it on 
them in a discussion about design.


Ron


Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/
___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-22 Thread Ron Wheeler



Ian Thomas wrote:

In reply to Steven:
- Firstly, Wikipedia isn't a great source to quote. :-D
- Secondly, OOP as a style has basic stuff, and it has advanced stuff. I'm
not saying teach inheritance and polymorphism on day 1, I'm saying teach
that objects have properties (and then objects have methods). Not
necessarily because it's _better_ than procedural (we could argue that
forever) but because _almost all day-to-day programming languages that the
students will encounter will involve objects, properties and methods_.

In reply to Alan:

Your first example applies equally to OOP or procedural - it's a code
snippet, not a coding style.

Your second example is overcomplicated - why teach getters and setters from
the word go when a property (public var age:Number;) is far simpler/more
obvious? Yes, getters and setters are part of the OOP paradigm, but not a
requirement.

  
That was my example. You teach people the right way to do it so that 
they never consider addressing a property directly. It may look easier 
but someday, it will break your code in a way that will cause you a lot 
of grief. There are good reasons why it is not done.


Not addressing properties is a requirement of OOP otherwise you break 
encapsulation.


When a person is first starting out, they will not question whether it 
is easier or harder. It just is.None of my test frameworks would ever 
address a property directly. I would not even mention the possibility of 
doing such a silly thing.


If the discussion ever comes up, I would defer it until after the first 
6 weeks and then use it to discuss the reasons why encapsulation is a 
good thing and show why directly addressing properties is inherently evil.


It is also a good introduction into a discussion about programming to 
interfaces which I also would have taught from day one. Not as a topic 
but as a way to specify coding exercises. Give them the interface and 
the program to test the class and ask them to create the class. Do not 
explain why, just let them have the freedom of naming variables and 
programming methods as long as it works with the interface.


From reviewing and discussing each other's code, they would already 
know that the properties of a given class may vary from person to person 
even if the Class is perfectly correct, the variable names follow 
standards and the Class satisfies the interface. They would already know 
that trying to guess property names for a class is impossible and that 
if you switched from one person's implementation to another, your 
program could fail if you have tried to use properties directly.
They would have seen that the test frameworks given for each exercise 
were not implementation dependent..


Ron

Ian


On 8/21/07, Alan MacDougall [EMAIL PROTECTED] wrote:
  

So rather than engage in an argument as to whether OOP or procedural is
better, we're basically asking: Do the additional distractions of OOP
justify the payoff from learning it up front? If you're teaching fellow
geeks, then yes. If you're teaching people with a more casual interest
in programming, or (shudder) people who are required to take the class,
you may want to keep it script-simple. Compare:



___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-22 Thread Ron Wheeler



Ian Thomas wrote:

In reply to Steven:
- Firstly, Wikipedia isn't a great source to quote. :-D
- Secondly, OOP as a style has basic stuff, and it has advanced stuff. I'm
not saying teach inheritance and polymorphism on day 1, I'm saying teach
that objects have properties (and then objects have methods). Not
necessarily because it's _better_ than procedural (we could argue that
forever) but because _almost all day-to-day programming languages that the
students will encounter will involve objects, properties and methods_.

In reply to Alan:

Your first example applies equally to OOP or procedural - it's a code
snippet, not a coding style.

Your second example is overcomplicated - why teach getters and setters from
the word go when a property (public var age:Number;) is far simpler/more
obvious? Yes, getters and setters are part of the OOP paradigm, but not a
requirement.

Ian
  
I would probably be more emphatic about getters and setter. If you are 
going to hire an expert ActionScript programmer and they give you code 
samples with public properties in their classes, ask for a copy of the 
liability insurance certificate.
It means that they either lazy or not competent and their code will 
likely contain so-called shortcuts that will cost you a lot of time 
and money later.

If you are going to pay for something, it should at least be safe.

Forgetting the private on a property is a full mark deduction in class.


Ron


On 8/21/07, Alan MacDougall [EMAIL PROTECTED] wrote:
  

So rather than engage in an argument as to whether OOP or procedural is
better, we're basically asking: Do the additional distractions of OOP
justify the payoff from learning it up front? If you're teaching fellow
geeks, then yes. If you're teaching people with a more casual interest
in programming, or (shudder) people who are required to take the class,
you may want to keep it script-simple. Compare:



___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-22 Thread Ian Thomas
On 8/22/07, Ron Wheeler [EMAIL PROTECTED] wrote:


 Ian Thomas wrote:

  Your second example is overcomplicated - why teach getters and setters
 from
  the word go when a property (public var age:Number;) is far simpler/more
  obvious? Yes, getters and setters are part of the OOP paradigm, but not
 a
  requirement.
 
 
 That was my example. You teach people the right way to do it so that
 they never consider addressing a property directly. It may look easier
 but someday, it will break your code in a way that will cause you a lot
 of grief. There are good reasons why it is not done.

 Not addressing properties is a requirement of OOP otherwise you break
 encapsulation.


I think my head is in AS2/AS3 world, where you're dealing with instrinsic
getters and setters, i.e. the AS2/AS3 syntax. Which, personally, I find a
much better solution than the Java getters/setters. But that's a
conversation for another day. :-)

You're right, my example was bad practice.

But at a higher level than Java, it is perfectly permissible to have public
properties in OOP. It's just that, in Java, a property called 'Age' is
accessed via 'obj.getAge()', in AS3 it's obj.age via 'function get age()',
when talking to a Bean via BSF it's just obj.age, when reading a data
structure it's just obj.age, in PHP it's $obj-age and so on. Properties
exist and are legal to talk to - look at any OOP-based API. :-)

OOP, at a basic level, consists of  objects, methods _and_ properties - and
my argument is that mainstream programming is all converging on that model
and that's why it should be taught. But properties aren't public member
variables, which is where my example was wrong. :-)

Ian
___
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


Re: [Flashcoders] Intro to OOP using ActionScript: patterns derail!

2007-08-22 Thread Andy Herrman
The fancy names are kind of useful actually.  Most of the patterns
I've learned but I didn't know the fancy/official names for them.
This caused some confusion when talking with my coworker as he would
be simply using the names instead of the concepts and I'd have to stop
and figure out which one he meant, or I'd spend extra time explaining
what I was talking about when I could have just said the name and been
done with it.

The names are useful as a common/shared way of referencing complex
concepts.  That said, the concepts are much more important than the
names, as you can get by just fine with only the concepts, but fail
miserably on with just the names. :)

  -Andy

On 8/22/07, Ron Wheeler [EMAIL PROTECTED] wrote:


 Dave Mennenoh wrote:
  How do you handle onLoad's famous scope? ... It is not magic or
  advanced. If a pattern was shown to a new programmer without giving
  it a fancy name, they would just accept it as the best way to do the
  task and would never give it moment's thought.
 
  Right. Delegate - ie Proxy. I agree. I wasn't saying patterns
  shouldn't be taught, or used - I doubt you could teach a Flash class
  these days without teaching Observer, but you might not ever call it
  that. In fact, I wonder who does call it that in a class? Actually,
  the more I think about it, I think for students it might be best not
  to call these patterns and just teach them. Then, once they know how
  to use them, tell them what they are. It's a bit like teaching
  encapsulation I think - if you just show your students how to write
  classes, and they see how classes work for organizing code, they will
  likely just use them.
 
 
 That is what I have been saying from the start of this discussion.  You
 do not have to teach the fancy names. Just teach them to use proper
 coding practices. OOP and Design Patterns are just names that we use to
 group a bunch of best practices into theories so we can discuss the
 theory and have a framework to critique code. I have a feeling that for
 most of us, the word polymorphism is not much of a help and I see no
 reason to even use the word on 14 year olds until the last week of class
 and only then as a warning that someday someone might try to use it on
 them in a discussion about design.

 Ron
 
  Dave -
  Head Developer
  http://www.blurredistinction.com
  Adobe Community Expert
  http://www.adobe.com/communities/experts/
  ___
  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

___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Jer Brand

  English Windows 3.1? I would have died if it hadn't been for Paetzold.


Heh, and I was just peeking at the Win32 API book last night. Didn't expect
to see that name again. ; )

On the subject of teaching OOP to non-programmers, I'm torn. I've seen the
method of We'll explain later but for now just type this code work in
Java. I've also see it leave an entire class of Java students dazed and
confused.

The time it worked, Java was taught starting completely with swing where we
were asked to build something on day one using the swing classes/controls
and the OO concepts kept appearing in a natural way along with basic
concepts. The class seemed to take the concepts in stride.

The time it didn't work was my second trip through Java with a different
instructor. This class went through the basics of programming in a linear
way and when the OOP concepts started (or the what we've been doing
lecture), I'm not sure I've ever so many people rubbing their heads and
staring blankly.

Granted, I think it came down to the instructor and how she ran the class,
but at the same time, it felt like the content switched gears on the second
class. Some people couldn't adapt their thinking. In a later conversation
with that instructor she mentioned that she always has about 40% (pulling a
sufficiently high number out of the air) of the class drop at that lesson.

Thinking about the swing+Java class, I'm not sure how you could translate
that to AS2 without hoops that muddy the OOP waters (attachMovieClip,
createEmptyMovieClip).

Heh, sorry, long post simply because seeing Petzold's name gave me warm
fuzzies.

Jer
___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Alan MacDougall
Start small and work your way up. You don't need classes until the 
functions start to get unmanageable. That won't happen until you've 
thoroughly covered variables and control structures. By the time classes 
are necessary, the students should be relieved to have a way to organize 
their forest of elaborate functions. Even if they're introduced in an 
organic and natural way, like building a Swing application, they're 
going to just be one more distraction for people who are struggling with 
the syntax of a for loop. They're an intermediate topic, treat them as one.


___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Ron Wheeler
I do not believe that starting people out doing things the wrong way is 
ever a good start.
Teach OOP from the day one. Not as a name or a theory but as a normal 
way to program.
Just start with simple classes and give the students a framework for 
testing that they do not have to deal with.


You can start with very simple classes representing everyday objects 
that everyone can understand.
You can introduce various types of variables very easily - one at a 
time. (Cats have a name, add in age, later add date of birth)
You can add Arrarys very easily in the context of a real world object. 
(Add in an array of offspring)


If you provide the Pet interface with the test program, the students 
will see how their names for properties do not matter.


By the time you have to explain what OOP is, the kids will already be 
programming OOP and wonder why anyone ever did it any other way.


Ron

Alan MacDougall wrote:
Start small and work your way up. You don't need classes until the 
functions start to get unmanageable. That won't happen until you've 
thoroughly covered variables and control structures. By the time 
classes are necessary, the students should be relieved to have a way 
to organize their forest of elaborate functions. Even if they're 
introduced in an organic and natural way, like building a Swing 
application, they're going to just be one more distraction for people 
who are struggling with the syntax of a for loop. They're an 
intermediate topic, treat them as one.


___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Ian Thomas
For the record, I completely agree, Ron.

Ian

On 8/21/07, Ron Wheeler [EMAIL PROTECTED] wrote:

 I do not believe that starting people out doing things the wrong way is
 ever a good start.
 Teach OOP from the day one. Not as a name or a theory but as a normal
 way to program.
 Just start with simple classes and give the students a framework for
 testing that they do not have to deal with.


___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Steven Sacks
Procedural isn't wrong.  OOP isn't right.  They're used for different 
purposes.  The fact is, OOP is a trade off for flexibility and 
scalability over speed; speed in development, speed in execution. 
Procedural programming has its place (ask any game developer).


Procedural programming is a necessary and important first step in 
learning how to code.  It's the best way to learn how programming works 
because it's a simplified approach and won't get in the way of learning 
basic syntax.


People with no programming experience will not understand abstract 
concepts like classes, inheritance, polymorphism, and encapsulation - 
the very things that make up OOP.


OOP is a specialized dialect, built upon the basic language of 
programming.  If you don't learn the basics, you can't truly learn the 
dialect.  It's akin to learning phrases from a French phrase book and 
going to Paris on vacation versus learning how conjugation and verb 
tenses work combined with vocabulary.  Who is going to be more 
successful at carrying on rudimentary conversations, or understanding 
what's being said to them?


If we take two students and you teach them OOP for 1 month and I teach 
them procedural for two weeks and then OOP for two weeks, my student 
will be further along than your student. The reason is simple.  When you 
learn the fundamentals first you have a greater capacity for 
understanding of more advanced topics.


If you take somebody snowboarding and force them to learn how to do a 
720 without teaching them anything else, they will eventually be able to 
do a 720.  If you instead teach them all the basic moves, how to enter 
and exit tricks, and then move into 180s, 270s and 360s, they'll be much 
better at snowboarding in general and will naturally learn 720s soon after.


Plus, if you sit down with non-programmers to teach them OOP, and you 
have to teach them the basics first, you will find yourself naturally 
teaching them procedural programming because every time you try to move 
into topics OOP, your students will get lost and you'll end up circling 
back to explain the basics again.


OOP is not a beginner topic.

___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Ian Thomas
On 8/21/07, Steven Sacks [EMAIL PROTECTED] wrote:


 If we take two students and you teach them OOP for 1 month and I teach
 them procedural for two weeks and then OOP for two weeks, my student
 will be further along than your student. The reason is simple.  When you
 learn the fundamentals first you have a greater capacity for
 understanding of more advanced topics.



I really don't agree -- and I'd like to see you back that assertion up with
some hard data. Getting across the idea that (for example) a game object has
a bunch of attributes/properties (speed, direction, score, colour) -- that
doesn't require prior programming knowledge. Getting across the idea that an
object has an x value and if you increment it, it goes right - that requires
a bit of geometry, but again, not prior programming knowledge.

Inheritance, abstraction, interfaces et al - these are all advanced topics
and require a firm base to be working from (and there I agree with you). But
there's no reason why that base can't be objects, methods and properties
rather than procedures. Objects are easy to relate to real-world examples.

Given that nearly every language - not to mention data representation - in
common use these days either uses, or is capable of using a model that uses
objects, methods and properties, it'd be vastly helpful to have students
working from that basis.

Ian
___
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


RE: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Kerry Thompson
Steven Sacks wrote:
 
 Procedural programming is a necessary and important first step in
 learning how to code

I've been following this debate, and I pretty much agree with Steven.

I remember when I took my first programming course, and the professor told
us we'd need a 5 1/4 floppy disk. I asked what's that? He told me, and I
went down to the local office supply store and put down my $5 for my very
first floppy.

The point is that we're way up here, and the students may not even
understand what a variable is. They need the basic concepts of a
function/procedure/subroutine/method, variables, and more advanced concepts
like control (if) and iteration (for, while).

Backtracking a bit, do you remember when you took your first algebra class,
and were first introduced to the concept of a variable? To me, that's the
dividing line between arithmetic and mathematics. Just the idea of a
variable is a tough concept to grasp at first.

I don't think you need to call it procedural. Just call it the basic
building blocks that they will need for OOP (or procedural, for that
matter).

There's not that much difference, really, between OOP and procedural. OOP
just encapsulates chunks of procedural code and its data. ActionScript's
built-in classes are much like the libraries I used in Turbo Pascal in the
80s.

Modern programming requires that you understand OOP, and I would move the
students very quickly to an OOP paradigm. But, like Steven says, they need
the basics, which are really neither procedural nor OOP. They're just the
basics.

Cordially,

Kerry Thompson


___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread T. Michael Keesey
On 8/21/07, Ian Thomas [EMAIL PROTECTED] wrote:
 On 8/21/07, Steven Sacks [EMAIL PROTECTED] wrote:

  If we take two students and you teach them OOP for 1 month and I teach
  them procedural for two weeks and then OOP for two weeks, my student
  will be further along than your student.s.

 I really don't agree -- and I'd like to see you back that assertion up with
 some hard data.

I actually wonder how much of us are qualified to judge. Most of us
probably learned procedural programming first, so that seems natural
to us. When I taught myself BASIC on my family's TI 99/4A back in the
early '80s (and later on our Commodore 64 circa 1990), OOP didn't even
exist. Of course, it laid out the fundamentals so that, by the time I
was in high school and OOP was gaining impetus, I was ready to learn
it--with a bit of initial struggling. So that route worked, in the
end.

But was it the best route? Some of the basics I learned early on,
like GOTO and line numbers, are barely present in programming anymore
(assembly language excepted). And would it have been easier to segue
into OOP if I had been used to dealing with variables that had fields
and methods? Would it have been that much harder to learn to use
Math.abs() rather than ABS(), or bitmapData.getPixel(row, col) rather
than peek offset + screenwidth * row + col? I feel like it might have
been beneficial to start using objects, even without understanding
everything about them, shortly after learning about simple variables.
But, then again, I don't really know.

When I taught children how to program in the late '90s, some of the
languages I taught required using objects (Visual Basic) and others
didn't (LOGO). I really don't recall there being much difference in
the difficulty. Of course I didn't go very deeply into OOP, just how
to use existing APIs. But maybe that was a better approach,
ultimately. I don't know--I haven't kept in touch with any of the
kids.

Is there any younger person or latecomer out there who started using
OOP basics when learning to program for the first time? What are your
thoughts?
-- 
Mike Keesey
___
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


RE: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Hershell Bryant
If you want to teach kids about forests, making them look at leaves under a
microscope for 6-12 months is not the way to go about it. While a leaf may
be fundamental to the life of a tree, a complete understanding of that leaf
is not even remotely necessary to understanding what a forest is about.

OOP is a great approach to programming, and there's absolutely no reason to
ensure that students are seeing strings in their dreams before teaching it.

Whether you teach a procedural or an OOP methodology, you're going to have
to teach basics concurrently...there's no getting around it.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ian Thomas
Sent: Tuesday, August 21, 2007 11:17 AM
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] Intro to OOP using ActionScript

On 8/21/07, Steven Sacks [EMAIL PROTECTED] wrote:


 If we take two students and you teach them OOP for 1 month and I teach
 them procedural for two weeks and then OOP for two weeks, my student
 will be further along than your student. The reason is simple.  When you
 learn the fundamentals first you have a greater capacity for
 understanding of more advanced topics.



I really don't agree -- and I'd like to see you back that assertion up with
some hard data. Getting across the idea that (for example) a game object has
a bunch of attributes/properties (speed, direction, score, colour) -- that
doesn't require prior programming knowledge. Getting across the idea that an
object has an x value and if you increment it, it goes right - that requires
a bit of geometry, but again, not prior programming knowledge.

Inheritance, abstraction, interfaces et al - these are all advanced topics
and require a firm base to be working from (and there I agree with you). But
there's no reason why that base can't be objects, methods and properties
rather than procedures. Objects are easy to relate to real-world examples.

Given that nearly every language - not to mention data representation - in
common use these days either uses, or is capable of using a model that uses
objects, methods and properties, it'd be vastly helpful to have students
working from that basis.

Ian
___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread T. Michael Keesey
On 8/21/07, Steven Sacks [EMAIL PROTECTED] wrote:

 Object-oriented programming (OOP) is a programming paradigm that uses
 objects and their interactions to design applications and computer
 programs. It is based on several techniques, including inheritance,
 modularity, polymorphism, and encapsulation.

 OOP is based on the things you acknowledge are advanced topics.  Ipso
 facto, OOP is advanced, right?  ;)

I think there's actually more agreement than disagreement here. Nobody
is arguing that you should be teaching polymorphism on the second day,
just that you can start to introduce objects at an early stage. I
mean, if you can start with:

x = 500;
trace(x);

... you could certainly also start with:

myShape.x = 500;

The core basics of OOP--using fields and methods--are not that far
beyond the core basics of programming--using variables and functions.
Of course inheritance, polymorphism, encapsulation, etc. come much
later, and design patterns even later. No one would dispute that, I
think.
-- 
Mike Keesey
___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread [p e r c e p t i c o n]
most college programming courses have prerequisites right?

personally i know many programmers who don't have a background in
programming who jumped right into oop...just looking at the code i can tell
what they understand about programming let alone oop...


my 0.02 pieces of lint

p
___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread chris duke
I see it as something of a Math class (my degree is in math so bear with
me). People aren't just going to be thrown into Calculus before at least
learning algebra. There is some argument that teaching calculus sooner could
be beneficial (i'm in that camp but theres a whole different set of issues
there), but at the same time its hard to imagine learning calculus without
at least having some concept of what infinite means. Same would go for OOP
- you couldn't learn it without first knowing what function means. Sure
you could teach it during the class, but why not get all of that out of the
way along with other simpler concepts in a foundations class before actually
brining OOP into the picture. Much the same way you are taught how to
compute area, and limits, before being thrown into derivatives and
integrals.

-CD

On 8/21/07, [p e r c e p t i c o n] [EMAIL PROTECTED] wrote:

 most college programming courses have prerequisites right?

 personally i know many programmers who don't have a background in
 programming who jumped right into oop...just looking at the code i can
 tell
 what they understand about programming let alone oop...


 my 0.02 pieces of lint

 p
 ___
 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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Troy Rollins


On Aug 21, 2007, at 3:54 PM, Ron Wheeler wrote:

Lesson 2 How do you set/change a cats name? How do you create 2  
cats with different names? Now they know about setters and getters  
and methods with parameters.


Now you are *really* talking about encapsulation...

since everyone knows that cats don't know their own names.

--
Troy
RPSystems, Ltd.
http://www.rpsystems.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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Alan MacDougall


I don't think you need to call it procedural. Just call it the basic
building blocks that they will need for OOP (or procedural, for that
matter).

There's not that much difference, really, between OOP and procedural. OOP
just encapsulates chunks of procedural code and its data.
This is the correct answer. OOP probably isn't a bad framework in which 
to teach these things, but when you start teaching you may be surprised 
by how many students have a hard time grasping concepts that may seem 
simple to you, even as simple as the relationship between a class and an 
instance. You will also see students who blur through the work and get 
bored five minutes after each class starts... but they aren't the ones 
we're worried about.


So rather than engage in an argument as to whether OOP or procedural is 
better, we're basically asking: Do the additional distractions of OOP 
justify the payoff from learning it up front? If you're teaching fellow 
geeks, then yes. If you're teaching people with a more casual interest 
in programming, or (shudder) people who are required to take the class, 
you may want to keep it script-simple. Compare:


var foo:Number = 1;
var bar:Number = 2;
trace(foo + bar);

vs.

class Cat
{
   private var age:Number;
   public function setAge(age:Number):Void   {this.age = age;}
   public function getAge():Number   {return age;}
}

var whiskers:Cat = new Cat();
whiskers.setAge(1);
var patches:Cat = new Cat();
patches.setAge(2);
trace(whiskers.getAge() + patches.getAge());

Is it so unrealistic to suggest that the second example, while having a 
pleasant real-world basis, involves many more steps and logical leaps 
for an absolute beginner to understand?


Maybe this is a strawman... I guess you could start with how getters and 
setters work in the first place, and use that to explain 
functions/methods. It just seems like a bit too much drapery to start 
out with.


___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Ron Wheeler

Can you explain to me how a function is intrinsically simpler than a method?

I have a feeling that there is a lot more mythology about OOP than there 
should be.

1) OOP uses the same compiler as spaghetti code.
2) OOP is written using procedural languages (the opposite of procedural 
is declarative)
3)OOP is based on some interesting theory and has a funny vocabulary but 
if you ignore all of these linguistic shortcuts and just explain what 
you mean, it is pretty simple.
4) OOP generally results in the average programmer producing code that 
is easier to debug and maintain that the average programmer used to be 
capable of doing. It is not a cure-all for stupidity or lazy thinking. 
It is just easier to spot and fix poorly written code.
5) OOP is a way to approach design; more beginning programmers (and 
experienced programmers) have trouble with design than coding.
6) OOP will not cure baldness but it will reduce the number of times you 
are pulling your hair out in frustration over a programming error.


Ron


chris duke wrote:

I see it as something of a Math class (my degree is in math so bear with
me). People aren't just going to be thrown into Calculus before at least
learning algebra. There is some argument that teaching calculus sooner could
be beneficial (i'm in that camp but theres a whole different set of issues
there), but at the same time its hard to imagine learning calculus without
at least having some concept of what infinite means. Same would go for OOP
- you couldn't learn it without first knowing what function means. Sure
you could teach it during the class, but why not get all of that out of the
way along with other simpler concepts in a foundations class before actually
brining OOP into the picture. Much the same way you are taught how to
compute area, and limits, before being thrown into derivatives and
integrals.

-CD

On 8/21/07, [p e r c e p t i c o n] [EMAIL PROTECTED] wrote:
  

most college programming courses have prerequisites right?

personally i know many programmers who don't have a background in
programming who jumped right into oop...just looking at the code i can
tell
what they understand about programming let alone oop...


my 0.02 pieces of lint

p
___
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


  

___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Ron Wheeler

They do know their names.
They are just not going to give you the satisfaction of coming just 
because you called them.

That is what dogs were invented for.

Ron


Troy Rollins wrote:


On Aug 21, 2007, at 3:54 PM, Ron Wheeler wrote:

Lesson 2 How do you set/change a cats name? How do you create 2 cats 
with different names? Now they know about setters and getters and 
methods with parameters.


Now you are *really* talking about encapsulation...

since everyone knows that cats don't know their own names.

--
Troy
RPSystems, Ltd.
http://www.rpsystems.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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Mark Winterhalder
 If you take somebody snowboarding and force them to learn how to do a
 720 without teaching them anything else, they will eventually be able to
 do a 720.  If you instead teach them all the basic moves, how to enter
 and exit tricks, and then move into 180s, 270s and 360s, they'll be much
 better at snowboarding in general and will naturally learn 720s soon after.

You can't just teach somebody to snowboard without first teaching them
how to ski.
They need to get a feeling for the snow first, on two boards, learn
how to use the lift and so on.

But in terms of programming, I agree with Ron. OOP is more natural and
closer to real life experiences.

Mark


On 8/21/07, Steven Sacks [EMAIL PROTECTED] wrote:
 Procedural isn't wrong.  OOP isn't right.  They're used for different
 purposes.  The fact is, OOP is a trade off for flexibility and
 scalability over speed; speed in development, speed in execution.
 Procedural programming has its place (ask any game developer).

 Procedural programming is a necessary and important first step in
 learning how to code.  It's the best way to learn how programming works
 because it's a simplified approach and won't get in the way of learning
 basic syntax.

 People with no programming experience will not understand abstract
 concepts like classes, inheritance, polymorphism, and encapsulation -
 the very things that make up OOP.

 OOP is a specialized dialect, built upon the basic language of
 programming.  If you don't learn the basics, you can't truly learn the
 dialect.  It's akin to learning phrases from a French phrase book and
 going to Paris on vacation versus learning how conjugation and verb
 tenses work combined with vocabulary.  Who is going to be more
 successful at carrying on rudimentary conversations, or understanding
 what's being said to them?

 If we take two students and you teach them OOP for 1 month and I teach
 them procedural for two weeks and then OOP for two weeks, my student
 will be further along than your student. The reason is simple.  When you
 learn the fundamentals first you have a greater capacity for
 understanding of more advanced topics.

 If you take somebody snowboarding and force them to learn how to do a
 720 without teaching them anything else, they will eventually be able to
 do a 720.  If you instead teach them all the basic moves, how to enter
 and exit tricks, and then move into 180s, 270s and 360s, they'll be much
 better at snowboarding in general and will naturally learn 720s soon after.

 Plus, if you sit down with non-programmers to teach them OOP, and you
 have to teach them the basics first, you will find yourself naturally
 teaching them procedural programming because every time you try to move
 into topics OOP, your students will get lost and you'll end up circling
 back to explain the basics again.

 OOP is not a beginner topic.

 ___
 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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Ron Wheeler

Interesting point.

My counter would be that at the age of 14, these kids already have a 
good understanding of  foo+bar (and knowing to days kids fubar as well.)


I am not trying to teach them arithmetic. I am interested in showing 
them how arithmetic is used in the context of programming to accomplish 
something worthwhile like adding up the age of 2 cats.
Fortunately the + operation maps pretty well into the vocabulary of 
arithmetic so I would not expect students shown either example to 
flounder on the + sign.


I really want to teach them the right way to represent cats as things 
inside a computer and to manipulate these abstractions as easily or more 
easily than they can manipulate realworld cats. And to be able to extend 
this same approach to dogs, credit cards, photographs, etc.


Ron


Alan MacDougall wrote:


I don't think you need to call it procedural. Just call it the basic
building blocks that they will need for OOP (or procedural, for that
matter).

There's not that much difference, really, between OOP and procedural. 
OOP

just encapsulates chunks of procedural code and its data.
This is the correct answer. OOP probably isn't a bad framework in 
which to teach these things, but when you start teaching you may be 
surprised by how many students have a hard time grasping concepts that 
may seem simple to you, even as simple as the relationship between a 
class and an instance. You will also see students who blur through the 
work and get bored five minutes after each class starts... but they 
aren't the ones we're worried about.


So rather than engage in an argument as to whether OOP or procedural 
is better, we're basically asking: Do the additional distractions of 
OOP justify the payoff from learning it up front? If you're teaching 
fellow geeks, then yes. If you're teaching people with a more casual 
interest in programming, or (shudder) people who are required to take 
the class, you may want to keep it script-simple. Compare:


var foo:Number = 1;
var bar:Number = 2;
trace(foo + bar);

vs.

class Cat
{
   private var age:Number;
   public function setAge(age:Number):Void   {this.age = age;}
   public function getAge():Number   {return age;}
}

var whiskers:Cat = new Cat();
whiskers.setAge(1);
var patches:Cat = new Cat();
patches.setAge(2);
trace(whiskers.getAge() + patches.getAge());

Is it so unrealistic to suggest that the second example, while having 
a pleasant real-world basis, involves many more steps and logical 
leaps for an absolute beginner to understand?


Maybe this is a strawman... I guess you could start with how getters 
and setters work in the first place, and use that to explain 
functions/methods. It just seems like a bit too much drapery to start 
out with.


___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Ron Wheeler



T. Michael Keesey wrote:

On 8/21/07, Steven Sacks [EMAIL PROTECTED] wrote:
  

Object-oriented programming (OOP) is a programming paradigm that uses
objects and their interactions to design applications and computer
programs. It is based on several techniques, including inheritance,
modularity, polymorphism, and encapsulation.

OOP is based on the things you acknowledge are advanced topics.  Ipso
facto, OOP is advanced, right?  ;)



I think there's actually more agreement than disagreement here. Nobody
is arguing that you should be teaching polymorphism on the second day,
just that you can start to introduce objects at an early stage. I
mean, if you can start with:

x = 500;
trace(x);

... you could certainly also start with:

myShape.x = 500;
  

I hope that you meant
myshape.setX(500); 

The core basics of OOP--using fields and methods--are not that far
beyond the core basics of programming--using variables and functions.
Of course inheritance, polymorphism, encapsulation, etc. come much
later, and design patterns even later. No one would dispute that, I
think.
  

___
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


RE: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Kerry Thompson
Troy Rollins wrote:
 
 since everyone knows that cats don't know their own names.

Unless you believe e. e. cummings ^_^

Cordially,

Kerry Thompson


___
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


RE: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread David Ngo
What kind of argument is that? I've never learned to ski and I was able to
pick up snowboarding. One is not dependant upon the other.



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark
Winterhalder
Sent: Tuesday, August 21, 2007 4:41 PM
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] Intro to OOP using ActionScript

 If you take somebody snowboarding and force them to learn how to do a
 720 without teaching them anything else, they will eventually be able to
 do a 720.  If you instead teach them all the basic moves, how to enter
 and exit tricks, and then move into 180s, 270s and 360s, they'll be much
 better at snowboarding in general and will naturally learn 720s soon
after.

You can't just teach somebody to snowboard without first teaching them
how to ski.
They need to get a feeling for the snow first, on two boards, learn
how to use the lift and so on.

But in terms of programming, I agree with Ron. OOP is more natural and
closer to real life experiences.

Mark


On 8/21/07, Steven Sacks [EMAIL PROTECTED] wrote:
 Procedural isn't wrong.  OOP isn't right.  They're used for different
 purposes.  The fact is, OOP is a trade off for flexibility and
 scalability over speed; speed in development, speed in execution.
 Procedural programming has its place (ask any game developer).

 Procedural programming is a necessary and important first step in
 learning how to code.  It's the best way to learn how programming works
 because it's a simplified approach and won't get in the way of learning
 basic syntax.

 People with no programming experience will not understand abstract
 concepts like classes, inheritance, polymorphism, and encapsulation -
 the very things that make up OOP.

 OOP is a specialized dialect, built upon the basic language of
 programming.  If you don't learn the basics, you can't truly learn the
 dialect.  It's akin to learning phrases from a French phrase book and
 going to Paris on vacation versus learning how conjugation and verb
 tenses work combined with vocabulary.  Who is going to be more
 successful at carrying on rudimentary conversations, or understanding
 what's being said to them?

 If we take two students and you teach them OOP for 1 month and I teach
 them procedural for two weeks and then OOP for two weeks, my student
 will be further along than your student. The reason is simple.  When you
 learn the fundamentals first you have a greater capacity for
 understanding of more advanced topics.

 If you take somebody snowboarding and force them to learn how to do a
 720 without teaching them anything else, they will eventually be able to
 do a 720.  If you instead teach them all the basic moves, how to enter
 and exit tricks, and then move into 180s, 270s and 360s, they'll be much
 better at snowboarding in general and will naturally learn 720s soon
after.

 Plus, if you sit down with non-programmers to teach them OOP, and you
 have to teach them the basics first, you will find yourself naturally
 teaching them procedural programming because every time you try to move
 into topics OOP, your students will get lost and you'll end up circling
 back to explain the basics again.

 OOP is not a beginner topic.

 ___
 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

___
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


RE: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Kerry Thompson
Mark Winterhalder wrote:
 
 You can't just teach somebody to snowboard without first teaching them
 how to ski.

Ooh, that's going to get a reaction from the boarders. I'm going to go wax
my skis and stay out of this one ^_^

Cordially,

Kerry Thompson


___
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


RE: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Kerry Thompson
Ron Wheeler wrote:
 
 Alan MacDougall wrote:
 
  I don't think you need to call it procedural. Just call it the basic
  building blocks that they will need for OOP (or procedural, for that
  matter).
 
  There's not that much difference, really, between OOP and procedural.
  OOP

Actually, that's what Kerry Thompson wrote. Alan was quoting me.

Cordially,

Kerry Thompson


___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Dave Mennenoh
.I do not believe that starting people out doing things the wrong way is 
ever a good start. Teach OOP from the day one. Not as a name or a theory 
but as a normal way to program.


Right on Ron.



Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ 


___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Dave Mennenoh
Of course inheritance, polymorphism, encapsulation, etc. come much later, 
and design patterns even later. No one would dispute that, I think.


I'd disagree a little. Encapsulation especially, is a really simple concept. 
It's about organization and teaching students to stay organize - ie to keep 
cats in one class and dogs in another is not advanced - no more so than 
having them build a function that can be reused.


Lots of programmers never need design patterns as they don't help much 
unless your architecting large apps, and lots of Flash programmers aren't 
developing those kinds of apps. Keeping your code organized however should 
be taught from day one and certain oop concepts are perfect for that.


It's pretty awesome to show students something like a utility class that 
might store a url for a php script - and use that script in a bunch of 
movies... then show them how one simple change in the class affects every 
movie. This is the kind of thing they will appreciate and make use of. 
Newbies figure out templates in Dreamweaver... sticking code in a class is 
about the same.


I typically use a combination of OOP and procedural - keeping code pertinent 
to a given movie in that movie if it makes sense, while using classes to 
store code I use in multiple movies. I usually find it pretty awkward to try 
and objectify an entire project - it just doesn't help. I find the combo 
works quite well for me - and besides, it's still all oop if you think about 
it...


Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ 


___
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


RE: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Dave Watts
  You can't just teach somebody to snowboard without first 
  teaching them how to ski.
 
 Ooh, that's going to get a reaction from the boarders. I'm 
 going to go wax my skis and stay out of this one ^_^

Aaand now, this thread is completely OT. Please keep to the thread topic or
don't respond. Thanks!

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread T. Michael Keesey
On 8/21/07, Ron Wheeler [EMAIL PROTECTED] wrote:
 
  myShape.x = 500;

 I hope that you meant
 myshape.setX(500);

Huh?

No, that's not part of the flash.display.Shape API. And while it's
true that x in this context is actually not a true field, but a pair
of methods (__get__x and __set__x, not getX and setX) disguised as a
field, I think you can safely ignore that in an introductory class.
-- 
Mike Keesey
___
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


Re: [Flashcoders] Intro to OOP using ActionScript: patterns derail!

2007-08-21 Thread Alan MacDougall

Dave Mennenoh wrote:


Lots of programmers never need design patterns as they don't help much 
unless your architecting large apps, and lots of Flash programmers 
aren't developing those kinds of apps. Keeping your code organized 
however should be taught from day one and certain oop concepts are 
perfect for that.


There are plenty of patterns that can apply well to small-scale 
projects: take undo. How would you cleanly support undo without Command? 
Other patterns like State, Adapter, Observer (especially to overcome the 
sadistic limitations of Flash's single callbacks -- MovieClip -- or 
single listeners -- MovieClipLoader)... all have uses even in a sporty 
little website tchotchke. Not every 'design pattern' is something like 
MVC or data mapping or dynamically-configured factories.


On the other hand, I got your point.

___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Mark Winterhalder
On 8/21/07, David Ngo [EMAIL PROTECTED] wrote:
 What kind of argument is that? I've never learned to ski and I was able to
 pick up snowboarding. One is not dependant upon the other.

Sigh... I guess I should know better than attempting irony in an email.

Of course you can learn how to snowboard without first learning how to
ski. It's even easier. To claim otherwise would be silly.

I think with OOP it's the same thing.

Mark
___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Ron Wheeler
That is the problem when you have to use someone's API and it does not 
follow standards.
They probably wrote it before we know the right way to do getters and 
setters - or they never bothered to read up on the state of the art in 
programming.


Ron

T. Michael Keesey wrote:

On 8/21/07, Ron Wheeler [EMAIL PROTECTED] wrote:
  

myShape.x = 500;
  

I hope that you meant
myshape.setX(500);



Huh?

No, that's not part of the flash.display.Shape API. And while it's
true that x in this context is actually not a true field, but a pair
of methods (__get__x and __set__x, not getX and setX) disguised as a
field, I think you can safely ignore that in an introductory class.
  

___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread T. Michael Keesey
On 8/21/07, Ron Wheeler [EMAIL PROTECTED] wrote:

 T. Michael Keesey wrote:
  On 8/21/07, Ron Wheeler [EMAIL PROTECTED] wrote:
 
  myShape.x = 500;
 
  I hope that you meant
  myshape.setX(500);
 
 
  Huh?
 
  No, that's not part of the flash.display.Shape API. And while it's
  true that x in this context is actually not a true field, but a pair
  of methods (__get__x and __set__x, not getX and setX) disguised as a
  field, I think you can safely ignore that in an introductory class.

 That is the problem when you have to use someone's API and it does not
 follow standards.
 They probably wrote it before we know the right way to do getters and
 setters - or they never bothered to read up on the state of the art in
 programming.

Uh, you do realize that is Adobe's own API, right?

http://livedocs.adobe.com/flex/2/langref/flash/display/Shape.html#propertySummary

That is the proper way to do getters and setters in ActionScript
(2.0 and 3.0). This isn't Java.

-- 
T. Michael Keesey
Director of Technology
Exopolis, Inc.
2894 Rowena Avenue Ste. B
Los Angeles, California 90039
___
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


Re: [Flashcoders] Intro to OOP using ActionScript: patterns derail!

2007-08-21 Thread Ron Wheeler



Alan MacDougall wrote:

Dave Mennenoh wrote:


Lots of programmers never need design patterns as they don't help 
much unless your architecting large apps, and lots of Flash 
programmers aren't developing those kinds of apps. Keeping your code 
organized however should be taught from day one and certain oop 
concepts are perfect for that.


There are plenty of patterns that can apply well to small-scale 
projects: take undo. How would you cleanly support undo without 
Command? Other patterns like State, Adapter, Observer (especially to 
overcome the sadistic limitations of Flash's single callbacks -- 
MovieClip -- or single listeners -- MovieClipLoader)... all have uses 
even in a sporty little website tchotchke. Not every 'design pattern' 
is something like MVC or data mapping or dynamically-configured 
factories.


On the other hand, I got your point.
Design patterns are not some esoteric way of doing things. They are 
solutions to common programming situations that came up over and over again.
For years, we all wrote our own way to accomplish these tasks. Finally 
some experienced guys looked at what they were doing and what other 
people were doing. They had a Holy Sh*t moment when they realized that 
they had 50 ways to do exactly the same thing. They looked at the 
various ways and tried to pick the best strategy.
A design pattern book is not a road map to building an application. It 
is a collection of best practices for the tasks that come up all the time.
It hard to imagine even a small program that could not use at least one 
of the design patterns that have been identified.
It is hard to imagine a Flash program that would not be a candidate for 
several design patterns. A game with no Listener/Observer is hard to 
imagine. (How many onEnterFrames does it take to kill a program? )
How do you handle onLoad's famous scope?  There is a design pattern for 
this and it gets explained every time a new flashcoder tries to read an 
XML file. You can probably find this in the archives once every 2 weeks. 
They do not call it a Design Pattern but it is.


If you doubt the usefulness of Design Patterns, read Head First Design 
Patterns. You will read each section and sometimes be amazed at the 
simplicity of the solution and wonder why you never figured this out. In 
other sections you will say What is the big deal? I do it like this all 
the time.


It is not magic or advanced. If a pattern was shown to a new programmer 
without giving it a fancy name, they would just accept it as the best 
way to do the task and would never give it moment's thought. If you were 
trying to get the class to build a game, you would be foolish not to 
explain the Observer pattern. It is very simple and the alternatives are 
often really ugly and overly complex and frustrate the best of us.



Ron


___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Ron Wheeler



T. Michael Keesey wrote:

On 8/21/07, Ron Wheeler [EMAIL PROTECTED] wrote:
  

T. Michael Keesey wrote:


On 8/21/07, Ron Wheeler [EMAIL PROTECTED] wrote:

  

myShape.x = 500;

  

I hope that you meant
myshape.setX(500);



Huh?

No, that's not part of the flash.display.Shape API. And while it's
true that x in this context is actually not a true field, but a pair
of methods (__get__x and __set__x, not getX and setX) disguised as a
field, I think you can safely ignore that in an introductory class.
  

That is the problem when you have to use someone's API and it does not
follow standards.
They probably wrote it before we know the right way to do getters and
setters - or they never bothered to read up on the state of the art in
programming.



Uh, you do realize that is Adobe's own API, right?

  
I have been building RIAs in Flash since AS1. I am under no illusions 
about  Macromedia. They wrote AS1without reading ECMA spec or even 
looking at Java. We were using Eclipse and talking about in this forum, 
2 years before Macromedia adopted it.
The lack of standardization in the old components and Classes is not 
something to emulate or teach as a good model.
To be fair, they have really got a lot better once they realized that 
there is a strong community that uses Flash for building real 
applications that have to be robust and maintainable in the real world.


Ron

http://livedocs.adobe.com/flex/2/langref/flash/display/Shape.html#propertySummary

That is the proper way to do getters and setters in ActionScript
(2.0 and 3.0). This isn't Java.

  

___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Steven Sacks
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Ricky Bacon

Steven Sacks wrote:
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.


LISP?  Just sayin...

-Ricky
___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Johannes Nel
i think teaching someone OOP from the begining is not a bad idea, you are
still teching them to code but around classes. you do not need to introduce
more advanced concepts until later.  the best free book i think is thinking
in java by bruce eckel and should be easily adaptable for your needs.
i also think as3 is a good place to start, you would be equipping them with
a better language while still allowing them to do graphics. those who want
to learn more coding will slot easier into languages like java, c# etc.

On 8/20/07, Ricky Bacon [EMAIL PROTECTED] wrote:

 Steven Sacks wrote:
  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.

 LISP?  Just sayin...

 -Ricky
 ___
 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




-- 
j:pn
http://www.memorphic.com/news/
___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Mike Reilly
Thanks Ron, I think you've found my wavelength (as fluctuating as it
might be).  I agree on that patterns would be awesome to teach, as
early as they can conceive what an object is.

The book Objects First by Kolling is my inspiration for doing this,
it's aimed at the right level.  Take a game apart, understand the
objects, understand the classes that make them up, tweak the classes,
build some classes, inheritance, etc.

I'll also take a look at Sandy, 3D would be so cool!

If you have the time (I'm assuming you don't, so no pressure), could
you teach me about how I would use intervals for something like a
simple Paddle class in Pong?  Just something for KeyListeners, to move
the paddle object.  This is one of the first lessons I would like to
get across, using a class from the Library of a movie for two
instances.  After Pong I was going to move toward Space Invaders, to
throw in Arrays and reinforce the class - objects relationship.

Thanks again!
Mike

On 8/19/07, Ron Wheeler [EMAIL PROTECTED] wrote:
 You might also want to look at Sandy.
 It is a 3D engine for Actionscript.
 Very easy to build 3D applications that might be fun for the kids.

 Check out Script_in_Action forum for resources and links.


 Mike Reilly wrote:
  Thanks so much to all of you for such quick responses.  I'm sure my
  students will benefit from many of the links that you've already sent.
 
  Since I'm not the best at clarity when writing, I'll throw out what
  started this thinking.  I read Andy Harris' Beginning Flash Game
  Programming For Dummies, and I think the level of that book was
  awesome for intro.  I have also been using Greenfoot.org as a
  supplement to teach Java, as kids love games whether it's intro or
  more advanced (remember, these are 14-17 year olds, and we're trying
  to generate an interest in programming).
 
  So this semester I'll be trying to develop an OO approach, using
  Actionscript (can't install anything else without formal district
  approval).  Some of the resources forwarded should be very helpful,
  and I truly appreciate all support.
 
  I'll be reading Moock's Essential ActionScript 2.0, combining it
  with Harris' Dummies, to create Essential Games for Dummies!
 
  On a serious note, how do you get an enter_frame event handler to
  work inside an AS file?
 
 It works but you shouldn't use it . Look at using intervals.
 Try not to teach bad programming practices to kids at that age.

 You might also want to read Heads Up Design Patterns just to find out
 the right way to do many things. It is oriented to Java but all
 relevant to ActionScript.

 Ron
  Thanks again, I won't bother you all much more.  Please take a look at
  last year's kids work:  www.nghsit.com/studyhall
 
  Mike
  ___
  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

___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Mark Winterhalder
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 

Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Ron Wheeler



Mike Reilly wrote:

Thanks Ron, I think you've found my wavelength (as fluctuating as it
might be).  I agree on that patterns would be awesome to teach, as
early as they can conceive what an object is.

The book Objects First by Kolling is my inspiration for doing this,
it's aimed at the right level.  Take a game apart, understand the
objects, understand the classes that make them up, tweak the classes,
build some classes, inheritance, etc.

  
I like the coding techniques that are used in the patterns. It does show 
how a lot of functionality can be produced with minimal code by 
intelligent use of objects.
I am not sure that I would teach them as Patterns. I would just use 
the patterns as examples of how to get things done. It is nice that they 
have names and everyone knows what you mean when you say decorator 
but I am not sure that the names are as important as knowing how to get 
things done well.


Patterns are not separate from OOP, they are just best practices for 
using OOP in an intelligent way.


The Head First Design Pattern book is very good in this regard and the 
examples are very short and use entertaining examples that everyone can 
understand - make a duck quack and fly - then throw in a rubber duck and 
see how little it takes to modify the duck objects to deal with squeaky, 
non-flying ducks.
Their Decorator pattern makes a nice introduction into the power of 
objects which is a lot more concrete than a whole discussion about the 
theory.
The examples are in Java so you have to make some small adjustments and 
you probably want to give them a MovieClip to draw on rather than a 
console to write on so your standard main test program will be different.


If you are going to try to use games in Flash as the theme, you want to 
walk them through the Listener pattern early on since you will need this 
one to avoid a real mess in handling user events.



I'll also take a look at Sandy, 3D would be so cool!

If you have the time (I'm assuming you don't, so no pressure), could
you teach me about how I would use intervals for something like a
simple Paddle class in Pong?  Just something for KeyListeners, to move
the paddle object.
Use events to find out about user inputs. Keys being released means the 
user wants something done.
Use intervals to generate events that are time related (wake up every 
1/x of a second to move the ball.) When you wake up, check the state of 
things, do what needs to be done (move the ball, update the clock or 
timer, ) and set a new interval.
You can also do these things when the user presses a key, just cancel 
your pending interval and set a new one.
If you use the Listener pattern it gets very easy to add functions to 
the list of things that need to get done when the central event handler 
wakes up or responds.

  This is one of the first lessons I would like to
get across, using a class from the Library of a movie for two
instances.  After Pong I was going to move toward Space Invaders, to
throw in Arrays and reinforce the class - objects relationship.

  
rantTeach them about arrays of objects. Don't let them put anything 
else in an array. It would be nice to find a bunch of programmers that 
are surprised to find out that you can put numbers in an array rather 
than the current case where the opposite is true and people create 
horrible messes of parallel, multidimensional arrays when an array of 
objects would be much clearer and require a lot less code and infinitely 
less debugging time. /rant

Thanks again!
Mike

On 8/19/07, Ron Wheeler [EMAIL PROTECTED] wrote:
  

You might also want to look at Sandy.
It is a 3D engine for Actionscript.
Very easy to build 3D applications that might be fun for the kids.

Check out Script_in_Action forum for resources and links.


Mike Reilly wrote:


Thanks so much to all of you for such quick responses.  I'm sure my
students will benefit from many of the links that you've already sent.

Since I'm not the best at clarity when writing, I'll throw out what
started this thinking.  I read Andy Harris' Beginning Flash Game
Programming For Dummies, and I think the level of that book was
awesome for intro.  I have also been using Greenfoot.org as a
supplement to teach Java, as kids love games whether it's intro or
more advanced (remember, these are 14-17 year olds, and we're trying
to generate an interest in programming).

So this semester I'll be trying to develop an OO approach, using
Actionscript (can't install anything else without formal district
approval).  Some of the resources forwarded should be very helpful,
and I truly appreciate all support.

I'll be reading Moock's Essential ActionScript 2.0, combining it
with Harris' Dummies, to create Essential Games for Dummies!

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

  

It works but you shouldn't use it . Look at using intervals.
Try not to teach bad programming practices to kids at that age.

You might also want 

RE: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Norman Cousineau
Interesting thread.  Please let me get back to work ! ;)

In line with Steve Sacks' message, I can recommend Steve McConnell's Code 
Complete 2nd ed.
It deals with best practices in general, and is well written. (http://cc2e.com/)

However, pedagogically (not that I'm an expert), I think it's ok for Mike 
Reilly to whet the appetite of his students.  Considering they're only in high 
school, they have a long road ahead, and lots of opportunity to learn other 
things.

Norm Cousineau (Deseloper)


-Original Message-
From: Steven Sacks [mailto:[EMAIL PROTECTED]
Sent: Monday, August 20, 2007 2:43 AM
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] Intro to OOP using ActionScript


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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Ron Wheeler
What is a subroutine? Not used in this millennium. Seems to be a 
concept from the distant past.


Start with OOP. We did not get  here by accident.
It is easier. It is less prone to errors. It makes your coding examples 
much smaller and much easier to grasp.


Their code exists in a small context. You can write the test programs to 
get them started and let the students start by programming simple 
classes that compile on their own and can be incorporated into your test 
environment which they do not have to deal with until you are ready to 
show them the object that uses their simple class.


Define the interface that their code must implement (might as well get 
them used to programming to an interface), let them extend your interface.
Show them how the interface is the contract between the user and the 
class.
If you give them the interface class with lots of comments about the 
functionality required for each method, you have the description of the 
assignment.


Ron


Johannes Nel wrote:

i think teaching someone OOP from the begining is not a bad idea, you are
still teching them to code but around classes. you do not need to introduce
more advanced concepts until later.  the best free book i think is thinking
in java by bruce eckel and should be easily adaptable for your needs.
i also think as3 is a good place to start, you would be equipping them with
a better language while still allowing them to do graphics. those who want
to learn more coding will slot easier into languages like java, c# etc.

On 8/20/07, Ricky Bacon [EMAIL PROTECTED] wrote:
  

Steven Sacks wrote:


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.
  

LISP?  Just sayin...

-Ricky
___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Ron Wheeler
They do claim that men never pass the emotional age of 12 and I have 
with guys who were 5 with 30 years of experience.. So 4 and 14 are not 
so far apart (on the male side at least).



T. Michael Keesey wrote:

On 8/19/07, Ron Wheeler [EMAIL PROTECTED] wrote:
  

Some of the Heads Up Design Patterns examples are fun and designed to
appeal to the 14 year old in all of us. (How does your duck quack? What
if it is a rubber duck?)



14-year-old or 4-year-old?

  

___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Ron Wheeler

You can learn the basics while using OOP.
It is just easier. You can start with simple objects and still write a 
complete piece of code that has a set of well-defined behaviours and can 
be stuck into a test program without having to deal with the whole nasty 
story at once.


I am not sure how OOP eliminates procedural code unless procedural code 
is taken to mean spaghetti code where the execution path is 
unpredictable and every variable starts _root.


It is hard to see how you have many classes with no properties so I 
think that the students will find out about Strings, etc.
Some objects will need Arrays of other objects so I am pretty sure that 
you can get to Arrays at some point.
Class methods have been known to have iterations in them so that can be 
covered.

Might even get to recursion!!!

Naming conventions are essential. Worthwhile to make sure that all of 
your examples are 100% correct and deduct bigtime for assignments with 
violations of conventions. This gets very important when you start to 
get into frameworks which use class inspection to find things.


I would not worry about AS1 and maintaining other people's crappy code. 
If they are lucky, they will be too late into the fray and we will have 
fixed up all of the crap by then.
Realistacally,  it is unlikely that any of them will actually ever make 
a living from ActionScript programming since most of them will probably 
end up in other fields since it is a high-school not a university course.


Ron

Steven Sacks 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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Brian Lesser
Mutimedia authoring tools have been object oriented for a long time 
because interactive multimedia requires a reasonable way to handle 
user-driven events. So there is no way to avoid working with objects. 
But what does it mean to start with OOP? or not start with OOP? I 
have a lot of sympathy for Steven's first point. Students who are new to 
programming have a lot to learn that we take for granted. It is an 
interesting problem: where to start so that students can learn in 
managable increments and can enjoy the process by having lots of 
opportunities to experiment with things that interest them.


If you have them on your bookshelf have a look at the first chapter of 
Colin Moock's Essential ActionScript 3.0 and chapter 1 of his 
ActionScript for Flash MX. Now ask yourself which chapter you would 
prefer to start teaching students in high school with? In chapter 1 of 
ActionScript for Flash MX students see the basics of what some might 
call procedural programing, such as expressions and statements. They 
also read about handling events and scripting objects (Buttons and 
TextFields). By the end of the chapter they can build and experiment 
with a simple quiz. So after less than 40 pages they have something they 
can work with that does something. That's important.


On the hand, Essential ActionScript 3 spends roughly 40 pages on 
packages, classes, objects, constructors, and other things. It takes 
about six chapters before you have much code you can really play with 
that has any impact on the user. (By the way, I'm not knocking Colin's 
books. They are brilliantly written and I plan on using the AS3 book to 
teach with next term.) Six chapters is alot to impose on high school 
students in the first week or two when you want to get them to start off 
doing something interesting.


So what does it mean to start with OOP? My personal approach is to delay 
detailed teaching of packages, classes, inheritance, and so on. I 
usually start with creating classes that can be associated with 
movieclips or sprites in the library. I show students how to write 
methods that give sprites new behaviours. Writing individual methods 
involves procedural coding in response to events. Movement, drag and 
drop, hit detection etc. Then I provide them with enough scaffolding 
code to build something like a simple game. As the course progresses 
they write code that provide sprites with more complex behaviours and 
enhance games to, keep scores, add difficulty for the user, and add 
levels. Along the way they learn about objects, packages, classes and 
subclasses. I make sure they write nearly all their code in class files 
from beginning to end.


In short I think you get a lot more mileage in the early going of a 
class by providing examples and scaffolding that students can start 
experimenting with early and parcel out higher-level object-oriented 
programming and design theory as you go. In some ways AS 2 and 
especially AS 3 make it harder for students to dive in quickly. But with 
a little care and good examples its possible to lower the barrier to 
experimentation - which I think is the essential thing.


Also, maybe its worth saying that I've seen the results of too much 
theory up front on first year computer science students. Many are lost 
by the approach. They are unsure what classes to create and what code to 
put in each method to solve a problem. At any rate the essential thing 
is to start where you students are and not where you want them to be. 
Start with what they find interesting and not just what you find 
interesting.


Yours truly,
-Brian

Ron Wheeler wrote:

What is a subroutine? Not used in this millennium. Seems to be a 
concept from the distant past.


Start with OOP. We did not get  here by accident.
It is easier. It is less prone to errors. It makes your coding 
examples much smaller and much easier to grasp.


Their code exists in a small context. You can write the test programs 
to get them started and let the students start by programming simple 
classes that compile on their own and can be incorporated into your 
test environment which they do not have to deal with until you are 
ready to show them the object that uses their simple class.


Define the interface that their code must implement (might as well get 
them used to programming to an interface), let them extend your 
interface.
Show them how the interface is the contract between the user and the 
class.
If you give them the interface class with lots of comments about the 
functionality required for each method, you have the description of 
the assignment.


Ron


Johannes Nel wrote:

i think teaching someone OOP from the begining is not a bad idea, you 
are
still teching them to code but around classes. you do not need to 
introduce
more advanced concepts until later.  the best free book i think is 
thinking

in java by bruce eckel and should be easily adaptable for your needs.
i also think as3 is a good place to start, you 

Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Roy Pardi
At 11:43 PM -0700 8/19/07, Steven Sacks 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.

This has been my experience teaching beginning programming to designers and
artists. You would be surprised at how many people have problems grasping
abstract concepts like objects or arrays, or translating their
understanding of conditional logic, objects and the rest from their
experience of the real world to the abstract world of code.

--Roy
-- 
-
Studio Site Updated!
http://www.roypardi.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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Roy Pardi
At 9:54 PM -0400 8/19/07, Mike Reilly wrote:
I think we're on the same path Roy.  While I have some future coders,
this is Intro for 9th-11th grade kids, so my task is to teach but also
whet their appetite for more.  My deeper desire is to do it as OO as
possible, to better prepare them for AP Comp Sci if they choose.

I used to be the Co-Director of TechBoston up there in Boston, wish I
were closer. I'm in Georgia now.

If you're interested in doing more of an OO spin, let me know and I'll
keep you in the loop.


Hi Mike,
I'd be interested to hear how it goes. In this class that is now finishing
up most of the students are in the digital content creation areas, not
programming and this is a required class. I realized at a certain point
that there was a fundamental difference between my students who had
self-selected to pursue the programming path and those who were in the
class only because it was required. The former group are more comfortable
with abstract thinking, have a greater tolerance  patience for certain
types of problem solving. They had major problems with basic things and too
often resorted to memory rather than understanding (i.e they remember how
a for loop should be set up without really getting it). These are bright
folks so it's more that they have strengths in other areas.

Programming is basically just writing- and some people take to it and find
pleasure and creative opportunities through it and other people can do it
if they have to, though struggle with organizing their ideas or being clear
but find it difficult and frustrating.

--Roy
-- 
-
Studio Site Updated!
http://www.roypardi.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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Steven Sacks

 What is a subroutine? Not used in this millennium. Seems to be a
 concept from the distant past.

Distant past?  Subroutines are the foundation of DRY and OOP.

http://en.wikipedia.org/wiki/Subroutine

This is exactly what I mean by developers taking for granted what it 
took to get them where they are, and I think it proves my point.  You 
learn something until you forget it, meaning it becomes second nature 
and you cease to think about it, it has become hardwired.


So, while the term subroutine might feel like a concept from the 
distant past, that's because it is a concept from your distant past 
when you were first cutting your teeth that has become something that is 
now simply accepted knowledge, and you take for granted that you 
understand it.


A subroutine is one of the foundational concepts of programming, 
especially OOP, and understanding subroutines and why they're used is 
fundamental to programming in general.  Again, there are more to the 
basics of programming than just knowing Arrays, Strings, Numbers, math, 
iteration, etc.  OOP is just not beginners territory.  Intermediate at best.


If you wanted to teach OOP at a conceptual level without digging into 
actual code, I could see a use for that, but you can't teach coding 101 
while teaching a 300 level course.

___
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


RE: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread David Ngo
I'm with Steven on this one. I, too, started way back in the days of
procedural programming (Turbo Pascal, anyone?) and all of that taught me to
understand the basic how's and why's of programming. I see a lot of new
developers today who take what they read verbatim and apply it only because
everyone else tells them they should. They don't necessarily understand the
'why' and, to me, that's just as important as learning about literals,
syntax and objects.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks
Sent: Monday, August 20, 2007 1:09 PM
To: [EMAIL PROTECTED]; flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] Intro to OOP using ActionScript

  What is a subroutine? Not used in this millennium. Seems to be a
  concept from the distant past.

Distant past?  Subroutines are the foundation of DRY and OOP.

http://en.wikipedia.org/wiki/Subroutine

This is exactly what I mean by developers taking for granted what it 
took to get them where they are, and I think it proves my point.  You 
learn something until you forget it, meaning it becomes second nature 
and you cease to think about it, it has become hardwired.

So, while the term subroutine might feel like a concept from the 
distant past, that's because it is a concept from your distant past 
when you were first cutting your teeth that has become something that is 
now simply accepted knowledge, and you take for granted that you 
understand it.

A subroutine is one of the foundational concepts of programming, 
especially OOP, and understanding subroutines and why they're used is 
fundamental to programming in general.  Again, there are more to the 
basics of programming than just knowing Arrays, Strings, Numbers, math, 
iteration, etc.  OOP is just not beginners territory.  Intermediate at best.

If you wanted to teach OOP at a conceptual level without digging into 
actual code, I could see a use for that, but you can't teach coding 101 
while teaching a 300 level course.
___
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


RE: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Kerry Thompson
Steven Sacks wrote:
 
 A subroutine is one of the foundational concepts of programming,
 especially OOP

Right on, Steven. We call them functions or methods now. Subroutine is
simply an older name for a very current concept.

There are some advantages to having been a programmer since 1980.

Cordially,

Kerry Thompson


___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Steven Sacks
OOP might seem easy to understand to people who understand it, but how 
can you expect anyone to think abstractly about concepts they don't even 
understand at a concrete level?  If this was a class of people who 
understood basic programming but had no OOP experience, then I'd say 
sure give it a shot, but these are non-programmers.


There are classes that require abstract thinking by students on subjects 
that they have a solid foundation on already, and those classes can be 
very challenging for some people.  Attempting to explain the benefits of 
inheritance to somebody who doesn't even understand the difference 
between indexed and associative arrays (or even what they are) is pointless.


You can't teach chromatic scales to somebody who is just learning to 
read sheet music.  You can't teach iambic pentameter to somebody who is 
just learning how to speak.  You can't teach calculus to somebody who is 
just learning algebra.  You can't teach OOP to somebody who is just 
learning what variables and functions are.


OOP is not a foundation for programming, it's a programming paradigm. 
You can't look at different paradigms if you don't know even know what 
you're looking at in the first place.  It's a topic you don't get into 
until you're at least intermediate level, and a topic you don't truly 
grasp well until you've been doing it for awhile (i.e. senior level).





___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Steven Sacks
You can simplify it by saying A subroutine is a function that is called 
by another function.  But, how can you explain the concept of a 
subroutine to somebody who doesn't even know what a function is?


While the term subroutine has fallen out of popular use, I know what 
it is and what it means without even thinking about it.  It's that type 
of foundation that is required for learning OOP.

___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread John McCormack
I came at software from the electronics upwards, and maybe because of that I
sometimes don't see the woods for the trees. If these kids get to handle
objects in a more natural way without being concerned about what they are
made of they might get a better feel for OOP.

Also, in today's world it's more important to learn how to learn and go for
the detail as you need it. The most important thing is to grab their
interest and let their motivation kick in.

All the same I take your point about the need for basics. Many people here
in the UK know how to handle software but are unfamilar with files and
folders and so come unstuck.

John

- Original Message - 
From: Steven Sacks [EMAIL PROTECTED]
To: flashcoders@chattyfig.figleaf.com
Sent: Monday, August 20, 2007 7:53 PM
Subject: Re: [Flashcoders] Intro to OOP using ActionScript


 OOP might seem easy to understand to people who understand it, but how
 can you expect anyone to think abstractly about concepts they don't even
 understand at a concrete level?  If this was a class of people who
 understood basic programming but had no OOP experience, then I'd say
 sure give it a shot, but these are non-programmers.

 There are classes that require abstract thinking by students on subjects
 that they have a solid foundation on already, and those classes can be
 very challenging for some people.  Attempting to explain the benefits of
 inheritance to somebody who doesn't even understand the difference
 between indexed and associative arrays (or even what they are) is
pointless.

 You can't teach chromatic scales to somebody who is just learning to
 read sheet music.  You can't teach iambic pentameter to somebody who is
 just learning how to speak.  You can't teach calculus to somebody who is
 just learning algebra.  You can't teach OOP to somebody who is just
 learning what variables and functions are.

 OOP is not a foundation for programming, it's a programming paradigm.
 You can't look at different paradigms if you don't know even know what
 you're looking at in the first place.  It's a topic you don't get into
 until you're at least intermediate level, and a topic you don't truly
 grasp well until you've been doing it for awhile (i.e. senior level).




 ___
 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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread [p e r c e p t i c o n]
I started in the industry as a t.a. for a graduate course in
programming...the research as well as my own personal experience suggests
that younger people tend to learn the semantics and nuance of object
oriented programming much easier than older adults...with that said..AS1 or
even JavaScript for that matter actually provides a suitable introduction to
OOP on some level...while still being heavily steeped in the procedural
paradigm...i would start there let them build a few things that way then
expand on the concept of OOp from there...after all...the most important
thing is the fundamentals...no matter how the discipline evolves...it
evolves  from the fundamentals

cheers

p

On 8/19/07, Mike Reilly [EMAIL PROTECTED] wrote:

 Hi there -

 I'm a high school teacher who's decided to teach Intro to
 Programming using Actionscript (2.0 for now, waiting for the school
 to upgrade).

 I'd prefer to take an OO approach, and use games in doing so.  For
 example, my first game would be a Pong copy.  Lots of basics in there
 to learn the environment, basic principles, etc.

 So, I was wondering if anyone out there knew of good resources, wanted
 to contribute (hell, I'll give you all the credit, you can write a
 book, etc.), collaborate, share.  I've search most of the tutorial
 sites, but most code is not a great OO example for Flash games due to
 little OO, or too much complexity for the beginner.

 Your input is welcome, rock on.

 Mike
 ___
 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


RE: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Kerry Thompson
 [p e r c e p t i c o n] wrote:
 AS1 or even JavaScript for that matter actually provides a suitable
introduction to
 OOP on some level

Oof. I agree with most of what you said except for AS1 being a suitable
introduction to OOP. I consider AS1's OOP model an abomination. You can
write OOP in AS1 if you work really hard, and don't let any other
programmers get their hands on it, but it's way, way too easy to break
encapsulation.

AS2's OOP implementation is light years ahead of AS1, and AS3, from what
I've read, is even better. Plus, AS2's class approach is much more standard
than the AS1 prototype approach.

Cordially,

Kerry Thompson


___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread [p e r c e p t i c o n]
hi Kerry,
i understand your point, but i found that when teach students how to use an
object and what's contained in an object first, then the more conceptual
ideas come easier...of course every class and every student is different...

p

On 8/20/07, Kerry Thompson [EMAIL PROTECTED] wrote:

 [p e r c e p t i c o n] wrote:
  AS1 or even JavaScript for that matter actually provides a suitable
 introduction to
  OOP on some level

 Oof. I agree with most of what you said except for AS1 being a suitable
 introduction to OOP. I consider AS1's OOP model an abomination. You can
 write OOP in AS1 if you work really hard, and don't let any other
 programmers get their hands on it, but it's way, way too easy to break
 encapsulation.

 AS2's OOP implementation is light years ahead of AS1, and AS3, from what
 I've read, is even better. Plus, AS2's class approach is much more
 standard
 than the AS1 prototype approach.

 Cordially,

 Kerry Thompson


 ___
 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


RE: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Jesse Graupmann

http://www.debreuil.com/docs/ch01_Intro.htm   

http://www.kirupa.com/developer/oop2/AS2OOPindex.htm 

---

http://proto.layer51.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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread T. Michael Keesey
I think both sides of this debate have some valid points, although I'd
lean a lot more strongly toward the teach OOP later approach. But
it's still possible to create OOP code from the start in AS2 or AS3.

The fundamentals of programming are variables, expressions, control
structures, and methods/functions/subroutines. In theory, you could
start teaching about variables with a pretty simple class like so:

package {
class MyProgram {
function MyProgram() {

var text:String = Hello, world!;
trace(text);

}
}
}

At this stage there'd be no point in explaining what the package,
class, or function lines actually do--just say, Don't worry about it;
we'll get to that later. I think it would be pretty easy to just
focus on the lines within the constructor. Once they have variables,
expressions, and control structures down, you can introduce the idea
of adding other functions. Once that's ingrained (maybe by the
beginning of an intermediate class) you can start to show how code can
be divided into classes and packages, how functions can have different
scopes, etc., and they won't be totally weirded out by the new
structure.

Just my thoughts. In the end it probably doesn't make much difference
whether you introduce the concepts via timeline code or simple, single
classes, as above. The core concepts being presented would be the
same, it's just a matter of whether you want to introduce them to the
environment of OOP earlier or later. In either case, the concepts of
OOP should come later.
-- 
T. Michael Keesey
Director of Technology
Exopolis, Inc.
2894 Rowena Avenue Ste. B
Los Angeles, California 90039
___
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


RE: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Kerry Thompson
 [p e r c e p t i c o n] wrote:
 
 i understand your point, but i found that when teach students how to use
an
 object and what's contained in an object first, then the more conceptual
 ideas come easier

Ok, I'll buy that.

Not to be argumentative--just curious--how do you find the AS1 prototype
model easier to understand than the class/object model? I'll admit to having
a strong bias for the class model from my time with C++ and Lingo, and
having a tough time when first introduced to the prototype model.

Cordially,

Kerry Thompson


___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread [p e r c e p t i c o n]
i guess it depends on where you begin...i think special attention has to be
paid to as1's ability to add variables and function dynamically because it's
at once very powerful and in the hands of someone looking to expand their
knowledge of programming and programming languages very misleading because
most languages don't make it that easy to do that sort of thing...

but, it's still a bit easier to explain prototype after having explained how
to use variables and functions, then how to attach them to objects like
moviclips, than it is to explain the relationship of
class/encapsulation/inheritence/polymorphism...ooops did i say polymorphism
in relation to actionscript?...well ok let's say interface...

my point is that these are higher level concepts that are much easier to
grasp if you have the fundamentals of vars/functions/scope

i came from c++ as well ...the concept of adding vars and functions
dynamically was very alien,yet liberating...and protoype just confused me
because i can be thick when i'm rushing to get a project done, but everyone
i know who came over from lingo has had a very hard time with actionscript,
oddly, i  couldn't learn lingo...i tried several times and never quite
caught on...

all in all i too am biased towards the class model, but when people ask me
if they should learn c or c++ first i always say learn c first...

regards

p



On 8/20/07, Kerry Thompson [EMAIL PROTECTED] wrote:

 [p e r c e p t i c o n] wrote:

  i understand your point, but i found that when teach students how to use
 an
  object and what's contained in an object first, then the more conceptual
  ideas come easier

 Ok, I'll buy that.

 Not to be argumentative--just curious--how do you find the AS1 prototype
 model easier to understand than the class/object model? I'll admit to
 having
 a strong bias for the class model from my time with C++ and Lingo, and
 having a tough time when first introduced to the prototype model.

 Cordially,

 Kerry Thompson


 ___
 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


RE: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Kerry Thompson
 [p e r c e p t i c o n] wrote:
 
 i guess it depends on where you begin...i think special attention has to
be
 paid to as1's ability to add variables and function dynamically 

I agree with most everything you say, but that's where we'll have to agree
to disagree. I think the ability to add variables and functionality
dynamically is AS1's weakest point as far as OOP implementation. I can think
of no easier way to break encapsulation. But I do agree that it's very
powerful, much like Darth Vader ;-)

 everyone i know who came over from lingo has had a very hard time with
actionscript

Except me ^_^

With apologies to all my Director friends on this list, I find ActionScript
a far superior OOP model than Lingo. The only problems I'm having are with
Flash itself, not AS. The standard set--scope, components, depths.

 oddly, i  couldn't learn lingo...i tried several times and never quite
 caught on...

It took me years to become truly proficient. Even after 10 years doing
mostly Director, there are still things that I haven't explored.

 all in all i too am biased towards the class model, but when people ask me
 if they should learn c or c++ first i always say learn c first...

I feel the same way. C gives you a feeling for the nitty-gritty of the
computer. I use C++ now, but I did a lot of C first (and Assembler before
that). Can you imagine writing a C library to display Chinese characters on
English Windows 3.1? I would have died if it hadn't been for Paetzold.

Cordially,

Kerry Thompson


___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread [p e r c e p t i c o n]
 I feel the same way. C gives you a feeling for the nitty-gritty of the
 computer. I use C++ now, but I did a lot of C first (and Assembler before
 that). Can you imagine writing a C library to display Chinese characters
 on
 English Windows 3.1? I would have died if it hadn't been for Paetzold.

 here here!



cheers

p

___
 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


RE: [Flashcoders] Intro to OOP using ActionScript

2007-08-19 Thread Kerry Thompson
Mike Reilly wrote:
 
 I'm a high school teacher who's decided to teach Intro to
 Programming using Actionscript (2.0 for now, waiting for the school
 to upgrade).
 
 I'd prefer to take an OO approach, and use games in doing so

I'd recommend two books, both by Colin Moock, both published by O'Reilly.

First read ActionScript for Flash MX: The Definitive Guide, then
Essential ActionScript 2.0.

The first one is an excellent introduction to coding in Flash. It covers
essential things like levels vs. layers. It also has an excellent reference
for Flash commands and classes.

Some of the ActionScript in that one is a bit dated--a lot is based on AS 1.
I'd skim over the code examples, because AS 2 is a very different model.
Basically, you can write OOP in AS 1, with some difficulty, while AS 2 is
OOP-oriented.

The second book has excellent coverage of OOP and its AS 2 implementation.

Start with those two, and you really can't go wrong. There are a lot of
other good books, but I consider those the cream of the crop.

Cordially,

Kerry Thompson


___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-19 Thread Roy Pardi
At 8:19 PM -0400 8/19/07, Mike Reilly wrote:
Hi there -

I'm a high school teacher who's decided to teach Intro to
Programming using Actionscript (2.0 for now, waiting for the school
to upgrade).

I'd prefer to take an OO approach, and use games in doing so.  For
example, my first game would be a Pong copy.  Lots of basics in there
to learn the environment, basic principles, etc.

Hi Mike,

I'm teaching an AS 2 class for non-programmers at Northeastern this Summer
(they haven't upgraded yet either). I use Pong as a basic example (and then
beat it to death.. ;-) Not true OOP with this group but I introduce the
ideas. The class site is here: http://roypardi.com/neu_summer/ - maybe this
will give you some ideas of what to do (or not to do..).

--Roy
-- 
-
Studio Site Updated!
http://www.roypardi.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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-19 Thread Jobe Makar

Hi Mike,

I don't have exactly what you're looking for but hopefully it can help a 
bit. I am working on an AS3 version/rewrite of my game design demystified 
series of books. That won't be out for a long time, but you can lots of game 
related code from physics to AI on my blog. For the most part it is AS3, but 
there is some AS2 as well. Here is the link:

http://jobemakar.blogspot.com

I wish you luck in finding the right materials for your class!

Jobe Makar
http://www.electrotank.com
http://www.electro-server.com
phone: 252-627-8026
mobile: 919-609-0408
fax: 919-882-1121
- Original Message - 
From: Mike Reilly [EMAIL PROTECTED]

To: flashcoders@chattyfig.figleaf.com
Sent: Sunday, August 19, 2007 8:19 PM
Subject: [Flashcoders] Intro to OOP using ActionScript



Hi there -

I'm a high school teacher who's decided to teach Intro to
Programming using Actionscript (2.0 for now, waiting for the school
to upgrade).

I'd prefer to take an OO approach, and use games in doing so.  For
example, my first game would be a Pong copy.  Lots of basics in there
to learn the environment, basic principles, etc.

So, I was wondering if anyone out there knew of good resources, wanted
to contribute (hell, I'll give you all the credit, you can write a
book, etc.), collaborate, share.  I've search most of the tutorial
sites, but most code is not a great OO example for Flash games due to
little OO, or too much complexity for the beginner.

Your input is welcome, rock on.

Mike
___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-19 Thread Mark Winterhalder
 I'm a high school teacher who's decided to teach Intro to
 Programming using Actionscript (2.0 for now, waiting for the school
 to upgrade).

You don't have to limit yourself to AS2 just because your school's
Flash version isn't CS3 yet.
If you plan to go the OOP route, and Pong specifically, there probably
won't be that much in terms of timeline animation anyway. You'll have
graphics for the paddles, the ball and the score. That'll pretty much
be it, the rest will be code. You don't need the Flash IDE for that.
I'd recommend you have a look at the Flex 2 SDK (or even haXe[.org]).

There are several reasons why I believe that it is an alternative you
should consider:
AS2 is on the way out, AS3 will stay. AS3's API is more consistent.
AS3 is compiled for the new (much faster) VM, which is a big advantage
for games. Finally, and this is the most important reason IMHO, the
Flex 2 SDK is free, so your students can (legally) install it at home.

Mark




On 8/20/07, Mike Reilly [EMAIL PROTECTED] wrote:
 Hi there -

 I'm a high school teacher who's decided to teach Intro to
 Programming using Actionscript (2.0 for now, waiting for the school
 to upgrade).

 I'd prefer to take an OO approach, and use games in doing so.  For
 example, my first game would be a Pong copy.  Lots of basics in there
 to learn the environment, basic principles, etc.

 So, I was wondering if anyone out there knew of good resources, wanted
 to contribute (hell, I'll give you all the credit, you can write a
 book, etc.), collaborate, share.  I've search most of the tutorial
 sites, but most code is not a great OO example for Flash games due to
 little OO, or too much complexity for the beginner.

 Your input is welcome, rock on.

 Mike
 ___
 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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-19 Thread sean
Hi Mike,

   you've hit on an interesting dilema. Most Flash developers are to a
greater degree, self taught. This is both a blessing and a curse. The
skill level, and by extension, the development methodologies put in to
practice in the real world range from basic, timeline procedural, to
over engineered, pattern based pedantic dogma OO. I'd recommend
pragmatism. There are a number of excellent books on Actionscript and
OO methodologies and actionscript and patterns. Given the nature of
Flash, the need to enforce strict pattern based solutions is limited
but the need to enforce good OO best practices and code is essential. I
personally can't say I have ever come across a holy grail actionscript
OO site, but there are many good blogs out there that cover the info
you will need (there just a bit scattered). The best advise I can give
you is to google what you're looking for - like the rest of us ;) lol

But if you want to try blogs, then here's a couple of reliable ones:

Grant Skinner - http://www.gskinner.com/blog/
Colin Moock   - http://www.moock.org/
Keith Peters  - http://www.bit-101.com/blog/
Aral Balkan   - http://aralbalkan.com/
Guy Watson- http://www.flashguru.co.uk/
Richard Leggett   - http://www.richardleggett.co.uk/blog/index.php


There are many many others, but that should keep you going for a while.
Incidentally, if you're interested in teaching actionscript in a games
environment, you could do worse than have a look at the Nintendo Wii's
flash support. It's pretty easy and well documented on line in many sites.
It'd certainly make it popular and topical for the class and give you an
excuse to get a Wii in.

Sean
www.flashcoder.net/blog

 Hi there -

 I'm a high school teacher who's decided to teach Intro to
 Programming using Actionscript (2.0 for now, waiting for the school
 to upgrade).

 I'd prefer to take an OO approach, and use games in doing so.  For
 example, my first game would be a Pong copy.  Lots of basics in there
 to learn the environment, basic principles, etc.

 So, I was wondering if anyone out there knew of good resources, wanted
 to contribute (hell, I'll give you all the credit, you can write a
 book, etc.), collaborate, share.  I've search most of the tutorial
 sites, but most code is not a great OO example for Flash games due to
 little OO, or too much complexity for the beginner.

 Your input is welcome, rock on.

 Mike
 ___
 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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-19 Thread Mark Winterhalder
On 8/20/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 But if you want to try blogs, then here's a couple of reliable ones:

 Grant Skinner - http://www.gskinner.com/blog/
 Colin Moock   - http://www.moock.org/
 Keith Peters  - http://www.bit-101.com/blog/
 Aral Balkan   - http://aralbalkan.com/
 Guy Watson- http://www.flashguru.co.uk/
 Richard Leggett   - http://www.richardleggett.co.uk/blog/index.php

Yeah, right -- that's what his post was about in the first place. :)

Adding to the list, I came across this the other day -- well
explained, plus some really pretty interactive examples:
http://lab.polygonal.de/category/data-structures/

Mark
___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-19 Thread Mike Reilly
I think we're on the same path Roy.  While I have some future coders,
this is Intro for 9th-11th grade kids, so my task is to teach but also
whet their appetite for more.  My deeper desire is to do it as OO as
possible, to better prepare them for AP Comp Sci if they choose.

I used to be the Co-Director of TechBoston up there in Boston, wish I
were closer. I'm in Georgia now.

If you're interested in doing more of an OO spin, let me know and I'll
keep you in the loop.

Thanks!

Mike

On 8/19/07, Roy Pardi [EMAIL PROTECTED] wrote:
 At 8:19 PM -0400 8/19/07, Mike Reilly wrote:
 Hi there -
 
 I'm a high school teacher who's decided to teach Intro to
 Programming using Actionscript (2.0 for now, waiting for the school
 to upgrade).
 
 I'd prefer to take an OO approach, and use games in doing so.  For
 example, my first game would be a Pong copy.  Lots of basics in there
 to learn the environment, basic principles, etc.

 Hi Mike,

 I'm teaching an AS 2 class for non-programmers at Northeastern this Summer
 (they haven't upgraded yet either). I use Pong as a basic example (and then
 beat it to death.. ;-) Not true OOP with this group but I introduce the
 ideas. The class site is here: http://roypardi.com/neu_summer/ - maybe this
 will give you some ideas of what to do (or not to do..).

 --Roy
 --
 -
 Studio Site Updated!
 http://www.roypardi.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

___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-19 Thread Brian Lesser

Hi Mike,
I do a University course for New Media students that might be of 
interest. You can still see the old AS2 notes here:


https://my.ryerson.ca/bbcswebdav/users/blesser/Flash/FPN537/

The current site is all AS2 but I am in the midst of rewriting it to AS3 
for the fall. If you think it is useful I'll leave the old AS2 site in 
place for a while. Feel free to grab anything that you think might help.


Yours truly,
-Brian

Mike Reilly wrote:


Hi there -

I'm a high school teacher who's decided to teach Intro to
Programming using Actionscript (2.0 for now, waiting for the school
to upgrade).

I'd prefer to take an OO approach, and use games in doing so.  For
example, my first game would be a Pong copy.  Lots of basics in there
to learn the environment, basic principles, etc.

So, I was wondering if anyone out there knew of good resources, wanted
to contribute (hell, I'll give you all the credit, you can write a
book, etc.), collaborate, share.  I've search most of the tutorial
sites, but most code is not a great OO example for Flash games due to
little OO, or too much complexity for the beginner.

Your input is welcome, rock on.

Mike
___
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
 




--
__
Brian Lesser
Assistant Director, Application Development and Integration
Computing and Communications Services
Ryerson University
350 Victoria St.
Toronto, Ontario   Phone: (416) 979-5000 ext. 6835
M5B 2K3Fax: (416) 979-5220
Office: POD??  E-mail: [EMAIL PROTECTED]
(Enter through LB99)   Web: http://www.ryerson.ca/~blesser
__

___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-19 Thread Mike Reilly
Thanks so much to all of you for such quick responses.  I'm sure my
students will benefit from many of the links that you've already sent.

Since I'm not the best at clarity when writing, I'll throw out what
started this thinking.  I read Andy Harris' Beginning Flash Game
Programming For Dummies, and I think the level of that book was
awesome for intro.  I have also been using Greenfoot.org as a
supplement to teach Java, as kids love games whether it's intro or
more advanced (remember, these are 14-17 year olds, and we're trying
to generate an interest in programming).

So this semester I'll be trying to develop an OO approach, using
Actionscript (can't install anything else without formal district
approval).  Some of the resources forwarded should be very helpful,
and I truly appreciate all support.

I'll be reading Moock's Essential ActionScript 2.0, combining it
with Harris' Dummies, to create Essential Games for Dummies!

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

Thanks again, I won't bother you all much more.  Please take a look at
last year's kids work:  www.nghsit.com/studyhall

Mike
___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-19 Thread Ron Wheeler

You might also want to look at Sandy.
It is a 3D engine for Actionscript.
Very easy to build 3D applications that might be fun for the kids.

Check out Script_in_Action forum for resources and links.


Mike Reilly wrote:

Thanks so much to all of you for such quick responses.  I'm sure my
students will benefit from many of the links that you've already sent.

Since I'm not the best at clarity when writing, I'll throw out what
started this thinking.  I read Andy Harris' Beginning Flash Game
Programming For Dummies, and I think the level of that book was
awesome for intro.  I have also been using Greenfoot.org as a
supplement to teach Java, as kids love games whether it's intro or
more advanced (remember, these are 14-17 year olds, and we're trying
to generate an interest in programming).

So this semester I'll be trying to develop an OO approach, using
Actionscript (can't install anything else without formal district
approval).  Some of the resources forwarded should be very helpful,
and I truly appreciate all support.

I'll be reading Moock's Essential ActionScript 2.0, combining it
with Harris' Dummies, to create Essential Games for Dummies!

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

It works but you shouldn't use it . Look at using intervals.
Try not to teach bad programming practices to kids at that age.

You might also want to read Heads Up Design Patterns just to find out 
the right way to do many things. It is oriented to Java but all 
relevant to ActionScript.


Ron

Thanks again, I won't bother you all much more.  Please take a look at
last year's kids work:  www.nghsit.com/studyhall

Mike
___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-19 Thread Ron Wheeler



Mike Reilly wrote:

I think we're on the same path Roy.  While I have some future coders,
this is Intro for 9th-11th grade kids, so my task is to teach but also
whet their appetite for more.  My deeper desire is to do it as OO as
possible, to better prepare them for AP Comp Sci if they choose.

I used to be the Co-Director of TechBoston up there in Boston, wish I
were closer. I'm in Georgia now.

If you're interested in doing more of an OO spin, let me know and I'll
keep you in the loop.

  
There is no reason not to follow OOP principles to the hilt. You have 
all of the essential structures in ActionScript.
You might also try to explain MVC and show how this helps simplify 
programming.
MVC and OOP will give your students a really good way to get a lot done 
with a little bit of code.


Some of the Heads Up Design Patterns examples are fun and designed to 
appeal to the 14 year old in all of us. (How does your duck quack? What 
if it is a rubber duck?)


Ron


Thanks!

Mike

On 8/19/07, Roy Pardi [EMAIL PROTECTED] wrote:
  

At 8:19 PM -0400 8/19/07, Mike Reilly wrote:


Hi there -

I'm a high school teacher who's decided to teach Intro to
Programming using Actionscript (2.0 for now, waiting for the school
to upgrade).

I'd prefer to take an OO approach, and use games in doing so.  For
example, my first game would be a Pong copy.  Lots of basics in there
to learn the environment, basic principles, etc.
  

Hi Mike,

I'm teaching an AS 2 class for non-programmers at Northeastern this Summer
(they haven't upgraded yet either). I use Pong as a basic example (and then
beat it to death.. ;-) Not true OOP with this group but I introduce the
ideas. The class site is here: http://roypardi.com/neu_summer/ - maybe this
will give you some ideas of what to do (or not to do..).

--Roy
--
-
Studio Site Updated!
http://www.roypardi.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



___
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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-19 Thread T. Michael Keesey
On 8/19/07, Ron Wheeler [EMAIL PROTECTED] wrote:

 Some of the Heads Up Design Patterns examples are fun and designed to
 appeal to the 14 year old in all of us. (How does your duck quack? What
 if it is a rubber duck?)

14-year-old or 4-year-old?

-- 
Mike Keesey
___
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