HN user

marcuswestin

433 karma

http://marcuswest.in

[ my public key: https://keybase.io/marcuswestin; my proof: https://keybase.io/marcuswestin/sigs/WYXCFq2ZdmUKksmgntn6sK9Gmb90IVwNjVvHo-N_eEA ]

Posts20
Comments85
View on HN
news.ycombinator.com 5mo ago

Tell HN: Ask your AI, "What can you tell me that you know about me?" to see ...

marcuswestin
4pts3
github.com 9y ago

Show HN: Store.js v2.0 – Cross-browser storage for all use cases

marcuswestin
162pts54
www.bbc.com 10y ago

Web's random numbers are too weak, researchers warn

marcuswestin
1pts0
twitter.com 13y ago

Engineer with product & company looking for designer cofounder

marcuswestin
1pts0
marcuswest.in 13y ago

The Rise of Artistic Computing

marcuswestin
1pts0
github.com 13y ago

WebViewProxy for iOS - easily intercept requests from UIWebViews

marcuswestin
3pts1
www.ewherry.com 13y ago

Preserving Startup awesomeness: why metrics aren’t enough

marcuswestin
2pts0
gist.github.com 14y ago

Gitup - 20 line bash script to update git repo and all git submodules

marcuswestin
2pts0
marcuswest.in 14y ago

TodoMVC app written in Fun, a new programming language for the realtime web

marcuswestin
1pts0
www.clover.com 14y ago

Clover has cracked online mobile payments.

marcuswestin
1pts0
twitter.com 14y ago

ObjC Blocks Triple Entendre

marcuswestin
2pts0
github.com 14y ago

WebViewJavascriptBridge - An iOS class for simple JS message passing

marcuswestin
2pts0
news.ycombinator.com 15y ago

Ask HN: what's the black bar on top of HN?

marcuswestin
5pts1
news.ycombinator.com 15y ago

Ask HN: how should one act differently in the face of a potential bubble?

marcuswestin
2pts1
news.ycombinator.com 15y ago

Ask HN: angel/series A startups located in NY?

marcuswestin
2pts0
marcuswest.in 15y ago

The Four Elements of Web Performance: Weight, Time, Processing & Perception

marcuswestin
4pts1
github.com 15y ago

Browser-require.js brings "require" to the browser (just like node)

marcuswestin
17pts16
marcuswest.in 15y ago

The World's Most Underpaid Profession (creating an economy for great teachers)

marcuswestin
15pts16
news.ycombinator.com 15y ago

Meebo has a postMessage replacement for IE7

marcuswestin
3pts1
marcuswest.in 15y ago

Fun - a new programming language for the realtime web

marcuswestin
122pts51

Soundboks 4 sync wirelessly with each other. They’re also battery driven and absurdly loud, so perfect for bringing outdoors or a dance party somewhere.

They just had a 30% sale for the holidays though, so might not be worth getting them at full price

Store.js is here to make life easier for all web devs, beginners and pros :) I've concluded that adding an async API in addition to the sync one for access to the more powerful storages makes total sense though! Off the top of my head I'm leaning towards new methods for the async versions, and then probably adding localForage as a new storage.

Thanks for taking the time to make the case!

Totally! I created an issue to pull this info together: https://github.com/marcuswestin/store.js/issues/189

Check back in coming days for more details.

Store.js will soon have pluggable support for localForage (either by implementing similar functionality in separate storages, or by simply adding a pluggable storage which uses localForage under the hood).

There are a few benefits to using store.js, such as full cross-browser support and useful plugins, but the biggest meaningful value-add over localForage is probably the availability of a synchronous API that allows you to read and write values without callbacks, promises, etc.

In my experience you only want to use asynchronous APIs when you have to, since they add a fair amount of complexity, are a common source of errors, and are harder to debug properly.

But yeah, check back later and you'll likely find that store.js supports the same storages as localForage, in addition to the its other functionality.

Except when a value has already been stored previously without JSON.stringify (in which case JSON.parse will throw), or you need a default value if unset (e.g `store.get('username', 'anonymous')`, or ... :) But I also see your point that sometimes the very quick and simple solution can be useful!

On the other hand, synchronous interfaces tend to be less error prone and simpler to work with (and more enjoyable...? :)

There is an active issue to add the async indexdb/websql storages to Store.js (https://github.com/marcuswestin/store.js/issues/181) so that they can be used when needed (e.g when you need to store many tends of MGs of data), but for 90% of your use cases the simplicity of the synchronous store.js API may likely save you a meaningful amount of code and callback/Promise/stack trace debuggery :)

I think something like store.js ends up being genuinely useful for anyone building functionality that depends on localStorage. More often than not you find yourself either having to deal with issues that store.js solves for you (E.g not breaking your site in Safari private mode) or requiring extra functionality that already exists as a small store.js plugin. (E.g expiring keys, default values, etc). All of these are things you can of course do without a library, but at that point you're reinventing the wheel a bit and not benefitting from all the automated testing that ensures cross-browser correctness. With that said, I agree there are times when just a quick read/write directly to localStorage can be the right call, but by default I think it comes back to bite you one way or another more often than not :)

Duh, of course! Sorry, 3am and not too sharp in the nut at the time :)

I'm genuinely interested in supporting every needed use case. Off the top of my head, I could see e.g get returning a promise in some cases, or passing an optional callback to get, or having a get.async... Either way - I'll have it in the back of my head and see what can be done.

If you open an issue on GitHub we can continue there. Cheers!

Almost! Except if you want to store objects/arrays/numbers (localStorage only supports strings), or want your site to work in Safari Private mode (where localStorage breaks), or if you have to support legacy environments with old browsers (like many government services), etc etc etc :)

I don't know when WebSQL would be better than other storage alternatives, but yes, you could easily add WebSQL storage :)

The rationale behind the new architecture is to make it trivial to write new backing storages - see https://github.com/marcuswestin/store.js#write-your-own-stor... for a quick explanation of how you'd do that.

This is also true for adding new functionality, which sits "on top of" the storage (and is agnostic to whatever particular storage is being used). Here's a list of plugins that come out of the box: https://github.com/marcuswestin/store.js#list-of-all-plugins, and here is a quick explanation for how you'd write your own plugin: https://github.com/marcuswestin/store.js#write-your-own-plug...

Store.js was originally released on HN in 2010 :) https://news.ycombinator.com/item?id=1468802

It's live on tens of thousands of websites (like cnn.com!) and has seen lots of improvements over the years.

Store.js version 2 is a full revamp with pluggable storage (it will automatically fall back to one that works in every scenario by default), pluggable extra functionality (like expiration, default values, common array/object operations, etc), and fully cross-browser automatic testing using saucelabs.com.

Feel free to ask any questions! I'm going to sleep now, but I'll make sure to answer in the AM.

Cheers!

ASAPP - asapp.com/adventure - NYC ONSITE

Reinventing human computer interaction, starting with customer service.

What do the best software engineers, PhD's in Physics, Mathematics, Computer Science, and industry designers have to do with customer service? Everything.

Our short-term mission is simple: Make customer service awesome for consumers, and cheap for companies.

How? We have found a hidden opportunity. It allows us to reinvent a tool used by every American today, save big American companies hundreds of millions of dollars per company per year, and (most importantly) lay the foundation for revolutionizing all of human-computer interaction in the long term.

Our short term plan lays out concrete steps for radically improving large companies' customer service in the immediate future. This plan stands to create a viable and huge business by itself. However, that was never sufficient to truly intrigue us. We are tackling this problem today because it gives us the three things required for our long term vision of seamless human-machine interaction everywhere: Immense amounts of labeled interaction data (e.g text conversations, voice recordings, etc), world-class NLP expertise, and revenue to fund it all.

More details: https://asapp.com/adventure

I think this is a great and well intended effort.

One of the biggest use cases for Javascript is to manipulate and create DOMs. jQuery solved the manipulation part beautifully, but DOM creation remained a hassle. Lots of templating solutions have been attempted, but none of them seem to hit the sweet spot just right (that's a primary reason why there are so many).

JSX is a novel contender that may be just right - even if it's not, it will hopefully push us as a community towards a better solution by offering a very new approach with its own benefits and problems.

Thanks to the peeps at fb for taking the time and effort to make JSX bigger than just reactjs!

I also said:

(and with all that said, the most important thing to consider is this: what tool will best allow you and your team to build and maintain your intended product?)

I'd defend the statement you quoted like this: all languages are type. Dynamic languages simply have exactly one expression type, "any". Specifying multiple types affords you strictly beneficial abilities. Static type checks is probably the most significant. Performance improvements and highly specific and accurate code editing assistance (e.g auto suggest) can also be significant.

But yes, you're absolutely right. Nothing but sincere effort, lots of practice, and critical thinking can make you a better programmer.

At the same time, a great carpenter becomes even so much better with a properly weighted hammer and an accurate lever.

:)