Method Overloading. Can you overuse it?

前端 未结 16 1387
有刺的猬
有刺的猬 2020-12-02 13:38

What\'s better practice when defining several methods that return the same shape of data with different filters? Explicit method names or overloaded methods?

For exa

16条回答
  •  醉梦人生
    2020-12-02 13:59

    As far as I can tell, you won't have fewer methods, just fewer names. I generally prefer the overloaded method system of naming, but I don't think it really makes much difference as long as you comment and document your code well (which you should do in either case).

提交回复
热议问题