Initialization of method and constructor parameters by calling nested methods (NestedFunctionInParameters)
Similarly, it is not recommended to use nested calls of other functions or other parameterized constructors when initializing constructor parameters
.
At the same time, if the code with nested calls is compact (does not require the hyphenation of expressions) and is easy to read, then nested calls are acceptable.
Incorrect:
Attachments.Insert( AttachedFile.Description, New Picture(GetFromTempStorage( AttachedFiles.GetFileData(AttachedFile.Ref).RefToFileBinaryData)));
It is correct to break such calls into separate operators using additional local variables:
FileImageHRef = AttachedFiles.GetFileData(AttachedFile.Ref).RefToFileBinaryData; PictureData = New Picture(GetFromTempStorage(FileImageHRef)); Attachments.Insert(AttachedFile.Description, PictureData);