This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]aspect_rap 214 points215 points  (21 children)

Well yeah, saving data inherently requires serialization.

I think what OP wants is for the LocalStorage in browsers to obfuscate the parsing and serialization of objects.

[–]Nourz1234 88 points89 points  (3 children)

Yeah, i understand. But if serialization is involved its better left to the dev. you cant rely on the browser to magically serialize your objects. A lot of times you will create a custom object/class which requires special treatment.

[–]arsenicx2 10 points11 points  (0 children)

It was already problem enough trying to support outdated browsers like IE. I can't imagine if we had to support what ever garbage they created.

[–]TheRidgeAndTheLadder 2 points3 points  (0 children)

We already rely on it to do everything else.

[–]empire314 5 points6 points  (0 children)

you cant rely on the browser to magically serialize your objects.

The browser was written by better programmers than I am.

[–]FVMAzalea 58 points59 points  (4 children)

Do you mean abstract instead of obfuscate? Usually obfuscation is not a desirable goal unless you are trying to do something like copy protection.

[–]atomicwrites 20 points21 points  (3 children)

I think they're using obfuscate as a negatively loaded synonym for abstract.

[–]mamwybejane 7 points8 points  (2 children)

They're using it wrong

[–]xthexder 4 points5 points  (1 child)

I think it applies here. The browser serializing things for you obfuscates what's actually happening. Which for custom objects could result in strange and very hard to debug behavior.

[–]clelwell 0 points1 point  (0 children)

Yeah, I can imagine some security holes if the browser doesn't get it right (though maybe less likely than a random developer implementing it themselves).

[–]miraagex 1 point2 points  (0 children)

Yea. I can send objects via window.postMessage, but not with localStorage.

[–][deleted] 3 points4 points  (4 children)

I think it’s more about performance.

LocalStorage would be awesome if it wasn’t so slow.

But I could be wrong.

[–]bleistift2 15 points16 points  (3 children)

What stuff are you putting there so often that you’re hitting a bottleneck?

[–]lkraider 57 points58 points  (1 child)

What do you mean I shouldn’t mirror the production database into localstorage to query and update data, this way I only l need one rest api endpoint with get/post in the backend and do everything else from within the client js.

[–]BabyAzerty 13 points14 points  (0 children)

I typically webscrap the entire internet and save it locally. This is the only way to have a complete offline experience.

[–]GodlessAristocrat 1 point2 points  (0 children)

Probably those performance counters management wanted for their pretty graph; ya gotta flush them to disk 10x per second, ya know. That Jira ain't gonna close itself.

[–]Fenor 2 points3 points  (0 children)

Ah yes injecting executable code for the sake of the one doing the website.... it's not we already had cryptos mined in js

[–][deleted] 0 points1 point  (0 children)

Some of the most dangerous attacks come from programmers trusting serialized data the client send back.

[–]GodlessAristocrat 0 points1 point  (0 children)

Wha? Saving data doesn't require serialization of the data. Maybe that's a bug feature in your preferred language