
Hi, On Fri, Oct 12, 2012 at 03:28:39PM +0200, Emmanuel Touzery wrote:
It annoys me that the first function returns "incomplete" objects... It somehow feels wrong.
Maybe you would feel better about it if you put both functions under one "umbrella" function like this:
parseProgramme = getDetails . getProgramme where getProgramme = ... getDetails = ...
That way, your "incomplete" objects would never be exposed to "end user" (even though it's just you). It also gives you an abstraction that may gain you in a future when, say, you would want to fetch pictures as well — it would be just a matter of adding one more function under the "umbrella". Overall, splitting your algorithm into simple steps — steps that would do just a part of work and return incomplete objects — is the way to go. -- Regards, Alexander Batischev PGP key 356961A20C8BFD03 Fingerprint: CE6C 4307 9348 58E3 FD94 A00F 3569 61A2 0C8B FD03