Why use tuples instead of objects?

后端 未结 10 1981
别那么骄傲
别那么骄傲 2020-12-24 05:29

The codebase where I work has an object called Pair where A and B are the types of the first and second values in the Pair. I find this object to be offensive, because it g

10条回答
  •  失恋的感觉
    2020-12-24 05:41

    Many things have already been mentioned, but I think one should also mention, that there are some programming styles, that differ from OOP and for those tuples are quite useful.

    Functional programming languages like Haskell for example don't have classes at all.

提交回复
热议问题