On Sun, May 13, 2018 at 2:31 PM, Python <pyt...@bladeshadow.org> wrote: > On Wed, May 09, 2018 at 03:57:35PM +1000, Chris Angelico wrote: >> On Wed, May 9, 2018 at 3:44 PM, Steven D'Aprano >> > If all programmers were as awesome as you and never made typos, the world >> > would be a better place. But we know from experience that even >> > experienced C programmers can make this mistake by accident. >> >> Yes, and I'd go further: I *am* too stupid to get this right. > > No, you are not. Do you ever say "dog" when you mean "dot" instead? > Do you ever say "dad" when you mean "mom" instead? Internalize that > "=" is "equals" (or "assigns" if you prefer) and "==" is "is equal to" > then use those phrases in your head when you're thinking about which > one you need in your code, and I'm pretty sure you'll stop making this > mistake. It may help that the phrase with twice as many syllables > represents the operator that has twice as many characters. Eventually > it becomes second nature, like not calling Dad "Mom."
Riiiight, of course. Because prevention of bugs is just a matter of wanting to. You remind me of a previous boss of mine, who didn't understand why debugging ever had to happen - he thought that if the programmers he employed would just take a bit more care, they could write perfect code. And commits like this never happen: https://github.com/Rosuav/MustardMine/commit/ca0b1f47b2fe4438caea549410e1f1296798ba56 Let me break it to you gently: you are flat out wrong. Yep, that's as gentle as I can make it. ChrisA -- https://mail.python.org/mailman/listinfo/python-list