Why don't Funcs accept more than 16 arguments?

后端 未结 6 963
情话喂你
情话喂你 2021-02-05 04:54

Since Javascript is the language that I am the most proficient at, I am familiar with using functions as first-class objects. I had thought that C# lacked this feature, but then

6条回答
  •  野的像风
    2021-02-05 05:11

    Why is there a limit anyway?

    There is opinion that function probably should not have more than 3 arguments. If it has more, it becomes increasingly harder to understand. Of course this may not be the reason why it is this way in C#, but this limitation may not be such a bad thing after all.

    I would argue that even this limit of 16 is way too much and is encouraging bad design choices already.

提交回复
热议问题