C# 7 supports nested methods. I used them in PVS. But I now substitute them back for these nested methods are using variables defined in their parent scope. Confusing and unclear.
Problem was that body of the pvs search contained too many statements. But usage of nested methods makes it even worse.
Nested methods with unclear names and definitions. Terrible.
Don't use nested methods
Moderators: hgm, Rebel, chrisw
-
- Posts: 1564
- Joined: Thu Jul 16, 2009 10:47 am
- Location: Almere, The Netherlands
Re: Don't use nested methods
Nested methods are common in Pascal and they have some resemblance to Lambda function in C++, I never found any good use for it, and always refrained from using them. It is terrible like you already said.