I am not sure that you can say that OOP is advanced or basic.
It depends on how you teach it.
OOP lends itself to simple examples where the things being programmed
map into real world things in a much more natural way.
What do we know about cats? How would we keep track of this?
What kinds of things can cats do? Make a method that says "Meow" when it
is called. Make a method called move() that prints "running" when called.
Make a method that prints out the cat's colour when it is called. Make a
method that prints out a cat's name when it is called.
When you want to introduce Dates, add a birthdate and a method to print
out the birthday.
When you want to talk about lists, add a list of Cats that are its
offspring.
Initially, you do not have to get into what Cats is going to be used
for. You can make simple working programs that relate directly to real
world things that everyone in the class knows.
This is about as basic as you can get and allows many different concepts
to be introduced one at a time.
The test framework to test the Cat object can be given as a working
program by the instructor initially. Later the Cat object can start to
be used in more interesting ways by letting the students expand the test
framework with higher level objects.
I am pretty sure that after a month, the OOP class will be way ahead.
I am positive that by the end of the first class my OOP students would
have run at least 2 working programs that did something cat-related and
will know something about strings, properties and methods
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.
Lesson 3 How do you represent a cat with a litter of kittens? Now we
have arrays and a much clearer view of constructors and setter and getters.
Lesson 4 Dates and static classes (would not use the word "static" but
would explain how to use Date and Number)
Lesson 5 Start talking about other classes that use different types of
variables. Phone Card Object would be good. Might be tougher for the
instructor when the kids start explaining the properties and possible
methods for it :-)
Ready for their first programming job.
Ron
T. Michael Keesey wrote:
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?
_______________________________________________
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