Reading "Functional programming in Scala" book, there is a chapter where the author wants to show us how to build a parser of simple and complexe strings, as JSON ones.
I came across this advice on page 147:
We'll start with the algebra (including its laws) and decide on a representation later.
This approach - let's call it algebraic design - can be used for any design problem but works particularly well for parsing, because it's easy to imagine what combinators are required for parsing different kinds of inputs.
This lets us keep an eye on the concrete goal even as we defer deciding on representation.
I'm so confused since I am a real adherent of Test-Driven Design.
Test-Driven design insists on the emergence of design guided by tests, therefore emergence of parser combinators.
On the contrary, algebraic design, as described, recommends to discover and specify majority of component's laws and collaboration with others before starting coding implementation.
I know that TDD doesn't "forbid" some kind of design thinking before coding, but not such a deep thinking as algebraic design promotes.
How to deal with those two conflicting way of doing?
Aucun commentaire:
Enregistrer un commentaire