On 6/11/19 8:01 AM, Barry Scott wrote:
On 1 Nov 2019, at 05:40, DL Neil via Python-list <python-list@python.org> wrote:
Is the practice of TDD fundamentally, if not philosophically, somewhat contrary 
to Python's EAFP approach?
The practice of TDD* is that one writes test routines to prove a unit of code, 
eg method or function; BEFORE actually writing said function.
The rationale is that TDD encourages proper identification and consideration of the 
routine's specification, and attempts to ensure that exceptions and 
"edge-cases" are not quietly forgotten.
(in a broad-brush, nut-shell)
The practice of creating software is a social activity where those involved
have foibles. Managing all the social interactions and foibles is what
the methodologies are trying to help with. Any methodology that is easier
to follow then avoid will tend to be taken up and provide a benefit.

We all know that tests are a must have, but often those tests that we all
know are a must have do not get written. It can often seem like a chore,
after all the code works right?

By starting with the tests the social engineering means that you make having
the tests the easy part of the process.

Methodologies like Agile address other foibles. Given a far off dead line
the tendency is to delay getting the bulk of the work done until at the last
moment.

So is TDD contrary to EAFP? Not as such its two sorts of social engineering.
TDD helps get the tests, EAPF give permission to take risks, necessary to
innovate.
+1
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to