So I scraped the rust off my computer science education and thought a bit about the differences between functional and OO languages.
One of the nice things about languages like Lisp/Prolog/Ocaml(?) is that you can pass functions around by reference and composite them into other functions. This allows for some problems to be very elegantly solved, in particular what in OO is called the Strategiy pattern. Also, from what I recall from academia its very useful for the type of substitutions used in language parsing based on a BNF definition (my knowledge is not very deep here). In contrast, strict OO languages like Java do not offer this possibility. You can't pass a function directly, so instead you have to pass an object that conforms to an Interface. You are forced to using a pattern. Interestingly, AS2 seems to meet in the middle. While not quite as syntactically elegant as Lisp or Prolog, you can pass functions around by reference. This would allow for an implementation of Strategy that is probably a lot more succint in Java (simply pass the function), although this function would assumedly be loosely typed. From what I understand - we are going to lose this flexibility in AS3. --- On the other side of the coin, I think the best aspect of an OO language like Java is that the need to verbosely type everything allow for amazing development tools like the Eclipse JDE to be created. I would venture to say its much easier to provide code-hinting and refactoring capabilities for a Jave IDE than for a Lisp/Ocaml IDE. (I could be very wrong!) Dheers, -Daniel Martin Wood wrote: >I think one of the main forces behind design patterns is communication, >they allow us to talk about software design using a common language >which represents often found architectural features (errm, patterns :) > >every programming language will have patterns, be it functional, OO, >procedural, whatever. > >maybe some patterns (and anti-patterns) describe ways in which we deal >with flaws (or features, depends on your point of view), but i think its > slightly disingenuous to say that patterns are bandages for bad >languages. (bad nicolas, bad.. :) > >i think they have been discussed a lot more in OO languages because most >large scale software development has been conducted within that realm >for the past so many years. > >Im sure we will start to see patterns relating to AOP in the near future >as that becomes a more common part of development. > >anyway, back to the books, at the moment im also enjoying > >Refactoring: Improving the Design of Existing Code >By Martin Fowler, Kent Beck, John Brant, William Opdyke, Don Roberts > >and joining the two topics together : > >Refactoring to Patterns >By Joshua Kerievsky > >martin > >_______________________________________________ >osflash mailing list >[email protected] >http://osflash.org/mailman/listinfo/osflash_osflash.org > > _______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org
