More OOP bashing (& which metaphor is best?)
From the last, for example: "It is my opinion that the division between data and behavior in procedural/relational (p/r) applications also has software design benefits. It allows a certain "contract" between the database and the database user (application programmer). Contracts usually have certain obligations and costs, but these costs are worthwhile for the parties of the contract or else the contract would not be entered into. The relational paradigm involves just such a contract. If you follow your end of the bargain, then the other party,
I just came across these links (bearing indirectly on the value of Python emphasizing both procedural and Object-Oriented Programming support as a language good for beginners and experts): See: "Object Oriented Programming Oversold!" http://oop.ismad.com/ Or: "Guide To Myths" http://www.geocities.com/tablizer/myths.htm And: "Why I Prefer Procedural/Relational Over OOP" http://www.geocities.com/tablizer/whypr.htm the relational paradigm, will provide wonderful benefits. The "limitations" required are not arbitrary, for they provide a powerful intellectual rigor which is one of the greatest tools of modern software technology in my opinion. Along with GUI's, relational technology is one of the rare "wow!" technologies that is a fundamental leap forward in software design. ... The contract of the relational paradigm basically says, "If you put or keep your information (data) in a certain given structure, then there are powerful and concise operations that you can do on this information." E. Codd, the inventor of relational algebra, opened the world's eyes to a powerful kind of "math" (with some help from more practical-minded collegues). This math can reduce complex structures and patterns into relatively simple formulas, or "relational math"." Of course, one might argue relational databases are just well defined objects... :-) But then the object paradigm starts to break dawn -- and one is really thinking more in terms of "modules" then how "objects" are usually discussed. As I previously wrote here (and on the Squeak list a long while back): http://mail.python.org/pipermail/edu-sig/2006-December/007483.html "Personally, one way my opinions differer from Alan Kay's in a deep way is on his, I think mistaken, notion that an object (or a class) can have any meaning apart from the ecology of objects (or really classes) it is embedded in. I think there is a deep philosophical (and practical) point there which he is perhaps only slowly beginning to see. :-) But it is reflected in the superiority of, say, Python's modularity in practice compared to early Smalltalks, that is, if you think classes stand alone, then there is no need for a higher level of "module", whereas if you think classes need to be clustered to support each other, than modules make a lot of sense." Still, I think the more general issue, present even in AK's new proposal, is how one can simulate the world by objects but one also can simulate the world (perhaps more accurately, if with more effort) as a set of fields defined by relations (or by any other method). Whether such fields are best implemented procedurally or via OOP is another question. Anyway, when one delves this, it gets murkier and murkier -- in part because people often confuse having a modeling layer of discrete objects somewhere as meaning the models are all about Objects and OOP, but there is no reason one cannot use objects to model other things (fields) -- or even vice versa. Still, from a beginner point of view, why should you have to get the metaphor of "objects" if what you are interested in are "fields" (e.g an astrophysics simulation of particles in an electrostatic gradient and/or gravity well)? I think the appeal of APL based on arrays is in part the appeal of fields. One thing that makes this all confusing to understand is the human mind has a layer (or module) that models the complex real world in terms of a simplified representation of "objects" (as I wrote in my undergraduate thesis in 1985: "Why Intelligence: Objects Stability Evolution and Model"). William Kent explored this in his book _Data and Reality_: http://www.bkent.net/ For example, by numbers, people are about 90% bacteria, but we generally don't see other people as walking bacterial colonies. :-) "People Are Human-Bacteria Hybrid" http://www.wired.com/medtech/health/news/2004/10/65252 Yet if you want to understand some branches of holistic medicine (and why using antibiotics might have lifelong health impacts) then you need to think about people this way, as hard as it is. http://www.findarticles.com/p/articles/mi_m0NAH/is_2_32/ai_83316363 And then, if you want to understand bacteria, you have to see them more as a vast worldwide supercomputer than isolated individuals: "New Science Of Metagenomics to Transform Modern Microbiology?" http://science.slashdot.org/article.pl?sid=07/04/02/2017249 So, as Plato's "Allegory of the Cave" suggest it is sometimes hard to see past these shadows (objects) to realize that reality is something fundamentally different (deeper, more complex, more interrelated) than the simple parsing into objects we do routinely. [Plato's analogy breaks down here though in that he still thought of *ideal* forms of objects, whereas I'm more arguing against even ideal forms, except perhaps in a statistical sense sometimes.) Seeing the world in terms of objects may have enormous survival value to life forms with big brains, but that does not mean it is completely accurate (even as objects being a useful idea does mean there is likely some statistical truth there (e.g. statistical clustering), in terms of a field of relationships). Still, and I don't have it anymore, but about fifteen years ago I made a list of about 20 reasons why (VisualWorks) Smalltalk was better than a typical C++ (of the time) from a developer and maintainer point of view -- intentionally not bringing in OOP specifically as a reason (although, in retrospect, many of the benefits were enabled by OOP). Stuff like the integrated debugger, the browser, the inspector, refactoring support, garbage collection, the GUI library, edit/continue, and so on. Of course, C++ now apes many of those features, but without the integration or elegance. Still, having explored relational programming (via Pointrel) I can say both approaches (OOP and Relational) have their merits. The right tool for the right job. Or in this case, a flexibility with metaphor, so "teh right metaphor for the right job". Or, looking at it even more abstractly, "the right mathematical abstraction for the right job". And from that point of view, should not a goal of computer education (and CP4E) be to have people able to handle multiple metaphors as appropriate for the situation? Programming a digital thermostat might require thinking in terms of one kind of metaphor, whereas programming the GUI on your car smith require a different kind of metaphor? Perhaps the conflicts about "which programming language is best" really are just obscuring the issue of "which metaphor is best" and the answer to that, like when looking at a large library of fiction, is that lots of metaphors are useful in the right situations, and only being able to understand one kind of metaphor would mean you would not get very much out of most fiction. So a programmer only capable of working within one metaphor is not a very capable programmer. Still, if that metaphor is very powerful, like with OOP, a single-metaphor programmer could still get pretty far and do lots of useful things. And likely further than simple relational programs. Anyway, food for thought. --Paul Fernhout
Paul D. Fernhout wrote:
I just came across these links (bearing indirectly on the value of Python emphasizing both procedural and Object-Oriented Programming support as a language good for beginners and experts):
See: "Object Oriented Programming Oversold!" http://oop.ismad.com/ Or: "Guide To Myths" http://www.geocities.com/tablizer/myths.htm
From the last, for example: "It is my opinion that the division between data and behavior in procedural/relational (p/r) applications also has software design benefits. It allows a certain "contract" between the database and the database user (application programmer). Contracts usually have certain obligations and costs, but these costs are worthwhile for the parties of the contract or else the contract would not be entered into. The relational paradigm involves just such a contract. If you follow your end of the bargain, then the other party,
And: "Why I Prefer Procedural/Relational Over OOP" http://www.geocities.com/tablizer/whypr.htm the relational paradigm, will provide wonderful benefits. The "limitations" required are not arbitrary, for they provide a powerful intellectual rigor which is one of the greatest tools of modern software technology in my opinion. Along with GUI's, relational technology is one of the rare "wow!" technologies that is a fundamental leap forward in software design. ... The contract of the relational paradigm basically says, "If you put or keep your information (data) in a certain given structure, then there are powerful and concise operations that you can do on this information." E. Codd, the inventor of relational algebra, opened the world's eyes to a powerful kind of "math" (with some help from more practical-minded collegues). This math can reduce complex structures and patterns into relatively simple formulas, or "relational math"."
Of course, one might argue relational databases are just well defined objects... :-) But then the object paradigm starts to break dawn -- and one is really thinking more in terms of "modules" then how "objects" are usually discussed. As I previously wrote here (and on the Squeak list a long while back): http://mail.python.org/pipermail/edu-sig/2006-December/007483.html "Personally, one way my opinions differer from Alan Kay's in a deep way is on his, I think mistaken, notion that an object (or a class) can have any meaning apart from the ecology of objects (or really classes) it is embedded in. I think there is a deep philosophical (and practical) point there which he is perhaps only slowly beginning to see. :-) But it is reflected in the superiority of, say, Python's modularity in practice compared to early Smalltalks, that is, if you think classes stand alone, then there is no need for a higher level of "module", whereas if you think classes need to be clustered to support each other, than modules make a lot of sense."
Still, I think the more general issue, present even in AK's new proposal, is how one can simulate the world by objects but one also can simulate the world (perhaps more accurately, if with more effort) as a set of fields defined by relations (or by any other method). Whether such fields are best implemented procedurally or via OOP is another question. Anyway, when one delves this, it gets murkier and murkier -- in part because people often confuse having a modeling layer of discrete objects somewhere as meaning the models are all about Objects and OOP, but there is no reason one cannot use objects to model other things (fields) -- or even vice versa. Still, from a beginner point of view, why should you have to get the metaphor of "objects" if what you are interested in are "fields" (e.g an astrophysics simulation of particles in an electrostatic gradient and/or gravity well)? I think the appeal of APL based on arrays is in part the appeal of fields.
One thing that makes this all confusing to understand is the human mind has a layer (or module) that models the complex real world in terms of a simplified representation of "objects" (as I wrote in my undergraduate thesis in 1985: "Why Intelligence: Objects Stability Evolution and Model"). William Kent explored this in his book _Data and Reality_: http://www.bkent.net/ For example, by numbers, people are about 90% bacteria, but we generally don't see other people as walking bacterial colonies. :-) "People Are Human-Bacteria Hybrid" http://www.wired.com/medtech/health/news/2004/10/65252 Yet if you want to understand some branches of holistic medicine (and why using antibiotics might have lifelong health impacts) then you need to think about people this way, as hard as it is. http://www.findarticles.com/p/articles/mi_m0NAH/is_2_32/ai_83316363 And then, if you want to understand bacteria, you have to see them more as a vast worldwide supercomputer than isolated individuals: "New Science Of Metagenomics to Transform Modern Microbiology?" http://science.slashdot.org/article.pl?sid=07/04/02/2017249 So, as Plato's "Allegory of the Cave" suggest it is sometimes hard to see past these shadows (objects) to realize that reality is something fundamentally different (deeper, more complex, more interrelated) than the simple parsing into objects we do routinely. [Plato's analogy breaks down here though in that he still thought of *ideal* forms of objects, whereas I'm more arguing against even ideal forms, except perhaps in a statistical sense sometimes.) Seeing the world in terms of objects may have enormous survival value to life forms with big brains, but that does not mean it is completely accurate (even as objects being a useful idea does mean there is likely some statistical truth there (e.g. statistical clustering), in terms of a field of relationships).
Still, and I don't have it anymore, but about fifteen years ago I made a list of about 20 reasons why (VisualWorks) Smalltalk was better than a typical C++ (of the time) from a developer and maintainer point of view -- intentionally not bringing in OOP specifically as a reason (although, in retrospect, many of the benefits were enabled by OOP). Stuff like the integrated debugger, the browser, the inspector, refactoring support, garbage collection, the GUI library, edit/continue, and so on. Of course, C++ now apes many of those features, but without the integration or elegance.
Still, having explored relational programming (via Pointrel) I can say both approaches (OOP and Relational) have their merits. The right tool for the right job. Or in this case, a flexibility with metaphor, so "teh right metaphor for the right job". Or, looking at it even more abstractly, "the right mathematical abstraction for the right job". And from that point of view, should not a goal of computer education (and CP4E) be to have people able to handle multiple metaphors as appropriate for the situation? Programming a digital thermostat might require thinking in terms of one kind of metaphor, whereas programming the GUI on your car smith require a different kind of metaphor? Perhaps the conflicts about "which programming language is best" really are just obscuring the issue of "which metaphor is best" and the answer to that, like when looking at a large library of fiction, is that lots of metaphors are useful in the right situations, and only being able to understand one kind of metaphor would mean you would not get very much out of most fiction. So a programmer only capable of working within one metaphor is not a very capable programmer. Still, if that metaphor is very powerful, like with OOP, a single-metaphor programmer could still get pretty far and do lots of useful things. And likely further than simple relational programs.
Anyway, food for thought.
--Paul Fernhout _______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
Not sure you can trust anyone using the phrase "appeal of APL".
Peter Chase wrote:
Not sure you can trust anyone using the phrase "appeal of APL".
Personally, I haven't used APL for over twenty years (since when you needed it to run a graphics package called FOIL to produce multicolor plotter output). I'm not a big fan of backspacing over funny characters to make more even complex operators (as neat an idea as I'm sure that sounded at the time). :-( Still, consider: http://www.sigapl.org/letter-2006-07.html "The executive committee is making an effort for SIGAPL to strengthen its position as an organization that sponsors the use of many array programming languages, including APL, J, K, matlab, Gauss, and APLus. In addition, we want to re-activate the relationships with local APL user groups and initiate relationships with users of other APL dialects." Obviously, matlab is very mainstream in several domains (especially related to signal processing). But even in the Python context, NumPy or variants are bringing the power of arrays to Python. See: "NumPy for Matlab Users" http://www.scipy.org/NumPy_for_Matlab_Users "MATLABĀ® and NumPy/SciPy have a lot in common. But there are many differences. NumPy and SciPy were created to do numerical and scientific computing in the most natural way with Python, not to be MATLABĀ® clones." FScript tried to bring powerful array concepts to Smalltalk. http://oopsla.acm.org/oopsla2003/files/dem-9.html "The OOPAL model, a new high level programming model which unify OOP and APL-like Array programming." So, let me rephrase that as, "the appeal of APL, J, K, matlab, Gauss, APLus, FScript and NumPy." :-) Sound slightly more trustworthy? :-) Anyway, my point is that array processing offers yet another paradigm alternative to OOP, and for the right task (e.g. simulating fields of force), it can be a very attractive approach. Of course Python, being very flexible and modular and expandable, gives you a lot of those possibilities without all the line noise. :-) And one might argue, that if you were teaching programming to, say, Astrophysics-interested people, you might be better off focusing on NumPy and doing array calculations using procedural code than talking about all the typical OOP examples of hierarchies of shapes and such. All the best. --Paul Fernhout
Not sure I'd counterpose "array-based versus OOP" as it's quite possible to represent and manipulate a multidimensional array *as an object* (like a list, but deeper). That being said, true enough that J presents a strongly functional right to left pipeline, very different from Python. More like REBOL perhaps? (Jason Cunliffe has been our resident REBOL booster). So here's where I insert my "tour the languages" approach: rather than focus on NumPy, just focus on J for awhile. Learn what that's like. Maybe your Python'll be better as a result. Instead of charming our snake into doing stupid pet trix, use it to show off the power of OO, and *other languages* to show of the power of other-than-OO. Touring may be fairly painless, some high rez screencasts and such. No one says you have to become a master. My CS0 at Princeton featured APL, FORTRAN, PL/1, SNOBOL and some simulated Assembler as I recall, among other languages. Why not some xBase while we're at it, with embedded SQL? http://worldgame.blogspot.com/2006/08/toontown-revisited.html http://worldgame.blogspot.com/2006/07/taking-refuge-in-j.html Kirby
On 4/4/07, Paul D. Fernhout <pdfernhout@kurtz-fernhout.com> wrote:
I just came across these links (bearing indirectly on the value of Python emphasizing both procedural and Object-Oriented Programming support as a language good for beginners and experts):
See: "Object Oriented Programming Oversold!" http://oop.ismad.com/ Or: "Guide To Myths" http://www.geocities.com/tablizer/myths.htm
And: "Why I Prefer Procedural/Relational Over OOP" http://www.geocities.com/tablizer/whypr.htm
Yeah, studied that guy's website some years ago, including some correspondance as I recall. An old custom database programmer like me, xBase family, rebelling against the OO trend which subsequently took over xBase as well starting 1990s or so (witness Microsoft VFP). What a lot of this analysis neglects is the rich *interactive* semantics we're able to define using dot notation, i.e. by making our objects "top level" we have a lot of functionality organized by "thing" (as in "I am a vector"). IDLE 1.2
from stickworks import Vector v1 = Vector((1,0,0)) v2 = Vector((0,1,0)) v1.cross(v2) Vector @ (0.0,0.0,1.0) v2.dot(v2) 1.0
is simply an intuitive way to keep vector ops "grouped" within the entities which have a "need to know" (encapsulation). A rich command line experience is what Python provides. You'd think B. Jacobs would appreciate that, given the xBase "dot prompt" heritage. http://www.4dsolutions.net/ocn/oopalgebra.html http://www.4dsolutions.net/ocn/trends2000.html Kirby
participants (3)
-
kirby urner -
Paul D. Fernhout -
Peter Chase