[WebDNA] Was: wiki Now: Object-oriented programmng
This WebDNA talk-list message is from 2009
It keeps the original formatting.
numero = 103967
interpreted = N
texte = Patrick McCormick wrote: > An object-oriented language has a syntax consisting of objects, rather > than predominately procedural steps. Just because you can use those > procedural steps to make a piece of code that behaves like an object > doesn't cut it. > > Frankly, I'm not very heartbroken that WebDNA isn't OOP. I don't think > it would add much benefit. > > I think that WebDNA is perfect for web servers because the process of > creating and sending pages is pretty darn procedural. Although OOP stuff > like Flash and JavaScript can exist in a page and do things after the > page gets there, page assembly and delivery - especially when data is > being retrieved in rows and columns, seems more intuitive in a > procedural environment.Christer wrote: > The very foundation for OOP is the use of objects (instances of > classes which can have properties and methods, all encapsulated within > the class) and inheritance (subclasses of objects that can share all > or just some of their super's properties and methods). > Best, > ChristerChrister wrote: > WebDNA is a great language but it's not object-oriented in any way. > Best, > ChristerO.K., up at 5:30 AM so I can respond. :-)First, Ultimately I agree that, especially programmers of otherlanguages, WebDNA will not be viewed as an OOP language by thelarger public. I willdelete that aspect from the wiki for that reason. I think Christerdefines OOP in a way that most others will view it. However, Idon't agree with Christers last comment that it is no way OOP.Here is some insight why I think this...As noted by Patrick, most WebDNA'ers create procedural code or evenNon-structured code.http://en.wikipedia.org/wiki/Unstructured_programmingHowever, this does not have to be the case.Non-structured programming, structured(procedural) programming,and OOP, are, for the most part, *styles* of programming and I argue that WebDNA has evolved to a point where it is (nearly) possibleto code WebDNA in an OOP style.Referencing the wikipedia page "Object-oriented programing" (Mainfeatures), I've included a snippet that includes the usualcharacteristics of OOP. I'll make my arguments within! ;-)----Main featuresThe attempt to distill OOP to a minimal set of features is consideredfutile by programming language researcher Benjamin Cuire Pierce.Nevertheless, he identifies the following as fundamental features thatare found in most object-oriented languages and that, in concert,support the OOP programming style:[4] * Dynamic dispatch -- when a method is invoked on an object, theobject itself determines what code gets executed by looking up themethod at run time in a table associated with the object. This featuredistinguishes an object from an abstract data type (or module), whichhas a fixed (static) implementation of the operations for all instances.It is a programming methodology that gives modular component developmentwhile at the same time being very efficient.[The WebDNA Argument:Though webdna does not have objects/classes in the traditions sense, I argue that the premise of an object can be hacked with WebDNA...An example of dynamic dispatch in WebDNA may be an include file that contains functions (methods), for example.. one of which decides what other functions (methods) to call.http://en.wikipedia.org/wiki/Dynamic_dispatch"In a small number of languages such as Common Lisp, methods orfunctions can also be dynamically dispatched based on the type ofarguments. Expressed in pseudocode, the code manager.handle(y) couldcall different implementations depending on the type of object y. Thisis known as multiple dispatch."] * Encapsulation (or multi-methods, in which case the state is keptseparate)[WebDNA Argument:This has to with limiting things, such as limiting the hackability of anapp or object, by keeping non needed code "hidden". I attest thesetypes of things can be accomplished with WebDNA using the scopingof variables that is also implied with WebDNA's [function] context.http://en.wikipedia.org/wiki/Encapsulation_(object-oriented_programming)] * Subtype polymorphism[WebDNA Argument: Since WebDNA doesn't deal with classes and superclasses, it would be an interesting challenge to convince someonefrom a C++ background that WebDNA has this capability :-).. butwhy not try..http://en.wikipedia.org/wiki/Subtype_polymorphism"n programming language theory, subtyping or subtype polymorphism is a form of type polymorphism in which a subtype is a datatype that is related to another datatype (the supertype) by some notion of substitutability"Though the inheritance idea would not work in the same way as some otherlanguages, I suppose a hack could be made in webdna to create a "S <: T"relationship. * object inheritance (or delegation)[WebDNA Argument: Since inheritance is usually defined more by the use of objects and classes in the traditional sense, maybe the *delegation* definition works better for WebDNA:http://en.wikipedia.org/wiki/Delegation_(programming)"Delegation is the simple yet powerful concept of handing a task over to another part of the program. In object-oriented programming it is used to describe the situation wherein one object defers a task to another object, known as the delegate."] * Open recursion -- a special variable (syntactically it may be akeyword), usually called this or self, that allows a method body toinvoke another method body of the same object. This variable islate-bound; it allows a method defined in one class to invoke anothermethod that is defined later, in some subclass thereof.[WebDNA Argument: WebDNA doesn't have a keyword for this and functionswork a bit differently in WebDNA than in most OOP languages, butthe basic principle is doable in WebDNA.]----Anyway, after looking into this, I wouldn't dare waste my time tryingto defend WebDNA as an OOP language.. life is too short. ;-), so I willtake that out of the Wiki.. but one point about all this is that Ithink the latest changes (derived from SMSI) help in making this language compete with the best of them in some of the latest codingtechniques. As Patrick alluded... Who needs objects and classes onthe web when you have [include] and [function] anyway. ;-)Happy friday!Donovan-- Donovan BrookeWebDNA Software Corporationhttp://www.webdna.us**[Square Bracket Utopia]**
Associated Messages, from the most recent to the oldest:
Patrick McCormick wrote: > An object-oriented language has a syntax consisting of objects, rather > than predominately procedural steps. Just because you can use those > procedural steps to make a piece of code that behaves like an object > doesn't cut it. > > Frankly, I'm not very heartbroken that WebDNA isn't OOP. I don't think > it would add much benefit. > > I think that WebDNA is perfect for web servers because the process of > creating and sending pages is pretty darn procedural. Although OOP stuff > like Flash and JavaScript can exist in a page and do things after the > page gets there, page assembly and delivery - especially when data is > being retrieved in rows and columns, seems more intuitive in a > procedural environment.Christer wrote: > The very foundation for OOP is the use of objects (instances of > classes which can have properties and methods, all encapsulated within > the class) and inheritance (subclasses of objects that can share all > or just some of their super's properties and methods). > Best, > ChristerChrister wrote: > WebDNA is a great language but it's not object-oriented in any way. > Best, > ChristerO.K., up at 5:30 AM so I can respond. :-)First, Ultimately I agree that, especially programmers of otherlanguages, WebDNA will not be viewed as an OOP language by thelarger public. I willdelete that aspect from the wiki for that reason. I think Christerdefines OOP in a way that most others will view it. However, Idon't agree with Christers last comment that it is no way OOP.Here is some insight why I think this...As noted by Patrick, most WebDNA'ers create procedural code or evenNon-structured code.http://en.wikipedia.org/wiki/Unstructured_programmingHowever, this does not have to be the case.Non-structured programming, structured(procedural) programming,and OOP, are, for the most part, *styles* of programming and I argue that WebDNA has evolved to a point where it is (nearly) possibleto code WebDNA in an OOP style.Referencing the wikipedia page "Object-oriented programing" (Mainfeatures), I've included a snippet that includes the usualcharacteristics of OOP. I'll make my arguments within! ;-)----Main featuresThe attempt to distill OOP to a minimal set of features is consideredfutile by programming language researcher Benjamin Cuire Pierce.Nevertheless, he identifies the following as fundamental features thatare found in most object-oriented languages and that, in concert,support the OOP programming style:[4] * Dynamic dispatch -- when a method is invoked on an object, theobject itself determines what code gets executed by looking up themethod at run time in a table associated with the object. This featuredistinguishes an object from an abstract data type (or module), whichhas a fixed (static) implementation of the operations for all instances.It is a programming methodology that gives modular component developmentwhile at the same time being very efficient.[The WebDNA Argument:Though webdna does not have objects/classes in the traditions sense, I argue that the premise of an object can be hacked with WebDNA...An example of dynamic dispatch in WebDNA may be an include file that contains functions (methods), for example.. one of which decides what other functions (methods) to call.http://en.wikipedia.org/wiki/Dynamic_dispatch"In a small number of languages such as Common Lisp, methods orfunctions can also be dynamically dispatched based on the type ofarguments. Expressed in pseudocode, the code manager.handle(y) couldcall different implementations depending on the type of object y. Thisis known as multiple dispatch."] * Encapsulation (or multi-methods, in which case the state is keptseparate)[WebDNA Argument:This has to with limiting things, such as limiting the hackability of anapp or object, by keeping non needed code "hidden". I attest thesetypes of things can be accomplished with WebDNA using the scopingof variables that is also implied with WebDNA's
[function] context.http://en.wikipedia.org/wiki/Encapsulation_(object-oriented_programming)] * Subtype polymorphism[WebDNA Argument: Since WebDNA doesn't deal with classes and superclasses, it would be an interesting challenge to convince someonefrom a C++ background that WebDNA has this capability :-).. butwhy not try..http://en.wikipedia.org/wiki/Subtype_polymorphism"n programming language theory, subtyping or subtype polymorphism is a form of type polymorphism in which a subtype is a datatype that is related to another datatype (the supertype) by some notion of substitutability"Though the inheritance idea would not work in the same way as some otherlanguages, I suppose a hack could be made in webdna to create a "S <: T"relationship. * object inheritance (or delegation)[WebDNA Argument: Since inheritance is usually defined more by the use of objects and classes in the traditional sense, maybe the *delegation* definition works better for WebDNA:http://en.wikipedia.org/wiki/Delegation_(programming)"Delegation is the simple yet powerful concept of handing a task over to another part of the program. In object-oriented programming it is used to describe the situation wherein one object defers a task to another object, known as the delegate."] * Open recursion -- a special variable (syntactically it may be akeyword), usually called this or self, that allows a method body toinvoke another method body of the same object. This variable islate-bound; it allows a method defined in one class to invoke anothermethod that is defined later, in some subclass thereof.[WebDNA Argument: WebDNA doesn't have a keyword for this and functionswork a bit differently in WebDNA than in most OOP languages, butthe basic principle is doable in WebDNA.]----Anyway, after looking into this, I wouldn't dare waste my time tryingto defend WebDNA as an OOP language.. life is too short. ;-), so I willtake that out of the Wiki.. but one point about all this is that Ithink the latest changes (derived from SMSI) help in making this language compete with the best of them in some of the latest codingtechniques. As Patrick alluded... Who needs objects and classes onthe web when you have
[include] and
[function] anyway. ;-)Happy friday!Donovan-- Donovan BrookeWebDNA Software Corporationhttp://www.webdna.us**[Square Bracket Utopia]**
Donovan Brooke
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Exclamation point (1997)
Country & Ship-to address & other fields ? (1997)
For those of you not on the WebCatalog Beta... (1997)
Re:no template caching (1997)
Search in 2 or more catalogs (1997)
Where's Cart Created ? (1997)
Error:Too many nested [xxx] contexts (1997)
http upload (2001)
can WC render sites out? (1997)
WebCat2: multiple currency support (1997)
international time (1997)
A question on sub-categories (1997)
The [shownext] limitations (2002)
Weather (2003)
2.0 Info (1997)
Problems with [Search] param - Mac Plugin b15 (1997)
WebCat 3.04-3.07 plug-in dying on server.... (2000)
WebCat/CyberStudio Compatibility (1998)
Bug or syntax error on my part? (1997)
Performance Settings (2000)