Subj : Re: curve for verbosity in a language To : comp.programming From : Jon Harrop Date : Wed Aug 03 2005 01:54 am Arthur J. O'Dwyer wrote: > I think this is one question to which Jon Harrop's knee-jerk reaction > ;) :-) > is indisputably correct (by me, anyway!) --- FP languages tend to have > really good /terse/ support for lists, hashes, function calls, and so on. > Anonymous lambda functions mean you don't have to pass around bunches of > function parameters. The function-definition syntax is very terse. You > generally don't need to worry about explicit namespacing to the extent you > do in strictly OO languages like Java and C#. Polymorphism, or > typelessness, or whatever you want to call it, means fewer lines of code > dealing with templates and generics. Type inference means fewer lines of > code dealing with even the "simple" types. Yes, I think FP is the way to > go. And of the (few) FP languages I've used, OCaml is the tersest. (I've > heard good things about Haskell in that respect, too.) Yes, AFAIK Haskell is more powerful than OCaml in many ways but typically much slower to execute. From what I've heard, the main practical problem with Haskell is unpredictable memory use. I believe that functional programming adds an extra "dimension" to factoring code, allowing the programmer to extract out significantly more common functionality than is possible without function values. Type inference is probably second most important and polymorphism (parametric first, then OO) third and fourth. It is also interesting to note that, although OCaml supports OO, OCaml programs typically make much more use of ML's features (e.g. variants) than of OO. Indeed, I have only ever used objects as a drop-in replacement for records of functions. -- Dr Jon D Harrop, Flying Frog Consultancy http://www.ffconsultancy.com .