|
|
|
|
|
by Lio
2452 days ago
|
|
I know nothing about C# so please pardon my ignorance but how does: new FileInfo(srcPath).CopyTo(dstPath);
provide more protection vs CopyFile(src: srcPath, dest: dstPath);
Assuming that both path strings are set correctly isn't a typo here going to cause the same error and be just as visible?e.g. new FileInfo(pathA).CopyTo(pathB);
CopyFile(src: pathB, dest: pathA);
neither would seem to show which is correct without knowing what the path values are if the variable names are ambiguous. |
|
If you can't keep track of your variable names, then using keyword arguments, like others here talk about, won't help much, either.