From: MikkelFJ Date: 2001-11-30T06:35:21+09:00 Subject: [ruby-talk:26968] Re: Article on Program design "Henning von Rosen" wrote in message news:007401c178d9$15abc6e0$2f509fc3@telia.com... > Why does for example Ruby appeal to people in the way it does? > > Well-known Lisp'er Paul Graham has an interesting article on language > design: > > http://www.paulgraham.com/langdes.html > > I also think it relates to the matz' idea of "Human Oriented Programming". I think many minimalistic pragmatic ideas of Graham are in common with Ruby. But Graham also states the Object Orient programming isn't such a big deal. Well - I like Ruby mostly due to former design principles and less because it is object oriented. I'm not advocating against OOP, I'be been using it a lot, but as Graham points out it's popularity may mainly be due to solving problems that might as well have been solved by other means. This is also why I recently have started looking at functional programming languages. I've also mentioned that I'd like functions to be first class values in Ruby - like objects are. That can often save you from creating a class instance and is a natural extension to the block concept. Adding this and Ruby wouldn't just be cool, but very cool. I'd also like to mention the PragDaves wiki article on Java is not strongly typed. I have myself made the same argument and this is also a primary reason for my interest for dynamically typed languages like Ruby. Why bother with types if you have to cast all the time? At the same time a strongly statically typed language like OCaml gives does not require you to cast all the type and gives you similar benefits to strongly typed languages, but by different means. I've many times heard that language X is not proper OOP because everything isn't an object (as it is in Ruby). I'd like to make a point here: It may be nice to be able to write 1000.times { puts "helloW }, but it has nothing to do with OOP, or at least no OOA/OOD (analysis and desing). Object oriented methodology is about identifying the "appropriate" objects in a system and model the in software. One of the primary tasks are to eliminate obvious but unfortunate choices for objects in a system. Hence the everything is an object my be a nice choice for consistency, but it is not in itself a primary factor for a sound language design. Paul Graham argues that OOP need not be integrated too deply in a language although it may be nice to have. I'm not sure that I agree - mostly because add-on objects rarely blend well into a language, not becuase the non-OO part of the language is necessarily bad. OCaml and Lisp (CLOS) have added OOP to their core. But there are inconsistencies with either parts of the language, and or our normal conception of OOP which Ruby expresses very clearly. I someone could put out a proposal for making functions first class values (or first class objects and hence first class values), I'd be interested. One major problem is attaching or detaching a method from the class context in which it is defined. I'm not sufficiently knowledgable about those parts of Ruby to make any good suggestions myself at this stage. MikkelFJ