Can anyone suggest a better pattern for processing a number of steps like this?
The only other way I can think of now is using exceptions for flow control but I’ve read that it is not advisable because it is basically a goto statement.
if (FileHandler.CheckIfNewFilesExist(sourceFolderPath))
{
if (FileHandler.MoveFolder(sourceFolderPath, temporyFolderPath))
{
if (CSVHandler.AppendUniqueIdToCSV(temporyFolderPath, filesToBeAppended))
{
FileHandler.CopyFolder(temporyFolderPath, finalFolderPath);
}
}
}
Use &&