Hacker News new | ask | show | jobs
by worldsayshi 1866 days ago
Curious: Is there some reasonable way to guess if the device should be considered low spec?
2 comments

Not with any reliability, as it is a subjective matter (different users will want to make the utility/performance compromises in different places) and even if you manage to smooth the subjectivity out of the equation there are other variables over time (if you test performance now and decide to use the full-fat function as the current device seems fast, heat or battery concerns might cause the device to slow right down in a few minutes time). Same for network related limits - your application could start while the device is on a wireless AP connected to a decent fibre link so have significant bandwidth and relatively low latency, then the user immediately walks next door out of range of that AP and the device resorts to whatever 4G (or worse) link is available in the area.

A better approach might be to simply let the user choose. At the start either default to one version (full fat or basic), or give the user a choice up-front, and make it easy to switch later. Perhaps do a quick test and warn the user if they pick the setup intended for high performance on a device upon which it might be slow, or recommend switching down if things get problematical later.

I'm not sure whether you meant guess from JS or just guess.

In the second case, reasonable, and "should be" and "considered" are all value judgment words that you will decide yourself if there's a fit for you. So if you meant how can someone judge a phone, you'll have to decide for yourself, because that's the only way you'll feel satisfied with your particular definitions of reasonableness, consider, and should. If you insist on discussing it with other people I think it would be an easy way if you wanted to spend a bit of time arguing about those definitions and which one you personally feel is right, or getting even more meta you could probably try to start a long-winded argument with people by suggesting that these words have no subjective judgment definition but are in fact truly objective. But I think all that's kind of pointless so of course I wouldn't waste my time arguing any of that. ;) ;P xx

If you meant, case 1, guess from JS, you can get the memory and the number of cores from the deviceMemory and hardwareConcurrency properties of the navigator global object. While i think that's probably not sufficient I think it's a start and you could always research more for yourself if you were genuinely curious about this.

If it's case two you don't need to be afraid to make a choice, just look at it and make a judgment about whether you think it's low spec or not.