Re: Declarative constraints in practical terms
Date: 3 Mar 2006 07:24:00 -0800
Message-ID: <1141399439.924892.215870_at_u72g2000cwu.googlegroups.com>
ralphbecket_at_gmail.com wrote:
> 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?
That is a problem with whether to use the RM or some other approach as well as choice of languages. I would want to see the actual cost of writing and maintaining software be lower for an organization employing one tool or technique compared to another. In the absense of that, I'll read anecdotes and logical arguments and form my own opinion, which I will then doubt. I can't invest the time to test out every tool or technique to the point of proficiency in order to judge it that way. That is why market share comes up so often (e.g. with SQL or Windows) to help form such opinions. It is one of the measurements we can put in a pie chart.
So, I'm afraid my answer is "I don't know" but if you have anything, please put it on the table.
> You might find this amusing and enlightening:
> http://citeseer.ist.psu.edu/hudak94haskell.html
Yes, I do, although, unfortunately I don't know most of the languages in the study and am fluent in none of them.
> > 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.
And the reason data processing 101 folks still lean toward using imperative languages is simply due to ignorance?
> > 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;
OK.
> - declarative programming requires a genuine change of perspective,
> which most people, it seems, are not prepared to make;
Yes, I think this is a big one. I would be interested in some study of how brains work relative to these choices in languages. It was not an easy leap from procedural to OO code, but I could see some benefits to it, so I made the jump. So I'm willing to make such jumps, but I don't "feel" any benefit to taking the time to learn a general purpose declarative langauge. Maybe when my ISP has it as an option integrated with the web server, like PHP (a dog-ugly language from my perspective), then I would consider it.
> - 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 declarative
> programming;
> - "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.
Is the learning curve higher if we were to start there? The jump from teaching procedural code to teach OO is significantly harder for the newbie. There is much less ramp-up to teaching someone to use JavaScript (which is functional, procedural, and OO poured together, perhaps?) than Java. Starting to learn to code with a declarative language is likely possible by teaching SQL constraints. Are there "learn to program here" language books for any general purpose programming languages?
> Then we
> were amazed at how reluctant everybody else was to believe us when we
> told them... C'est la vie.
I'm inclined to believe you, but something about it isn't compelling enough (yet) for me to jump in. Perhaps I would need to understand the entire solution for a browser-UI software app. Google has the money to investigate other languages, but I think they are using Java & Python in the middle tier. Others are using PHP extensively. What web site can I go to where the web server tier uses a general purpose declarative language? Are there examples of that code? Sorry for all of the questions. Thanks. --dawn Received on Fri Mar 03 2006 - 16:24:00 CET