문제

For flexibility, I've seen some APIs w/ classes that provide identically named class and instance methods.

Are there any reasons as to why this might be a bad idea?

도움이 되었습니까?

해결책

That is at the heart of object oriented programming. It is called polymorphism. It is a good practice. Denying that would be denying object oriented programming.

It saves the brain power of whomever reads or writes the code. You would have to remember less methods, and you don't have to switch between them.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top