Is Using .NET 4.0 Tuples in my C# Code a Poor Design Decision?

前端 未结 13 1885
我在风中等你
我在风中等你 2020-12-02 04:55

With the addition of the Tuple class in .net 4, I have been trying to decide if using them in my design is a bad choice or not. The way I see it, a Tuple can be a shortcut

13条回答
  •  悲&欢浪女
    2020-12-02 05:33

    Don't judge me, I'm not an expert, but with new Tuples in C# 7.x now, you could return something like:

    return (string Name1, int Name2)
    

    At least now you can name it and developers might see some information.

提交回复
热议问题