10
xalez
5y

in college ages ago, professor was "teaching" us overloading in C++, he goes something like this:

"so you can overload a function by changing the number of arguments, argument types, or method return type"

I dare put my hand up: "emm .. you can't overload by just changing the return type"

"you can"

"but, but.. how would the compiler know which overload I'm invoking when I call the method?"

pause..

"it depends on the type of the variable receiving the method call result"

"what if I call the method without assigning the result to a variable?"

agitated by now: "ah these are complex compiler concepts that are too complicated blah blah"

although I was unhappy, it was useful to realize no one knows everything

Comments
  • 2
    That's actually pretty horrible.

    Worse than the usual "studied biology and english in 1978 and does cs because he/she is at least better than the rest" - type of rant source teacher we read about.
  • 2
    Let's say you just wrecked him 😊
  • 0
    @CWins actually he was generally a nice guy, I guess he just got too embarassed to admit he's wrong.. vain pride is shitty is probably lesson #2
  • 1
    @DataSec he didn't seem too affected by it tbh 😄
  • 0
    @xalez That's what they always do, they just kind of deny it 😂
Add Comment