|Subject:||Re: Corrected comments and a function check_meshing_chords divided in two. (issue 5975054)|
|Date:||Sun, 15 Apr 2012 15:57:55 +0200|
Splitting the function in two doesn't make it any easier for me to
understand, but I had figured it out before.
On 2012/03/21 18:56:08, Milimetr88 wrote:What I was taught at the university is to write short
and simple functions that do only one thing.
Maybe this was intended as advice for when you initially write code; it
would encourage the writer to find the smallest independent tasks and
cleanest interfaces between those tasks. Splitting up an existing
function, that has grown into its assigned task and assigned interface,
Splitting the function into two parts does not make sense since the
first part has no well-defined output that can be considered reasonably
independent from the requirements and workings of the algorithms in the
second part. When you are redesigning the second part, you'll need to
redefine the "interface" between the two parts and the first part as
well. Whether or not you put an artificial function call boundary in
the middle of the function, it is not composed of modular parts that
could be reused in different contexts.
Modularity is not a self-serving goal.
|[Prev in Thread]||Current Thread||[Next in Thread]|