you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 1 year ago (4 children)

I’m saying that when the project gets big, and each of those methods get long, A developer who is new to the project might have some confusion as to why there are methods with the same exact name inside of a class.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 3 points 1 year ago

    Ah. Since they're targeting host applications written in C or C++, I doubt their target demographic would be unfamiliar with function overloading though.

    It's not like one has to use a feature just because it exists, so if it's really an issue just... don't?

  • source
  • parent
  • [–] 1 point 1 year ago (2 children)
  • [–] 1 point 1 year ago (1 child)

    Yes. Which frequently leads to complications.

    #include <iostream>
    using namespace std;
    
    void log(int level) {
        cout << "Logging numeric level: " << level << endl;
    }
    
    void log(string message) {
        cout << "Logging message: " << message << endl;
    }
    
    int main() {
        log('A');  // Uh oh — which one is this?
    }
    
  • source
  • parent
  • hideshow 1 child comment