Don't use nested methods

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Henk
Posts: 7220
Joined: Mon May 27, 2013 10:31 am

Don't use nested methods

Post by Henk »

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.
Joost Buijs
Posts: 1564
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Don't use nested methods

Post by Joost Buijs »

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.