Re: Things you shouldn't do

2005-03-31 Thread Greg Ewing
Paul McGuire wrote: The code was filled with two key variables: t_1 and t_l. Printing out the source in a Courier font made these two vars completely indistinguishable, Are you sure it was Courier? I'm looking at it now in Courier, and they are different, although very similar. -- Greg Ewing, Comp

Re: Things you shouldn't do

2005-03-30 Thread Paul McGuire
Here's another real world example, although it was in C: char* ptr; assert( ptr = malloc( memsize ); ) Of course, this worked when built in debug, but it took a while to track down why it wasn't working in the release build (the assert()'s were stripped out in the release builds, so ptr didn't al

Re: Things you shouldn't do

2005-03-30 Thread Thomas Bartkus
"Steve" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > What are some of other people's favourite tips for > avoiding bugs in the first place, as opposed to finding > them once you know they are there? > Fonts with slashed zeros and serifs. -Tom -- http://mail.python.org/mailman

Re: Things you shouldn't do

2005-03-30 Thread Richie Hindle
[Steven] > If you have access to a syntax-aware editor, it will > help avoid such problems Seconded. Here's my favourite real-world example of where the lack of syntax colouring cost several man-days of work (though this couldn't happen with modern C compilers): extern void get_s(short* s); v

Re: Things you shouldn't do

2005-03-30 Thread Eric Brunel
On Wed, 30 Mar 2005 07:02:57 GMT, Andrew Dalke <[EMAIL PROTECTED]> wrote: Steve wrote: [an anecdote on distinguishing l1 and 11] What are some of other people's favourite tips for avoiding bugs in the first place, as opposed to finding them once you know they are there? There's a good book on this

Re: Things you shouldn't do

2005-03-29 Thread Andrew Dalke
Steve wrote: > [an anecdote on distinguishing l1 and 11] > What are some of other people's favourite tips for > avoiding bugs in the first place, as opposed to finding > them once you know they are there? There's a good book on this topic - Writing Solid Code. A

Re: Things you shouldn't do

2005-03-29 Thread Paul McGuire
This struck me also when I first saw this post. It reminded me of a body of code I inherited at a former job, that I had to help untangle. The code was filled with two key variables: t_1 and t_l. Printing out the source in a Courier font made these two vars completely indistinguishable, and it to

Things you shouldn't do

2005-03-29 Thread Steve
All names have been removed to protect the guilty :-) In an earlier post, I read a piece of code: l1 = [1, 2, 3] l2 = [1, 2, 3] l1 == l2 True I immediately gave a double-take: 11 equals 12? What gives? Can you re-bind literals in Python??? >>> 11 = [1, 2, 3] SyntaxError: can't assign to literal A