DEV Community

Discussion on: Please Stop Using Local Storage

Collapse
 
slang800 profile image
Sean Lang

And sure, you could serialize everything including data types into local storage, but that's an ugly hack.

Lol, what? That's not an ugly hack. That's how anything that isn't a core dump is written to disk. It would be tremendously inefficient and fragile to take JavaScript objects directly from an in-memory representation and then write them out. Unless you're working with a very specific in-memory representation (think Cap'n Proto) you need a serialization step.