[BangPypers] Return values

Noufal Ibrahim KV noufal at nibrahim.net.in
Sat Sep 20 12:54:54 CEST 2014


On Sat, Sep 20 2014, Vivek Ramakrishna wrote:

> Hi Noufal
>
> Why not create two methods, get_stats() and get_stats_list(). Both can
> share logic in a common function which takes the consolidate flag - meaning
> your logic is localised to one point only. It makes for more readable code
> when called as well.

[...]

This approach (especially with many calls) will make the API really
big. I don't remember but I've seen things with get_something,
get_something_list, get_something_dict and what not which don't really
help readability.


-- 
Cordially,
Noufal
http://nibrahim.net.in


More information about the BangPypers mailing list