Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 10
    I suspect the answer is it probably doesn't matter (yet?), and you should just pick the simplest one then write a properly encapsulated class that will make it easy to change the structure later if you do ever hit a performance bottleneck. Or do you have an existing system that's bottlenecked on this? Commented Jul 10, 2015 at 22:40
  • No, I do not have existing system with the bottleneck. I want to reduce the pain of making changes later. I started implementing the solution with trie and I asked the same question on Facebook programming group. Many programmer suggested me to use B tree as it is the common standard to implement the file system. I am still not sure what would be the advantage of that over the other choices. Commented Jul 10, 2015 at 23:53
  • 2
    I agree with @Ixrec; premature optimization is your enemy. Do something simple now and fix its performance later if necessary. Commented Jul 11, 2015 at 1:53
  • "I want to reduce the pain of making changes later." That is not the question you're asking here. You're asking how to do it the right way the first time. It banks on the assumption that you will do it perfect. You won't. The way to reduce the pain of future changes (which will happen) is to write clean and change-friendly code. The question is not how you should implement your fake file system, it's what abstraction you should use so that whatever implementation you have does not leak into or tightly couple itself to the rest of your codebase. Commented Jun 25 at 6:45