Is delegating calls between classes bad practice?
<p>I know that delegating from one method to another in the same class is okay as it reduces code duplication, but is delegating calls to other class types considered bad practice?</p>

<p>For example:</p>

<p>Doing this is okay.</p>

<pre class="lang-c prettyprint-override"> <code>
double Point::GetDistanceFrom(const Point& point) const {
    return GetDistanceFrom(this->GetX(), this->GetY(), point.GetX(), point.GetY());
}

double Point::GetDistanceFrom(const Point& one, const Point& two) {
    return GetDistanceFrom(one.GetX(), one.GetY(), two.GetX(), two.GetY());
}

double Point::GetDistanceFrom(double x1, double y1, double x2, double y2) {
    return std::sqrt(GetDistanceFromSquared(x1, y1, x2, y2));
}

double Point::GetDistanceFromSquared(double x1, double y1, double x2, double y2) {
    x2 -= x1;
    y2 -= y1;
    return (x2 * x2 + y2 * y2);
}
double Point::GetDistanceFromSquared(const Point& one, const Point& two) {
    return GetDistanceFromSquared(one.GetX(), one.GetY(), two.GetX(), two.GetY());
}
</code> </pre>

<p>But what about this?</p>

<pre class="lang-c prettyprint-override"> <code>

double Point::GetDistanceFrom(const Line& line, bool isInfinite) const {
    if(isInfinite) return line.ptLineDist(line.GetPointOne().GetX(), line.GetPointOne().GetY(), line.GetPointTwo().GetX(), line.GetPointTwo().GetY(), this->GetX(), this->GetY());
    return line.ptSegDist(line.GetPointOne().GetX(), line.GetPointOne().GetY(), line.GetPointTwo().GetX(), line.GetPointTwo().GetY(), this->GetX(), this->GetY());
}

</code> </pre>

<p>And this?</p>

<pre class="lang-c prettyprint-override"> <code>

double Line::GetDistanceFrom(const Point& point, bool isInfinite) const {
    return point.GetDistanceFrom(*this, isInfinite);
}
</code> </pre>
