Re: Software bugs aren't inevitable

2005-09-19 Thread Michael Sparks
the right thing*. snip As a result I'd say that the subject Software bugs aren't inevitable is not true. I think you can argue (I would) that any behaviour that is in the specification this isn't right is not a software bug, but a specification error. To a user there is no difference

Twist and perversion. Was: Software bugs aren't inevitable

2005-09-19 Thread Jerzy Karczmarczuk
Terry Hancock wrote: /a few statements which seem to be there - apparently - just for the sake of quarreling/ The FP camp (apparently) wants to advance the claim that FP will *always* reduce bugs. I find that very hard to believe. Good. Now go, and talk to some FP people before accusing them

Re: Software bugs aren't inevitable

2005-09-17 Thread Sybren Stuvel
phil hunt enlightened us with: If a program is too slow to respond isn't that about system time? Not by definition. Could be anything. If it's slow to respond due to a slow harddisk, then you're right. If it's slow to respond due to not putting the I/O and the GUI main loop in different threads,

Re: Software bugs aren't inevitable

2005-09-17 Thread Aahz
In article [EMAIL PROTECTED], Mike Meyer [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] (Aahz) writes: In article [EMAIL PROTECTED], Paul Rubin http://[EMAIL PROTECTED] wrote: Every serious FP language implementation optimizes tail calls and thus using recursion instead of iteration doesn't cost

Re: Software bugs aren't inevitable

2005-09-17 Thread Terry Reedy
Aahz [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Note that I said one reason. The primary reason is that tail-call optimization destroys the call stack, which means that exception semantics would have to change. If tail-call optimization were more useful, he might be willing

Re: Software bugs aren't inevitable

2005-09-17 Thread Scott David Daniels
Sybren Stuvel wrote: ... Computers aren't happy. They couldn't care less about the programming language. This reminds me of a quote I love (and wish I could cite the originator): Don't anthropomorphize computers, they don't like that. --Scott David Daniels [EMAIL PROTECTED] --

Re: Software bugs aren't inevitable

2005-09-17 Thread Terry Hancock
On Saturday 17 September 2005 06:03 pm, Scott David Daniels wrote: Sybren Stuvel wrote: ... Computers aren't happy. They couldn't care less about the programming language. This reminds me of a quote I love (and wish I could cite the originator): Don't anthropomorphize computers,

Re: Software bugs aren't inevitable

2005-09-16 Thread Terry Reedy
Mike Meyer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [EMAIL PROTECTED] (Aahz) writes: While that's true, one of the reasons Guido has historically rejected this optimization is because there are plenty of recursive algorithms not amenable to tail-call optimization. That

Re: Software bugs aren't inevitable

2005-09-16 Thread Jerzy Karczmarczuk
Terry Reedy cites: Mike Meyer who fights with: While that's true, one of the reasons Guido has historically rejected this optimization is because there are plenty of recursive algorithms not amenable to tail-call optimization. Since the BDFL is *not* known for doing even mildly silly things when

Re: Software bugs aren't inevitable

2005-09-16 Thread Steven D'Aprano
On Thu, 15 Sep 2005 18:07:28 +0100, phil hunt wrote: On Thu, 15 Sep 2005 21:56:06 +1000, Steven D'Aprano [EMAIL PROTECTED] wrote: Are you saying that the recursion done by serious languages is a fake? That it is actually implemented behind the scenes by iteration? It seems to me that if

Re: Software bugs aren't inevitable

2005-09-16 Thread Michael Sparks
translate into bugs, no matter what approach you use. It's why I find XP and agile approaches interesting, they're often more than just engineering. As a result I'd say that the subject Software bugs aren't inevitable is not true. Regards, Michael. -- [EMAIL PROTECTED], http

Re: Software bugs aren't inevitable

2005-09-16 Thread Paul Rubin
Steven D'Aprano [EMAIL PROTECTED] writes: But there is a difference: writing assembly is *hard*, which is why we prefer not to do it. Are you suggesting that functional programming is significantly easier to do than declarative? I think you mean imperative. Yes, there is a community that

Re: Software bugs aren't inevitable

2005-09-16 Thread Michael Sparks
Steven D'Aprano wrote: On Thu, 15 Sep 2005 18:07:28 +0100, phil hunt wrote: On Thu, 15 Sep 2005 21:56:06 +1000, Steven D'Aprano [EMAIL PROTECTED] wrote: Are you saying that the recursion done by serious languages is a fake? That it is actually implemented behind the scenes by iteration? It

Re: Software bugs aren't inevitable

2005-09-16 Thread Giles Brown
As a result I'd say that the subject Software bugs aren't inevitable is not true. I think you can argue (I would) that any behaviour that is in the specification this isn't right is not a software bug, but a specification error. This obviously puts the focus on specification errors, but standard

Re: Software bugs aren't inevitable

2005-09-16 Thread Terry Hancock
On Thursday 15 September 2005 04:38 am, Jerzy Karczmarczuk wrote: is for me a biased view of the problem. Justified only by the fact that at the beginning of functional programming (sixties) nobody cared about the efficiency. Now, such languages as Clean, or good implementations of Scheme are

Re: Software bugs aren't inevitable

2005-09-16 Thread Sybren Stuvel
Terry Hancock enlightened us with: This is ludicrous sophistry. The technical reason for having ANY high level languages is psychological. Computers are happier with binary code, over ANY language that must be interpreted. Computers aren't happy. They couldn't care less about the programming

Re: Software bugs aren't inevitable

2005-09-16 Thread Terry Hancock
On Friday 16 September 2005 08:35 am, Michael Sparks wrote: Steven D'Aprano wrote: But there is a difference: writing assembly is *hard*, which is why we prefer not to do it. Are you suggesting that functional programming is significantly easier to do than declarative? But there is a

Re: Software bugs aren't inevitable

2005-09-16 Thread Terry Hancock
On Friday 16 September 2005 09:41 am, Terry Hancock wrote: (Terry Hancock formulated this plainly, he prefers dumb ways because he wants to solve problems, and he doesn't like to perform gymnastics with his brain. We have to accept those attitudes. But I believe that this is the effect of

Re: Software bugs aren't inevitable

2005-09-16 Thread Ron Adam
Paul Rubin wrote: Steven D'Aprano [EMAIL PROTECTED] writes: But there is a difference: writing assembly is *hard*, which is why we prefer not to do it. Are you suggesting that functional programming is significantly easier to do than declarative? I think you mean imperative. Yes, there is

Re: Software bugs aren't inevitable

2005-09-16 Thread Ron Adam
Terry Reedy wrote: You cannot tell whether a function object will act recursive or not just by looking at its code body. Trivial examples: I was thinking last night that maybe it would be useful to be able to define a function explicitly as a recursive object where it's frame is reused on

Re: Software bugs aren't inevitable

2005-09-16 Thread phil hunt
On Fri, 16 Sep 2005 20:36:02 +1000, Steven D'Aprano [EMAIL PROTECTED] wrote: On Thu, 15 Sep 2005 18:07:28 +0100, phil hunt wrote: On Thu, 15 Sep 2005 21:56:06 +1000, Steven D'Aprano [EMAIL PROTECTED] wrote: Are you saying that the recursion done by serious languages is a fake? That it is

Re: Software bugs aren't inevitable

2005-09-16 Thread Paddy
The article states that their method calls for them to have much more than normal access to many more people in the clients organisation than is normal; from the CEO to the receptionist. The specification stage can take a year without the customer seeing a line of code. And they deliberately write

Re: Software bugs aren't inevitable

2005-09-16 Thread Mike Meyer
[EMAIL PROTECTED] (phil hunt) writes: Compilers/interpreters/runtimes are black boxes: we don't (or shouldn't) care how they do their work as long as they run correctly and aren't too heavy on system resources like CPU time and memory. Maybe in academia. Not in the real world. Or maybe you

Re: Software bugs aren't inevitable

2005-09-15 Thread Paul Rubin
Paddy [EMAIL PROTECTED] writes: As I write, the main article starts here: http://www.spectrum.ieee.org/sep05/2164 With the sidebar here: http://www.spectrum.ieee.org/sep05/2164/extsb1 Thanks, the article is slightly interesting but it doesn't say much. I'm sure a lot more is going on than

Re: Software bugs aren't inevitable

2005-09-15 Thread Jerzy Karczmarczuk
Steven D'Aprano is still unhappy with the linear complexity recursive Fibonacci I proposed as as an alternative to the cascading recursion which for some people is standard or obvious or other similar attribution which is not valid anymore. RuntimeError: maximum recursion depth exceeded (eg

Re: Software bugs aren't inevitable

2005-09-15 Thread Steven D'Aprano
On Wed, 14 Sep 2005 12:23:00 -0700, Paul Rubin wrote: Steven D'Aprano [EMAIL PROTECTED] writes: It is a mere implementation detail that (for most computer systems, and most programming languages) stack space is at a premium and a deeply recursive function can run out of stack space while the

Oh Yes, They Are [was: Re: Software bugs aren't inevitable]

2005-09-15 Thread Steve Holden
Paddy wrote: A work colleague circulated this interesting article about reducing software bugs by orders of magnitude: http://www.spectrum.ieee.org/WEBONLY/publicfeature/sep05/0905ext.html Some methods they talk about include removing error prone and ambiguous expressions from their ADA

Re: Software bugs aren't inevitable

2005-09-15 Thread Carl Friedrich Bolz
Hi! 2005/9/15, Jerzy Karczmarczuk [EMAIL PROTECTED]: [snip] But, I have used myself the cascading version. It was done on purpose, in order to get to the following solution. [[I preferred to use a global dict, but other ways of doing it are also possible]]. fibdic={0:0,1:1} def fibd(n):

Re: Software bugs aren't inevitable

2005-09-15 Thread Jerzy Karczmarczuk
Steven D'Aprano wrote: On Wed, 14 Sep 2005 12:23:00 -0700, Paul Rubin wrote: Every serious FP language implementation optimizes tail calls and thus using recursion instead of iteration doesn't cost any stack space and it probably generates the exact same machine code. Are you saying that

Re: Oh Yes, They Are [was: Re: Software bugs aren't inevitable]

2005-09-15 Thread Paddy
Surely, (don't call me Shirley), one of the goals pf Python is to make the Programmer more productive. It is obvious that we can tolerate some bugs in programs, but, after reading the article, I thought that we might have a change to here from 'the other side'. I get the fealing that the

Re: Software bugs aren't inevitable

2005-09-15 Thread phil hunt
On Thu, 15 Sep 2005 21:56:06 +1000, Steven D'Aprano [EMAIL PROTECTED] wrote: Are you saying that the recursion done by serious languages is a fake? That it is actually implemented behind the scenes by iteration? It seems to me that if recursion and iteration produce the exact same machine code,

Re: Software bugs aren't inevitable

2005-09-15 Thread Terry Reedy
Steven D'Aprano [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Are you saying that the recursion done by serious languages is a fake? That it is actually implemented behind the scenes by iteration? Although easy to confuse, we should separate expressive syntax, whether recursive

Re: Software bugs aren't inevitable

2005-09-15 Thread Steven D'Aprano
On Wed, 14 Sep 2005 23:44:18 -0400, Terry Reedy wrote: Yes. There are lots of algorithms that could be done, and they all have their pros and cons. Biset's formula, for example, is mathematically correct, but for large enough n, the mere implementation detail that floats have a finite

Re: Software bugs aren't inevitable

2005-09-15 Thread Steven D'Aprano
On Thu, 15 Sep 2005 11:38:57 +0200, Jerzy Karczmarczuk wrote: Yes, the maximum recursion depth in Python is an artificial limit. But that artificial limit is built into Python specifically to protect you from running into a real recursion limit based on the hardware and architecture of your

Re: Software bugs aren't inevitable

2005-09-15 Thread Aahz
In article [EMAIL PROTECTED], Paul Rubin http://[EMAIL PROTECTED] wrote: Every serious FP language implementation optimizes tail calls and thus using recursion instead of iteration doesn't cost any stack space and it probably generates the exact same machine code. While that's true, one of the

Re: Software bugs aren't inevitable

2005-09-15 Thread Mike Meyer
[EMAIL PROTECTED] (Aahz) writes: In article [EMAIL PROTECTED], Paul Rubin http://[EMAIL PROTECTED] wrote: Every serious FP language implementation optimizes tail calls and thus using recursion instead of iteration doesn't cost any stack space and it probably generates the exact same machine

Re: Software bugs aren't inevitable

2005-09-15 Thread François Pinard
[Jerzy Karczmarczuk] Steven D'Aprano recommends iteration over recursion: For instance, try these two simple functions for the nth number in the Fibonacci sequence: def fibr(n): Recursive version of Fibonacci sequence. if n == 0: return 0 elif n == 1: return 1

Re: Software bugs aren't inevitable

2005-09-15 Thread Mike Meyer
François Pinard [EMAIL PROTECTED] writes: This being said, for one, I always found _insane_ presenting recursion to new programmers using such examples, which are both very easily, and much better written non-recursively. It does not help beginners at taking recursion any seriously. This is

Re: Software bugs aren't inevitable

2005-09-15 Thread Paul Rubin
François Pinard [EMAIL PROTECTED] writes: This being said, for one, I always found _insane_ presenting recursion to new programmers using such examples, which are both very easily, and much better written non-recursively. It does not help beginners at taking recursion any seriously. I dunno

Re: Software bugs aren't inevitable

2005-09-14 Thread Paul Rubin
Paddy [EMAIL PROTECTED] writes: A work colleague circulated this interesting article about reducing software bugs by orders of magnitude: http://www.spectrum.ieee.org/WEBONLY/publicfeature/sep05/0905ext.html This gets a not found error. Got a different link? Some methods they talk about

Re: Software bugs aren't inevitable

2005-09-14 Thread Steven D'Aprano
On Wed, 14 Sep 2005 01:05:55 -0700, Paul Rubin wrote: There's a famous paper by John Hughes called Why Functional Programming Matters that (cheap oversimplification) says you should never modify the value of any variable. So, no increments, not even for loops (use recursion instead). Which

Re: Software bugs aren't inevitable

2005-09-14 Thread Jerzy Karczmarczuk
Steven D'Aprano recommends iteration over recursion: For instance, try these two simple functions for the nth number in the Fibonacci sequence: def fibr(n): Recursive version of Fibonacci sequence. if n == 0: return 0 elif n == 1: return 1 else:return fibr(n-1) +

Re: Software bugs aren't inevitable

2005-09-14 Thread Giles Brown
Paddy wrote: I was wondering what Praxis thought of Python, and how good it would be if a Praxis engineer gave a critique of Python as a part of a flow for producing low bug-count software. I used to work at Praxis about 4 years ago and Perl was their scripting language of choice at that time

Re: Software bugs aren't inevitable

2005-09-14 Thread Terry Reedy
Steven D'Aprano [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Which works wonderfully as an academic exercise, but doesn't tend to work so terribly well in the real world where the performance and resource-requirement differences between iteration and recursion can be

Re: Software bugs aren't inevitable

2005-09-14 Thread Rocco Moretti
Terry Reedy wrote: But that, I admit, would be an invalid conclusion. And that, I claim, is also invalid when 'iteration' and 'recursion' are reversed, no matter how often repeated in texts and articles. The difference is between the algorithms, not the differing syntactic expressions

Re: Software bugs aren't inevitable

2005-09-14 Thread Steven D'Aprano
On Wed, 14 Sep 2005 11:28:02 -0400, Terry Reedy wrote: Steven D'Aprano [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Which works wonderfully as an academic exercise, but doesn't tend to work so terribly well in the real world where the performance and resource-requirement

Re: Software bugs aren't inevitable

2005-09-14 Thread Steven D'Aprano
On Wed, 14 Sep 2005 14:32:17 +0200, Jerzy Karczmarczuk wrote: First of all, the recursive version of Fibonacci IS EXPONENTIAL in complexity, don't say such not-quite-truth as not quite. Your correction is noted. I had compared the work done with 2**n, but of course any constant greater than

Re: Software bugs aren't inevitable

2005-09-14 Thread Paul Rubin
Steven D'Aprano [EMAIL PROTECTED] writes: It is a mere implementation detail that (for most computer systems, and most programming languages) stack space is at a premium and a deeply recursive function can run out of stack space while the heap still has lots of free memory. Every serious FP

Re: Software bugs aren't inevitable

2005-09-14 Thread Paddy
Hmm, They seem to have reorganised things. As I write, the main article starts here: http://www.spectrum.ieee.org/sep05/2164 With the sidebar here: http://www.spectrum.ieee.org/sep05/2164/extsb1 - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Software bugs aren't inevitable

2005-09-14 Thread Paddy
Thanks Giles, I was hoping for a reply from someone close to Praxis like yourself, but, I'm shocked when you said they use Perl as their scripting language of choice, because I thought that with such an emphasis on correctness and maintainability, that it would spill over into other aspects of

Re: Software bugs aren't inevitable

2005-09-14 Thread Terry Hancock
On Wednesday 14 September 2005 02:23 pm, Paul Rubin wrote: Steven D'Aprano [EMAIL PROTECTED] writes: It is a mere implementation detail that (for most computer systems, and most programming languages) stack space is at a premium and a deeply recursive function can run out of stack space

Re: Software bugs aren't inevitable

2005-09-14 Thread Terry Reedy
Rocco Moretti [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] The algorithm one uses sometimes depends quite heavily on which mindset you're using. Some algorithms require much more mental effort to understand when in their recursive form versus the iterative form, and vice versa.

Re: Software bugs aren't inevitable

2005-09-14 Thread Terry Reedy
Steven D'Aprano [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Wed, 14 Sep 2005 11:28:02 -0400, Terry Reedy wrote: But in the context of my response, I was replying to a paraphrased quote from somebody who apparently believes that recursion is *always* better than iteration.

Re: Software bugs aren't inevitable

2005-09-14 Thread Terry Reedy
Steven D'Aprano [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Wed, 14 Sep 2005 14:32:17 +0200, Jerzy Karczmarczuk wrote: Here you are a recursive version linear in n; it returns the two last Fibonacci numbers of the sequence The minor problem is that for n = 0, there are no

Software bugs aren't inevitable

2005-09-12 Thread Paddy
A work colleague circulated this interesting article about reducing software bugs by orders of magnitude: http://www.spectrum.ieee.org/WEBONLY/publicfeature/sep05/0905ext.html Some methods they talk about include removing error prone and ambiguous expressions from their ADA based language Sparc