Re: Declarative constraints in practical terms
Date: 1 Mar 2006 19:17:34 -0800
Message-ID: <1141269454.508804.227590_at_z34g2000cwc.googlegroups.com>
dawn wrote:
> From a practical standpoint, what does this give us? Is there any
> evidence that there are fewer bugs in software written using
> declarative languages?
We have plenty of experience to support the argument! But I've asked this question before: what would you consider as evidence?
You might find this amusing and enlightening: http://citeseer.ist.psu.edu/hudak94haskell.html
> I've read a lot of the "what not how" treatments (although it has been
> a while) but I don't fully grasp the implications in practical terms.
> I gather that the downside of programming languages such as Java
> compared to declarative languages would be related to the quality of
> the software written in the language and/or the speed with which one
> can write quality code.
Yes.
> But if there is a significant difference in
> quality and cost and if declarative languages can be general purpose
> languages, then why are so many people still coding with "imperative"
> languages? I think there must be good reasons. What are the problems
> of using declarative languages?
In no particular order:
- people are usually taught the imperative style first and generally
prefer
to stick with what they know;
- declarative programming requires a genuine change of perspective,
which most people, it seems, are not prepared to make;
- poor marketing on the part of declarative language designers; - a mistaken perception that declarative languages are slow; - a lack of friendly, but practical, introductory texts on declarativeprogramming;
- "Java/OO/XML *must* be good because that's what everyone's using!"
Everybody in my office (and pretty much all the declarative programmers
I've ever met) started off thinking imperative languages were *the*
tools of
choice. It was only after trying out declarative languages for some
time
that it became obvious how much shorter our programs were, how fewer
bugs they contained, and how much more productive we were. Then we
were amazed at how reluctant everybody else was to believe us when we
told them... C'est la vie.
- Ralph