Alice Community  

Go Back   Alice Community > Educators > Teaching with Alice

Reply
 
Thread Tools Display Modes
Alice is not object-oriented
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default Alice is not object-oriented - 11-04-2007, 03:06 PM

This is a continuation posting of a thread that was originally posted in the How Do I section but evolved into a discussion of teaching issues using Alice. The original thread can be found at: http://www.alice.org/community/showthread.php?t=943 I have taken the liberty of moving it to the Teaching with Alice section of the forum.

Although this material is primarily intended for Maggie, who was the originator of the thread, I believe that it contains information that may be useful to anyone teaching or thinking about teaching a programming course using Alice.

Maggie, among other things, you wrote:

"I feel completely paralyzed by Alice. ...The fact that you can't ask the rings questions about themselves (e.g. largerThan (ringX)) forced me to abandon object-oriented design. I don't want to unlearn object-oriented design in favor of an approach that has no information hiding and no polymorphism. If you could cast, as you can in a non-OO language such as C, then you could at least simulate good design. But even that isn't possible. So I find myself violating objects left and right ... But I still don't have an overall sense of how to design an Alice program that is readable, extensible, and robust."

I took the liberty of going to your university's web site to read the Course Syllabus, the Course Description, and the Course Objectives for CS 160. I assume that you are teaching CS 160. If not, all the following comments are probably mis-directed.

The Course Description for CS 160, which can be found at http://www.cis.umassd.edu/~x2zhang/courses/CIS160/index.html reads as follows:

"An introduction to computer science and programming. Topics include basic program design and implementation process, simple data types, control structures, an introduction to algorithms, debugging techniques, object-oriented and event-driven programming concepts. The course introduces object-oriented design, good software engineering principles and helps to develop fundamental programming skills. The design and the implementation of animation projects in 3D virtual worlds are used as teaching and learning tools in this course."

I am beginning to understand your frustration. A conflict between these documents jumped out at me immediately.

The Course Syllabus, which appears at http://www.cis.umassd.edu/%7Ex2zhang.../syllabus.html seems to be inconsistent with the Course Description. In particular, even though the course description includes references to object-oriented programming and object-oriented design, the word object appears only once in the Course Syllabus as the topic "Introduction to Objects" in the second week of the course. Clearly it is not possible to teach OOA/OOD/OOP in one week.

If I were a member of your department, the first thing that I would recommend would be for the Course Description or the Course Syllabus to be modified in order to make them consistent. (Of course, I recommend many things in my own department that never come to pass.)

The Course Objectives for CS 160 read as follows:

"This course provides an introduction to computer science and programming for students without prior programming experience through "no-frustration" experience. A student in this course is expected to gain the following three abilities:

1. Formalized thinking process and expression: the ability to read and write in a formal language
2. Abstraction: the ability to generalize and to decompose problems logically
3. Evaluation of different problem-solving approaches: to understand that although there are many ways to solve a problem, some are inherently better than others.

This course prepares students for programming courses and it also serves non-CIS-major students who are interested in computer animation and graphics."


Nowhere in the Course Objectives are objects, OOA, OOD, or OOP mentioned. In fact, it would be entirely possible to satisfy these objectives using an older non-OO version of Pascal or using C, (which is inherently non-OO) as the teaching language.

Given the stated objectives of the course, it seems to me that it is the Course Description and not the Course Syllabus that is out of step with the objectives of the course. Therefore, my recommendation would be to remove all references to object-oriented programming and object-oriented design from the Course Description. That could be done while still satisfying the Course Objectives.

You also mentioned that your course is heavily populated with non-CS majors including English majors and art majors, albeit some of them are honors students. Unfortunately, as a professor at a community college, I have had no experience with honors students. However I have taught OOP to several thousand students from all walks of life during the past ten years using Java.

While I may be wrong, in my opinion, it is unrealistic to believe that you can teach OOA/OOD/OOP to most English majors and art majors (and even many CS majors) "without prior programming experience" in a single semester even if:

1. They are honors students,
2. You dedicate the entire semester to OOA/OOD/OOP, and
3. You are using the best OO teaching tool available.

If those students were strongly inclined toward OOA/OOD/OOP, they probably wouldn't be English majors and art majors in the first place. They would probably be engineering majors or computer science majors instead.

I read an interesting quotation in a Java textbook the other day: "Not every student has a burning desire to learn computer programming." Again, I may be wrong, but I doubt that many of your non-CS students in CS 160 have such a burning desire to learn computer programming that they would be willing to suffer through the pain and to expend the effort required to understand OOA/OOD/OOP. I personally came into OO using C++ with an advanced engineering degree and more than thirty years of programming experience. Even with that experience and background, I still found it difficult to cross the OOA/OOD/OOP chasm and found OO in general to be a major intellectual challenge.

I'm not certain what the best tool for teaching OO may be, but I do know that it is not Alice. Alice is not an object-oriented programming language (see http://www.dickbaldwin.com/alice/Ali...ed_Programming).

Therefore, whoever created the Course Description, the Course Syllabus, and the Course Objectives for CS 160 and also decided that CS 160 would be taught using Alice has created an impossible convergence of requirements. In my opinion, it is not possible to use Alice and also satisfy the requirement of those three documents.

As I said before, I am beginning to understand your frustration.

Having said all of that, I do believe that Alice is an outstanding teaching vehicle for teaching a course that will satisfy the Course Objectives and the Course Syllabus for CS 160 quite well. It clearly isn't possible for you to use Alice and also satisfy the Course Description because Alice is not an object-oriented programming language. It seems to me that the best you can do is to use Alice to satisfy the Course Syllabus and the Course Objectives and to forget about OO for teaching students at this level. Just remember, "Not every student has a burning desire to learn computer programming."

This is just my opinion. I hope it will be helpful to you and to others who are teaching or are thinking about teaching a programming course using Alice. To those who are just thinking about it, remember that Alice is not an object-oriented programming language. Don't allow yourself to be drawn into a situation where you are required to teach OO concepts using Alice.

Can you teach object-based concepts using Alice? The answer is yes, but in my opinion, you cannot teach object-oriented concepts using Alice. Among many other reasons, Alice does not support polymorphism. It does use methods belonging to objects but those methods cannot be overridden and they cannot be overloaded. Hence, there is no polymorphism in Alice, not even the simple kind based on overloaded methods. According to my definition, an object-oriented programming language must, as a minimum, support all three of the following:

Encapsulation
Inheritance, including either multiple inheritance or interface inheritance
Runtime polymorphism based on overridden methods

Alice does not satisfy that definition.

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm

Last edited by DickBaldwin; 11-04-2007 at 04:01 PM. Reason: Correct spelling and other errors
   
Reply With Quote
Alice is not object oriented.
Old
hgs
Guest
 
Status:
Posts: n/a
Default Alice is not object oriented. - 11-05-2007, 06:34 AM

So what about the other half of her question?

If you could cast, as you can in a non-OO language such as C, then you could at least simulate good design. But even that isn't possible. So I find myself violating objects left and right ... But I still don't have an overall sense of how to design an Alice program that is readable, extensible, and robust."

I think there are a number of flaws in Alice. Let's agree at the outset that navigation in the 3D environment is very good, the drag and drop interface is a great help in reducing errors, the provision of an extensive gallery is good, and many of the ideas explored in Storytelling Alice are a definite improvement.

Having said that, the lack of inheritance is a problem. The way that you cannot add methods that work for all humans (for example) is a problem (it would reduce repetition in code). By saving and loading modified objects, some form of prototype inheritance is sort of possible, but not dynamically within a program.

The structure of humanoids being inconsistent is a problem, some have a torso, others a chest. Thus it is more painful to copy methods.

There are no methods that can return body parts (that I have found), so even if you have two characters with the same body parts, you can't pass the whole character in to a method, and use method calls to access the body parts in order to move them appropriately. This might be needed when one character controls the interaction with another character selected from a choice of several.

Navigation in the quad view is more difficult than in the main view, and it is possible to get lost in quad view, with no simple means of reorientation.

There is no way to extract your program as text or to import it as text. This would facilitate some degree of metaprogramming, or at least allow external programs to generate Alice programs. Admittedly this would introduce syntax errors in some cases, which would mean handling them, increasing complexity.

I gather that the import and export of objects will be improved in Alice 3.

The ability to manipulate data structures is also rather weak. Hashes or Lua-like tables would be nice, but even if we just have lists, as Lisp has had for decades, we don't seem to have much support for manipulating them.

And there seems to be no support for File based I/O, which given data structures, could allow the development of sophisticated algorithms.

It will be interesting to see what happens with Alice 3.
   
Reply With Quote
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default 11-05-2007, 07:39 AM

Quote:
Originally Posted by hgs View Post
So what about the other half of her question?

If you could cast, as you can in a non-OO language such as C, then you could at least simulate good design. But even that isn't possible. ...
It will be interesting to see what happens with Alice 3.
Actually, because it is not possible to create or destroy objects at runtime, there is a workaround for the lack of a casting operator when dealing with objects as type Object. It is ugly and it is cumbersome, but it works. See http://www.dickbaldwin.com/alice/Ali...of_type_Object

Regarding Alice 3, in an earlier posting, one of the folks at Carnegie stated that you will be able to do anything using Alice 3 that you can do using Java, but not all capabilities will be supported using drag and drop. In some cases, it will be necessary to type in the code (or words to that effect). In another posting, they described Alice 3 as a 3D-oriented IDE for Java based on Eclipse.

I am definitely looking forward to Alice 3, but I still consider Alice 2 to be extremely useful for teaching programming fundamentals to non-CS majors who are required to take a programming course, but who clearly don't have a burning desire to learn computer programming.

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm
   
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.