3 ms·
Whenever someone says "We need technology X to go forward. It is our only choice." I see it as a warning. Is there really no other way forward, even if localSto
by IgorPartola 15y ago
Whenever someone says "We need technology X to go forward. It is our only choice." I see it as a warning. Is there really no other way forward, even if localStorage is broken? Maybe IndexDB is awesome (I have no idea), but perhaps it's not the holy grail.
One example of this is CSS. CSS is leaps and bounds better than, for example, GTK's layout and styling system. It is a huge improvement over spacer images and tables. However, it is far (far, very far) from perfect. Having umpteen different ways to position elements, inconsistent layout/display models, inconsistent implementations, no nesting and even lack of arguable features like constants (why can't I define color main_color = #cc0000; and use that everywhere, so I don't violate DRY principle?). It is important to recognize both the benefits and flaws of all technology we use.
Now, it sounds like a lot of the OT's gripe has to do with inconsistent implementations, which are always a huge pain when it comes to web development. However, as some comments suggest, it's at least possible that the spec itself is not broken. Issues like "it's slow" or "it's too small" seem like implementation details. That's like saying "JavaScript is slow" before/after Chrome came around. Right tool for the right job, etc.
- kinlan 15y agoIndexedDB is far from awesome unfortunately, but is our only viable solution at the moment. My point in the post is that we need someway to educate developers that localStorage is not the solution for offline and clientside storage (which it is being pushed as). The actual inconsistency of the API's is not the issue, it is that the usage of the API and what it is being pushed as.
- masklinn 15y ago> localStorage is not the solution for offline and clientside storage (which it is being pushed as). localStorage is A solution for offline and client-side storage, its fitness depends on the application's needs.
- daleharvey 15y agoExactly localStorage wasnt build as a replacement for your dataStore, its just a convenient place to put some of your data, things like preferences, keep ui state across pages etc, its a perfect replacement for cookies without the HTTP overhead, turning it into a more sane localJSON api is like 10 lines of code. I do agree that we should be making sure we move to more robust solutions that were designed for large amounts of data and queries etc when there is a requirement for them, but that doesnt mean localstorage is bad or evil
- masklinn 15y ago> its a perfect replacement for cookies without the HTTP overhead Or for a big global object (to reload on each arrival/page)