Friday finking: TDD and EAFP

DL Neil PythonList at danceswithmice.info
Sun Nov 3 13:41:32 EST 2019


On 3/11/19 6:30 AM, Bev In TX wrote:
>> On Nov 1, 2019, at 12:40 AM, DL Neil via Python-list 
>> <python-list at python.org <mailto:python-list at python.org>> wrote:
>>
>> Is the practice of TDD fundamentally, if not philosophically, somewhat 
>> contrary to Python's EAFP approach?

> I’m not an expert on either TDD or Python, but as no one else has 
> responded, I’ll put in my 2 cents worth...
> You are mixing paradigms.  TDD is about testing code, regardless of the 
> style in which it was written.

Agreed: (in theory) TDD is independent of language or style. However, 
I'm wondering if (in practice) it creates a mode of thinking that pushes 
one into an EAFP way of thinking?


> Yes, exceptions can handle some edge cases; however, that does NOT mean 
> that ...
> 
>   * all code handles all edge cases.
>   * all bugs are only in edge cases.
>   * all exception handling code is perfectly written.
>   * Etc

The preceding description was deliberately short and not intended as a 
definition of TDD, nor bug-hunting. Have I missed your point here? 
(apologies)

-- 
Regards =dn


More information about the Python-list mailing list