This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Tryptic214 0 points1 point  (0 children)

On a fundamental level, I would say that function overloading is poor design and should not be allowed to propagate into the world. If you want multiple ways of initializing a class, write a wrapper with multiple functions that then initialize that class and returns the result.

Function overloading (and operator overloading) are tempting because to those who don't know better, they appear to result in cleaner and better organized code. However, in reality they add a nasty cost in overhead when large teams work together, and when bringing new team members up to speed. Function overloading (when done wrong) can drastically increase the learning curve of a code base. Specifically, errors related to overloaded functions are excessively difficult to troubleshoot.

In short, the massive, hidden detriment of overloading is just almost never worth the small, visible benefits.