I'm working on a small tool as a toy project to show the difference between two directories, showing which files/directories were added, removed, modified, etc.
I was trying to represent these changes as simply 'ChangeItem' objects, without distinction between whether it was a file or directory. However, that created a lot of problems, e.g how to display them in a tree, how to know who the parent of a child is, etc. And it was also very unintuitive.
I then split the changes between directory changes and file changes. That immediately made it very easy to code and to understand what was going on. Now its a lot simpler to select all files in a directory, etc.
My question is, how can one know whether to use abstraction or to get more specific in their code? How can you tell if you have too much or too little abstraction?