• merc@sh.itjust.works
    link
    fedilink
    arrow-up
    1
    ·
    1 day ago

    To be fair, it’s not an obvious concept.

    If I pick up a notebook and scribble something in it, the next time I pick up the notebook whatever I scribbled will still be there. It’s very unusual that when a computer shuts down the RAM is cleared. Making it worse for intuitive understanding, a lot of apps are constantly saving and restoring state without any user intervention, making it seem like a notebook that just keeps state whenever you use it.

    The implementation detail that RAM is very fast but doesn’t store state but flash is slightly slower but does store state is something that you have to learn. To actually understand why RAM doesn’t store state you need to understand how it’s built, and how capacitors can store charge for a short time but need to be refreshed. Why flash / electrically erasable memory works the way it does is yet another university-level class.

    Add to that that the concept of a “file” and a “filesystem” are not obvious at all. The concept got its name from actual paper documents being strung together with wire. The name was used in early computer work as a skeuomorph to make understanding computer storage easier. This data on disk is grouped together in a “file” just like you’d group together pages of text into a “file”.

    If we were designing things from scratch today, the concept of a “file” or “filesystem” would probably not exist. We’d probably just go with a key-value store on top of some kind of B-tree stuff directly on the flash memory.

    The only reason older people learned these things is that they dealt with computers that were not as user friendly. If someone is young enough, they probably experienced turning off a computer and losing all their stuff because they hadn’t saved. And, saving was cumbersome for a long time. You had to actually decide what filename to use and where on the filesystem to store something. One of the biggest pushes in computing in the last couple of decades is to make all that easier, to make it so that files are saved automatically and you never have to see a file browser or a filename. Sure, the underlying system is still all files, directories, etc. But, that’s just not something that people encounter anymore.