Re: Patterns of Bugs

2011-02-01 Thread Bruno Medeiros
On 28/01/2011 12:41, Daniel Gibson wrote: Am 28.01.2011 13:33, schrieb Bruno Medeiros: On 08/01/2011 09:14, Walter Bright wrote: Jonathan M Davis wrote: On Saturday 08 January 2011 00:16:13 Walter Bright wrote: Jérôme M. Berger wrote: When I built my latest PC, I saw in the MB manual that

Re: Patterns of Bugs

2011-01-28 Thread Bruno Medeiros
On 08/01/2011 09:14, Walter Bright wrote: Jonathan M Davis wrote: On Saturday 08 January 2011 00:16:13 Walter Bright wrote: Jérôme M. Berger wrote: When I built my latest PC, I saw in the MB manual that it would use speech synthesis on the PC speaker to report errors. So I tried to power on

Re: Patterns of Bugs

2011-01-28 Thread Daniel Gibson
Am 28.01.2011 13:33, schrieb Bruno Medeiros: On 08/01/2011 09:14, Walter Bright wrote: Jonathan M Davis wrote: On Saturday 08 January 2011 00:16:13 Walter Bright wrote: Jérôme M. Berger wrote: When I built my latest PC, I saw in the MB manual that it would use speech synthesis on the PC

Re: Patterns of Bugs

2011-01-10 Thread Lars T. Kyllingstad
On Sat, 08 Jan 2011 20:53:20 +, Iain Buclaw wrote: == Quote from Ellery Newcomer (ellery-newco...@utulsa.edu)'s article On 01/08/2011 02:37 PM, Iain Buclaw wrote: Never let indentation fool you, the else clause will be assumed to be for the first condition. :o) I don't believe you

Re: Patterns of Bugs

2011-01-08 Thread Jérôme M. Berger
Jonathan M Davis wrote: On Friday, January 07, 2011 11:06:23 Andrej Mitrovic wrote: On 1/7/11, Walter Bright newshou...@digitalmars.com wrote: Some of them, like the hard drive LED, don't even indicate the polarity on the connector.. I hate those things. There's bunch of LEDs on the PC case

Re: Patterns of Bugs

2011-01-08 Thread Walter Bright
Jérôme M. Berger wrote: When I built my latest PC, I saw in the MB manual that it would use speech synthesis on the PC speaker to report errors. So I tried to power on the PC without having plugged either CPU or RAM and it started to say NO CPU FOUND! NO CPU FOUND! in a loop with a

Re: Patterns of Bugs

2011-01-08 Thread Jonathan M Davis
On Saturday 08 January 2011 00:16:13 Walter Bright wrote: Jérôme M. Berger wrote: When I built my latest PC, I saw in the MB manual that it would use speech synthesis on the PC speaker to report errors. So I tried to power on the PC without having plugged either CPU or RAM and it

Re: Patterns of Bugs

2011-01-08 Thread Walter Bright
Jonathan M Davis wrote: On Saturday 08 January 2011 00:16:13 Walter Bright wrote: Jérôme M. Berger wrote: When I built my latest PC, I saw in the MB manual that it would use speech synthesis on the PC speaker to report errors. So I tried to power on the PC without having plugged

Re: Patterns of Bugs

2011-01-08 Thread Jonathan M Davis
On Saturday 08 January 2011 01:14:41 Walter Bright wrote: Jonathan M Davis wrote: On Saturday 08 January 2011 00:16:13 Walter Bright wrote: Jérôme M. Berger wrote: When I built my latest PC, I saw in the MB manual that it would use speech synthesis on the PC speaker to report errors.

Re: Patterns of Bugs

2011-01-08 Thread Walter Bright
Jonathan M Davis wrote: On and Off would be much better, but I suspect that it's one of those things where they chose symbols instead so that they didn't have to worry about internationalization. That way, it confuses _everyone_ instead of just non- English speakers. ;) I suspect as much,

Re: Patterns of Bugs

2011-01-08 Thread Lutger Blijdestijn
Walter Bright wrote: Jonathan M Davis wrote: On and Off would be much better, but I suspect that it's one of those things where they chose symbols instead so that they didn't have to worry about internationalization. That way, it confuses _everyone_ instead of just non- English speakers. ;)

Re: Patterns of Bugs

2011-01-08 Thread bearophile
The Reddit thread about this little article shows some interesting sub-threads: http://www.reddit.com/r/programming/comments/exfnb/patterns_of_bugs/ So I add some more comments to my first answer to the article:

Re: Patterns of Bugs

2011-01-08 Thread Iain Buclaw
== Quote from Lutger Blijdestijn (lutger.blijdest...@gmail.com)'s article Walter Bright wrote: Jonathan M Davis wrote: On and Off would be much better, but I suspect that it's one of those things where they chose symbols instead so that they didn't have to worry about

Re: Patterns of Bugs

2011-01-08 Thread bearophile
Iain Buclaw: On the note of if statements. One pattern of bugs I see on the odd occasion are else statements written like this: if (condition1) if (condition2) statement1; else statement2; Always takes a moment or two to look again and realise it wouldn't

Re: Patterns of Bugs

2011-01-08 Thread Iain Buclaw
== Quote from bearophile (bearophileh...@lycos.com)'s article Iain Buclaw: On the note of if statements. One pattern of bugs I see on the odd occasion are else statements written like this: if (condition1) if (condition2) statement1; else statement2;

Re: Patterns of Bugs

2011-01-08 Thread bearophile
Iain Buclaw: http://d.puremagic.com/issues/show_bug.cgi?id=4924 I don't see that as a bug, and that enforces a certain coding style onto the end programmer I agree that's a bit controversial, but a known C lint finds that problem, and every strategy is good against bugs :-) (does no

Re: Patterns of Bugs

2011-01-08 Thread Daniel Gibson
Am 08.01.2011 08:57, schrieb Jérôme M. Berger: Jonathan M Davis wrote: On Friday, January 07, 2011 11:06:23 Andrej Mitrovic wrote: On 1/7/11, Walter Brightnewshou...@digitalmars.com wrote: Some of them, like the hard drive LED, don't even indicate the polarity on the connector.. I hate

Re: Patterns of Bugs

2011-01-08 Thread torhu
On 08.01.2011 15:13, Iain Buclaw wrote: On the note of if statements. One pattern of bugs I see on the odd occasion are else statements written like this: if (condition1) if (condition2) statement1; else statement2; Always takes a moment or two to look again and

Re: Patterns of Bugs

2011-01-08 Thread Jérôme M. Berger
Daniel Gibson wrote: Am 08.01.2011 08:57, schrieb Jérôme M. Berger: When I built my latest PC, I saw in the MB manual that it would use speech synthesis on the PC speaker to report errors. So I tried to power on the PC without having plugged either CPU or RAM and it started to say NO CPU

Re: Patterns of Bugs

2011-01-08 Thread Nick Sabalausky
Jérôme M. Berger jeber...@free.fr wrote in message news:igaasf$rd...@digitalmars.com... It is an Asus A7N8X. Unless I'm just out-of-date, Asus does tend to be pretty good.

Re: Patterns of Bugs

2011-01-08 Thread Andrej Mitrovic
I wonder if you can hack the thing to say whatever you want.

Re: Patterns of Bugs

2011-01-08 Thread Iain Buclaw
== Quote from Andrej Mitrovic (andrej.mitrov...@gmail.com)'s article I wonder if you can hack the thing to say whatever you want. If you'd could I'd program it to say “Good Afternoon Michael” every time I turn it on.

Re: Patterns of Bugs

2011-01-08 Thread Iain Buclaw
== Quote from torhu (n...@spam.invalid)'s article On 08.01.2011 15:13, Iain Buclaw wrote: On the note of if statements. One pattern of bugs I see on the odd occasion are else statements written like this: if (condition1) if (condition2) statement1; else

Re: Patterns of Bugs

2011-01-08 Thread Ellery Newcomer
On 01/08/2011 02:37 PM, Iain Buclaw wrote: Never let indentation fool you, the else clause will be assumed to be for the first condition. :o) I don't believe you

Re: Patterns of Bugs

2011-01-08 Thread Iain Buclaw
== Quote from Ellery Newcomer (ellery-newco...@utulsa.edu)'s article On 01/08/2011 02:37 PM, Iain Buclaw wrote: Never let indentation fool you, the else clause will be assumed to be for the first condition. :o) I don't believe you Are you saying it *isn't* interpreted as: if (i)

Re: Patterns of Bugs

2011-01-08 Thread Daniel Gibson
Am 08.01.2011 21:53, schrieb Iain Buclaw: == Quote from Ellery Newcomer (ellery-newco...@utulsa.edu)'s article On 01/08/2011 02:37 PM, Iain Buclaw wrote: Never let indentation fool you, the else clause will be assumed to be for the first condition. :o) I don't believe you Are you saying it

Re: Patterns of Bugs

2011-01-08 Thread Walter Bright
bearophile wrote: The problem here is that writing code is a creative thinking process. Bolting things to an airplane is not. This is an important insight that I think Walter article misses. Not at all. Most of software engineering work consists of plugging in subassemblies. In this case,

Re: Patterns of Bugs

2011-01-08 Thread bearophile
Walter: Not at all. Most of software engineering work consists of plugging in subassemblies. In this case, designing the grammar such that the subassemblies of the grammar won't fit together in ways that don't make sense is perfectly analogous. I see and I agree. That

Re: Patterns of Bugs

2011-01-07 Thread Max Samukha
On 01/06/2011 09:38 PM, Walter Bright wrote: http://www.drdobbs.com/blog/archives/2011/01/patterns_of_bug.html (dedicated to bearophile!) Anyone want to post it on reddit? Good points. However, computer hardware analogies are a bit outdated. For example, USB is prevalent nowadays. You

Re: Patterns of Bugs

2011-01-07 Thread Nick Sabalausky
JMRyan nos...@nospam.com wrote in message news:ig6cjg$u8...@digitalmars.com... Nick Sabalausky a...@a.a wrote in news:ig5860$231...@digitalmars.com: long-time hardcore fan of the classic book Writing Solid Code, the Although the book is justifiably a classic, its subtitle is the very

Re: Patterns of Bugs

2011-01-07 Thread Nick Sabalausky
Max Samukha spam...@d-coding.com wrote in message news:ig7jqi$1mf...@digitalmars.com... On 01/06/2011 09:38 PM, Walter Bright wrote: http://www.drdobbs.com/blog/archives/2011/01/patterns_of_bug.html (dedicated to bearophile!) Anyone want to post it on reddit? Good points. However,

Re: Patterns of Bugs

2011-01-07 Thread Walter Bright
Max Samukha wrote: On 01/06/2011 09:38 PM, Walter Bright wrote: http://www.drdobbs.com/blog/archives/2011/01/patterns_of_bug.html (dedicated to bearophile!) Anyone want to post it on reddit? Good points. However, computer hardware analogies are a bit outdated. For example, USB is prevalent

Re: Patterns of Bugs

2011-01-07 Thread Walter Bright
Nick Sabalausky wrote: Also, I'm pretty sure that, quite a while ago, the PS/2 ports did start getting made to work with either keyboard or mouse even though they often still got labeled as being just one or the other. Last time I tried that, it didn't work.

Re: Patterns of Bugs

2011-01-07 Thread Andrej Mitrovic
On 1/7/11, Walter Bright newshou...@digitalmars.com wrote: Some of them, like the hard drive LED, don't even indicate the polarity on the connector.. I hate those things. There's bunch of LEDs on the PC case - USB indicators, power LEDs, etc, and they all have this super-tiny connector and they

Re: Patterns of Bugs

2011-01-07 Thread Steven Schveighoffer
On Fri, 07 Jan 2011 13:47:43 -0500, Walter Bright newshou...@digitalmars.com wrote: Max Samukha wrote: Also, memory module connectors are incompatible starting from I believe DDR. You won't be able to stick DDR2 module into DDR slot. Actually, this applies to almost any modern PC

Re: Patterns of Bugs

2011-01-07 Thread Jesse Phillips
Walter Bright Wrote: Nick Sabalausky wrote: Also, I'm pretty sure that, quite a while ago, the PS/2 ports did start getting made to work with either keyboard or mouse even though they often still got labeled as being just one or the other. Last time I tried that, it didn't work. You

Re: Patterns of Bugs

2011-01-07 Thread Jonathan M Davis
On Friday, January 07, 2011 11:06:23 Andrej Mitrovic wrote: On 1/7/11, Walter Bright newshou...@digitalmars.com wrote: Some of them, like the hard drive LED, don't even indicate the polarity on the connector.. I hate those things. There's bunch of LEDs on the PC case - USB indicators,

Re: Patterns of Bugs

2011-01-07 Thread Jonathan M Davis
On Friday, January 07, 2011 11:07:54 Steven Schveighoffer wrote: Typically, those are not keyed because it's not expected for a normal user to be accessing those cables. Removing the cover of a PC is like casting in D :) LOL. Yeah. Every time that I build a box, I think about how it would

Re: Patterns of Bugs

2011-01-07 Thread Adam D. Ruppe
On Fri, Jan 07, 2011 at 11:27:14AM -0800, Jonathan M Davis wrote: is getting too warm. However, I think that it's horrific that anything in the OS or any program on the computer at all uses the PC speaker. I *love* the pc speaker. It is the only kind of application alert sound I actually

Re: Patterns of Bugs

2011-01-07 Thread Nick Sabalausky
Walter Bright newshou...@digitalmars.com wrote in message news:ig7n8o$1t3...@digitalmars.com... Max Samukha wrote: On 01/06/2011 09:38 PM, Walter Bright wrote: http://www.drdobbs.com/blog/archives/2011/01/patterns_of_bug.html (dedicated to bearophile!) Anyone want to post it on reddit?

Re: Patterns of Bugs

2011-01-07 Thread Steven Schveighoffer
On Fri, 07 Jan 2011 14:44:10 -0500, Nick Sabalausky a...@a.a wrote: Walter Bright newshou...@digitalmars.com wrote in message news:ig7n8o$1t3...@digitalmars.com... Max Samukha wrote: On 01/06/2011 09:38 PM, Walter Bright wrote:

Re: Patterns of Bugs

2011-01-07 Thread Nick Sabalausky
Steven Schveighoffer schvei...@yahoo.com wrote in message news:op.voyerqyseav...@steve-laptop... On Fri, 07 Jan 2011 14:44:10 -0500, Nick Sabalausky a...@a.a wrote: Walter Bright newshou...@digitalmars.com wrote in message news:ig7n8o$1t3...@digitalmars.com... Max Samukha wrote: On

Patterns of Bugs

2011-01-06 Thread Walter Bright
http://www.drdobbs.com/blog/archives/2011/01/patterns_of_bug.html (dedicated to bearophile!) Anyone want to post it on reddit?

Re: Patterns of Bugs

2011-01-06 Thread BlazingWhitester
On 2011-01-06 21:38:38 +0200, Walter Bright said: http://www.drdobbs.com/blog/archives/2011/01/patterns_of_bug.html (dedicated to bearophile!) Anyone want to post it on reddit? http://www.reddit.com/r/programming/comments/exfnb/patterns_of_bugs/ done!

Re: Patterns of Bugs

2011-01-06 Thread Nick Sabalausky
Walter Bright newshou...@digitalmars.com wrote in message news:ig55s4$1uc...@digitalmars.com... http://www.drdobbs.com/blog/archives/2011/01/patterns_of_bug.html (dedicated to bearophile!) Anyone want to post it on reddit? I noticed that C-style octal literals were conspicuously absent from

Re: Patterns of Bugs

2011-01-06 Thread Robert Clipsham
On 06/01/11 19:38, Walter Bright wrote: http://www.drdobbs.com/blog/archives/2011/01/patterns_of_bug.html (dedicated to bearophile!) Anyone want to post it on reddit? It's too bad there doesn't seem to be an online repository of them. They would make for great research material for

Re: Patterns of Bugs

2011-01-06 Thread Walter Bright
Nick Sabalausky wrote: I noticed that C-style octal literals were conspicuously absent from the examples ;) Everyone has their favorite pattern. I could literally list thousands of them. Great article, though. Having been in D-land for so long, and being a long-time hardcore fan of the

Re: Patterns of Bugs

2011-01-06 Thread Guilherme Vieira
On Thu, Jan 6, 2011 at 6:25 PM, Robert Clipsham rob...@octarineparrot.comwrote: On 06/01/11 19:38, Walter Bright wrote: http://www.drdobbs.com/blog/archives/2011/01/patterns_of_bug.html (dedicated to bearophile!) Anyone want to post it on reddit? It's too bad there doesn't seem to be an

Re: Patterns of Bugs

2011-01-06 Thread bearophile
Walter: http://www.drdobbs.com/blog/archives/2011/01/patterns_of_bug.html (dedicated to bearophile!) Thank you Walter :-) The article is simple but nice. Few comments: The possible mechanic's mistake is designed out of the system. In the first books written by Donald Norman there are many

Re: Patterns of Bugs

2011-01-06 Thread Jesse Phillips
Guilherme Vieira Wrote: On Thu, Jan 6, 2011 at 6:25 PM, Robert Clipsham rob...@octarineparrot.comwrote: If no one else volunteers I guess I could hack something crude together, it would still need people to volunteer bugs for it, as well as sources/proof for each bug (links to

Re: Patterns of Bugs

2011-01-06 Thread Daniel Gibson
Am 06.01.2011 21:37, schrieb Guilherme Vieira: On Thu, Jan 6, 2011 at 6:25 PM, Robert Clipsham rob...@octarineparrot.com mailto:rob...@octarineparrot.com wrote: On 06/01/11 19:38, Walter Bright wrote: http://www.drdobbs.com/blog/archives/2011/01/patterns_of_bug.html

Re: Patterns of Bugs

2011-01-06 Thread JMRyan
Nick Sabalausky a...@a.a wrote in news:ig5860$231...@digitalmars.com: long-time hardcore fan of the classic book Writing Solid Code, the Although the book is justifiably a classic, its subtitle is the very definition of the expression unintentionally hilarious.