Don't you think it would be better to write the code like this?
source = windows_desktop_folder()
for file in source.list_files_in_folder():
file.move_to_folder(source.subfolder("Photos"))
Or in my pidgin Java: Path source = windowsDesktopFolder();
for (Path file : source.listFiles()) {
file.moveToFolder(source.subfolder("Photos"));
}
It might take a little bit longer to write the code that way, but it seems to me that it would be a lot easier to read the code afterward when you have to debug it; and you could use the same search engine to search methods that you use to search snippets.(There's also the issue that, however good your snippet library is, it will contain bugs, and changes in the outside world will require corresponding changes in the library. One example is that my code here could conceivably run on MacOS or Linux, while the snippeted code hardcodes backslashes and therefore cannot.)