Why are 'out' parameters in .NET a bad idea?

后端 未结 22 2895
余生分开走
余生分开走 2020-12-25 10:54

Why are \'out\' parameters in .NET a bad idea?

I was recently asked this, but I had no real answer besides it\'s simply unnecessarily complicating an application. Wh

22条回答
  •  盖世英雄少女心
    2020-12-25 11:22

    They just ruin the semantics of a method/function a bit. A method should normally take a bunch of things, and spit out a thing. At least, that's how it is in the minds of most programmers (I would think).

提交回复
热议问题