5 ms·
I would guess the problem is that most sites are going to serve up a 404 in this situation, and handling 404s is a bit trickier, since they might be transient (
by smackfu 13y ago
I would guess the problem is that most sites are going to serve up a 404 in this situation, and handling 404s is a bit trickier, since they might be transient (like a proxy gets in the way, or the hosting service has temporary issues). So they just don't handle it, since polling a server and getting a 404 is going to work well enough for most use cases. Maybe put a little exclamation point next to the calendar or something, but still poll it.
And then they handle a 410 the same as a 404, even though a 410 has very little chance of being transient. It's just rare enough that they don't even realize they don't support it properly.
- Wilya 13y agoI'd wager 99% of codes have a big if(200) { // Do stuff } else { // Try again later } Actually, a bunch of them probably don't even check for response code. Edit: If dataaccessd is really the iOS native CALDAV integration, that's a bit annoying. Of all people, they should be able to handle that correctly.
- pyre 13y agoif(200) { // Do stuff } else { // Try again later } That's like an "idiot-filter" interview question. "Is the following code valid?"
- jimbobimbo 13y agoThis is a very interesting observation! I imagine, there could be a great conversation derived from this seemingly easy question.
- Groxx 13y agoSeems like it should be paired with a "Is the following code useful?" about code which specifically handles every error code listed here http://en.wikipedia.org/wiki/List_of_HTTP_status_codes http://en.wikipedia.org/wiki/List_of_HTTP_status_codes and contains code to handle unlisted ones. Then "where do you draw the line?". Sometimes if(200){}else{} is plenty.
- pessimizer 13y agoThis is a silly objection. Not every code merits specific handling because there are groups of codes that merit the same handling. if(200){...}else{retry} is never plenty.
- Groxx 13y agoAssume it only queries your server. Assume your server will only ever meaningfully return 200. Assume the method has no reason to ever move (so no 301 redirect (edit: and redirects are generally handled by your request library anyway)). Assume the only time it should fail is if your server falls over on itself, which should be temporary. What else would you do then? These are not crazy expectations. Exponential backoff might be reasonable, but I'd argue that's part of "else{retry}" since it's inherently retrying.
- derefr 13y ago> These are not crazy expectations. Sure they are. Choosing to communicate over HTTP means allowing for the presence of proxies between "your" client and "your" server. In HTTP, you don't control the whole path, even if you control both sides.
- Groxx 13y agoProxies are also fuzzy. I assume you're referring to e.g. a 407 or 511 error? Many times they're handled by something between you and the network library, often the operating system. Sometimes they're not handled at all at the system level (hooray, Android (until recent versions)!), so if you didn't put a proxy in there, you don't have one. VPNs can also exist, but they sometimes send custom error status codes[1]. How do you handle those? Retry if `code % 3 == 1`? Will your program even be informed if the VPN connection is restored, or will you have to just blindly retry until it works? [1]: http://compnetworking.about.com/od/vpnsetup/tp/common-vpn-error-codes-explained.htm http://compnetworking.about.com/od/vpnsetup/tp/common-vpn-er...
- pyre 13y ago
- dylangs1030 13y ago"What port does ping work over?"
- pyre 13y agoDepends on the position you're hiring for. I imagine a lot of smart people might not know the answer to this because they've never really thought about ICMP or the OSI model.