Jake based this article on the work he did on our offline HTML5 mobile app ( http://m.lanyrd.com/ ) - doing offline right is surprisingly trick and full of edge cases, and I haven't seen them documented in as much detail anywhere else.
> GOTCHA #8: REDIRECTS TO OTHER DOMAINS ARE TREATED AS FAILURES
So are redirects to your own domain, though not quite the same as here. What it means that while downloading the resources specified in your manifest file, encountering a 302 means that the entire applicationCache fails. Downloaded 99 static files fine, and then get a 302? Congratulations, your cache is now invalid.
> GOTCHA #9: AN EXTRA HOOP TO JUMP THROUGH FOR XHR
> You can make XHR requests to cached resources while offline, unfortunately older versions of WebKit finish the request with a statusCode of 0, which popular libraries interpret as a failure.
Not that much older. This is the case for iOS5.1, the last time I checked, and for every Android phone I've tested this on as well.
Yeah, redirects to manifest entries makes the cache fail, but a 302 on a page the user visits (which is covered by a FALLBACK rule) is fine as long as it's to the same domain.
As for GOTCHA #9, I thought that was fixed in iOS4. But yeah also fails on Blackberry playbook and Andorid 3 & 4. Actually works on Android 2.3 (unless I'm mistaken), which isn't suprising as there are loads of regressions in the Android 3 browser.
We do mobile web development, and we like to scale down images to the appropriate size for any given phone. I was hoping to be clever, and instead of redirecting every user to a hardcoded image path (/illustration.17.503x302.jpg), to just redirect them to /illustration/17 - which would generate the properly sized image, and use a redirect to display it.
Spent a few days on it. Worked great online. Then I discovered that putting /illustration/17 in the cache manifest made the entire thing fail, since it's a redirect.
Bah. Nice idea though. So far we're using a double-sized sprite image whether you're on a high dpi device or not. Thankfully everything that supports appcache supports background-size, and the 'waste' of serving high-res sprites to phones that couldn't use them was negligible (it's basically just http://static.lanyrd.net/css/mobile-web/img/sprites5@2x.53a3...).
Most of the images we serve are loaded from a different server, and can be dynamically changed by editors, etc. Putting them into a sprite would probably be more work than it's worth.
Well, why not return the proper content right away instead of redirecting? 'Course, you'd have to mark it with a private cache policy to prevent caching proxies from weirding things up.
You can use X-SendFile (or X-AccelRedirect) to have your PHP code tell Apache or Nginx which image to serve, without having to send a 302 to the browser.
Appcache is an app packaging mechanism, and should be treated as such. The manifest is the equivalent of a plist or xml file describing the app package. It actually makes a lot of sense when you view it like that. By extension, you should only put stuff into appcache that you would put in a native app bundle.
I've built an appcache app that is a bunch of static javascript (in the CACHED section) contacting a bunch of services in the NETWORK section. There is no FALLBACK section, because any resource is either online or offline, but never both. The UI is designed so the user knows which content is online, and can decide for themselves if they have good enough connectivity. Dynamic content goes into localstorage if it needs to be persisted. This way of using appcache works very well and is mostly painless.
I was going to comment on the same line! It's very easy for articles like this to come across dry, but writing that lets the author's wit shine through helps pacing significantly, almost like comic relief after a tense moment.
> GOTCHA #3: THE APPLICATIONCACHE IS AN ADDITIONAL CACHE, NOT AT ALTERNATIVE ONE
This section is not quite true, at least for WebKit. This article states that the application cache will use the normal browser cache when making outgoing requests, honoring whatever cache control headers were sent by the server. What actually happens is that the browser always forces a revalidation of the content with the server, regardless of what the cache control headers that had been served.
Now, I certainly /wish/ it were the case that it honored the normal browser cache, but it simply doesn't. The result is that the application cache makes these outgoing requests painfully and arduously one-at-a-time, waiting for the previous one to entirely complete before making the next one... over a mobile data connection this takes /forever/, and it is quite possible that it simply does not finish by the time the process is aborted by one of these needless server requests failing or the window being closed.
Normally, you can mitigate these issues by sending files with "cache this effectively forever" headers and always using unique filenames, but with the application cache manifest system (which you are going to be using to support guaranteed-consisten offline operation) you are forced to wait for every request to resubmit before seeing the update.
Here is the code from WebKit's ApplicationCacheGroup.cpp, where you can see "max-age=0" being sent as Cache-Control for the outgoing requests. (Sending that header as a user-agent serves to "force any intermediate caches to validate their copies directly with the origin server", per RFC2616).
I don't think this is the case, not in Chrome anyway.
See http://www.youtube.com/watch?v=q7QL0NAwES8 - All files are "must-revalidate" except the JS file which is far-future cached. When the manifest is changed an update is triggered, all files are updated except the JS file, which is assumed to be fresh because of the far future expiry.
You see similar behaviour when no caching headers are served, heuristics take over & files may be updated from the normal browser cache rather than going to the server.
I will then be much more specific and say "MobileSafari". My mobile application is part of an iOS application, so I only use and care about MobileSafari as a target. I definitely am quite careful with my Cache-Control headers, and am documenting this not just with logs but with WebKit code.
(edit/clarification: While I get this code from the WebKit repository, I forgot that the specific area of WebKit I'm looking at is WebCore, so I should really be calling it WebCore and not WebKit, considering they are separate libraries and quite separate projects on some platforms.)
Someone else I know (who may or may not decide to actually chime in) saw this interaction and decided to do some tests with various browsers, stating that 1) Safari worked as I said, 2) Firefox refetched the request but did not set the Cache-Control header, and 3) Chrome worked as you say.
Confirmed! Interesting. Safari on OSX and iOS makes the request regardless. Firefox didn't request the far-future file, but also didn't request one of the must-revalidate files. Not sure what it's doing. Good spot.
Interesting read and nicely written. It's just a shame HN doesn't have a 'report' feature like Reddit, as I can't report all the whiners in this thread as douchebags.
"Douchebag" is gendered, I guess. It's not clear to me that it's sexist. In common usage, it virtually always refers to a man. The actual relation to a "douche" is mostly vestigial.
I think you have to let this one go. Fighting against linguistic churn as a proxy for "sexism" seems to me like it hurts more than it helps, as it feeds the "PC feminazi" meme. There are better fights to pick than this one.
Seems like its use as a nickname/insult really exploded in the 70's and 80's. I'd tend to agree that tying the word to sexism is a bit of a stretch--it's probably just being used because it sounds like a naughty word, and anything more explicit or profane wouldn't get past the censors.
I agree with the bad choice of the word "douchebag", which seems juvenile, but I disagree with it a) being sexist, and b) the general idea that swear words are somehow generically "childish" or "unprofessional". It's puritan approach to language, and largely an American issue. In fact, I would call that particular attitude "childish".
There's nothing inherently wrong with swearing in an opinion piece.
I agree that these words have no place in a professional working environment. But I still read articles with bad words. (Actually, it's why I clicked on it in the first place!)
I actually upvoted both of you -- I mean I upvoted your long list of swear words and point that they are intended to offend and also upvoted his point that they don't really have a place in a headline. I swear like a sailor IRL but I try to keep most of my online remarks pg-13-ish. It seems rude/ disrespectful and a good way to lose part of the audience to be unnecessarily crude.
I oftentimes volunteer at my local high school with the web development classes and always make it a point to direct the students to review alistapart as they have excellent articles. I've always assumed alistapart had editors that keep the content top notch and "accessible". I was surprised this morning to see this title was real. I'm not pretending like American high schoolers don't use this kind of language but seeing it in a highly respected "magazine" of sorts made me squirm. I'm glad I wasn't in a classroom this morning.
Yes, it is something I have thought about quite a lot and concluded that being too prissy tends to not have broad appeal but being unnecessarily crude is just stupid if you are trying to grow an audience.
I have fantasies of doing a web comic at some point. Should that ever work out, the standard I have in mind is that it should be "Night Court"-esque in nature. In spite of frequently having "adult" themes it was implicit, not explicit, in nature. My 24 year old son has said that when he watched "Night Court" as a child, he thought Dan was some loser who talked a lot of crap but saw almost no action. When he saw the same show when he was older, he was surprised to realize that wasn't the case at all. Why was he even able to make the comparison? Because the show was acceptably "clean" that I did not hesitate to let a young child watch it. That translates to a much larger potential audience than the "adults only" material.
And who defines swearing? You? Me? Marilyn Manson? I think a lot of people would be surprised to learn that "douchebag" is particularly more rude than "stupid," which you apparently have no problem using. At least that's my impression from the way people tend to use it (and it seems to be pretty near ubiquitous with people my age and younger in the area where I live).
pavel_lishin brought up a great example above: sucks. To most people under the age of 30, it is categorically not swearing. It is not even slightly naughty. It's informal in much the same way that "totally sweet" is, but it's not dirty. But many people older than that will insist that it's swearing. True story: Once, when I was working on my college paper a few years ago, we used "sucks" in a headline. The faculty adviser flagged the headline and questioned whether we wanted to use swearing there. Every single student there was baffled by what she meant.
I think you missed my point somewhere. I swear quite a lot. But a lot of people are easily offended by words that wouldn't bother me. A standard some prostitutes use is to wait until their client tips their hand as to what sexually explicit words to use. Some men think "dick" is perfectly acceptable but "cock" is foul language. For other men, the reverse is true. So, yes, I think if your goal is to grow an audience, you are behaving stupidly if you do not stop and think about what kind of language will likely get negative reactions.
I am aware that words like "retard" or "stupid" can be just as problematic as words like douchebag, cock, or dick. But in this instance, I think it conveys what I mean better than any other word I could use. I am not against the use of strong or loaded words on principle. I just think unnecessary use of such language is a good way to shoot yourself in the foot. I can't imagine someone wanting to lose audience members or even risk losing them without good reason.
I am guessing you didn't read my blog post on the topic. That might explain why I am baffled by your reaction.
This is an incredibly mild insult in common usage — on roughly the same level as "jerk," I figure. What word would you have used to convey the same idea? I can't think of a less offensive choice.
I agree that it's a mild insult in common usage but I don't consider A List Apart to be common. I consider it to be top-notch and on par with leading print publications. I feel like if I opened the any well-respected periodical I'd be off-put by a similar title. "Nissan Corp is a Douchebag". Sounds silly, doesn't it? It felt like it was a cop-out to be edgy for edgy's sake.
One of the tickets in our tracker is titled "Appcache Sucks". My boss actually e-mailed me Jake's article with the e-mail subject, "Sounds like something Pavel would write."
We use naughty words here at work, and nobody gets their undergarments in any sort of embedding of the circle into three-dimensional Euclidean space.
"Most professionals" live and work within ten miles of this: http://www.youtube.com/watch?v=z5MGJ87hPGw. If you worked for me and weren't comfortable with this kind of diversity, I'd cap your ass. Period.
Tech culture keeping it realer every year. Throw down some rude JS or get your app-cache timed out. That's the way we live and die in the 415, neighbor!
You know what's douchebaggy? It's the trend I've noticed where invariably someone says: Blah Blah Blah, I'm so professional, blah blah blah, I'm a boss|manager|startup founder|etc blah blah blah and I'd fire you for this.
Edit:
Seriously, the person with the potty-mouth might be an awesome developer and you'd be an idiot to not hire or fire them for being a little non-PC. The swearing at least indicates some level of passion for their work, which is most likely a good thing. Personally some of my best work was done on projects where I alternated between the occasional, but rare, out-loud 'fuck yeah!' and 'fuck you package x, why do you have to be this way?!'
Swearing in a conversation is one thing; Not having the common sense not to publish something you took the time to sit and write & presumably reread and edit is another.
Guess what? There are lots and lots and lots of awesome programmers out there. We don't have to chose the immature ones to work with.
whose 'we'?. I'd rather work with someone a little colorful over someone who is dull, all other things being equal. I'd even rather work with someone who occasionally made me wince, or feel uncomfortable as long as they had offsetting high points.
Odds are he'd probably regret the title later, all on his own, and really that's more than enough. Or maybe not- he based the title off his opening story, which I found amusing. Hardly a fireable offense, not even worth a reprimand really.
Sweet, let's unabashedly support more sexism! That's what the tech industry needs.
Somehow, an article describing caching of web applications manages to denigrate women, for no reason.
The underrepresentation of women in tech is caused by this mindless sexism, like body-shaming women. Douche bag is a sexist insult. You're insulting your target by associating them with feminine care products. It's a direct associating between "This thing is womanly so it is bad." Even after several other stories these digs at women still get publicized!
Funny, I am female and it never crossed my mind that this was sexist and denigrating to women even though I view "bastard" as rooted in the denigration of women (edit: ironically, since it is almost always aimed at a man) because it suggests your mother did something wrong rather than that you did. I always think of "douchebag" as an ugly remark similar to "scum of the earth" -- in other words it calls up the idea for me that it is undesirable disgusting waste products, akin to saying something is "shitty", basically.
At the core of this argument is the idea that the "popularization" of act of douching itself was itself anti-woman, insofar as it categorised normal women's bodies and actions as unclean and shameful, and in turn advocated an unhealthy "solution" to a problem largely invented by the patriarchy.
Nevertheless, I cringed ever-so-slightly when Jake gave this talk at JSConf and again when I saw it here on HN, because I knew that in recent months, among all the other salient gender issues that have been floating about, a bunch of people also "heard douchebag was sexist," and so would lodge this reservation.
He's certainly not making the point that douches were invented to shame women. He's using the negative association of what douches are for. You seem to be making a "taking it back" argument when he clearly did not intend that meaning.
Not using douchebag is easy! Step 1) Just Don't! Now you won't have to deal with causing strife with women in tech.
>He's using the negative association of what douches are for. You seem to be making a "taking it back" argument when he clearly did not intend that meaning.
Modern medicine considers douches to be dangerous to use. Not sure how making a negative of something that is, in fact, negative is a bad thing.
Can we please stop with this campaign to end all grit in online conversation? We should not get rid of every expression that somebody somewhere finds hurtful.
I don't think it's reasonable to say that people shouldn't use the words "douche bag".
Why do you personally care so much about my buried comment that you had to come in here to defend the use of douche bag? Is saying douche bag really all that important to you?
Of course it isn't. But it's part of a larger culture you have a vested interest in maintaining which is why you need to defend it.
Defending douchebag is about defending the right to be carelessly and callously offensive without needing to think of others in the community.
Or it's a freedom of speech thing, -or- its feeling some sympathy for a guy whose writing style tries to be somewhat creative, certainly not dry, and probably didn't expect, and doesn't deserve accusations of sexism, etc.
Yes, the version of free speech where you need to feel free to say whatever you want without concern for how it might impact others or make your own community hostile to entire swaths of the population.
Because if I want to be a careless, self centered, unsympathetic human being then that's my right and how dare someone point out I might be harming others!
And the author did expect those accusations which is why in his blog comments he links back to month old comment of his on hackernews where he defends his right to be offensive.
Based on your argument, calling someone a dick would be sexist as well. I'm not arguing that the author is right to use douchebag; he was trying for entertainment value but to me it came across as unnecessary. But getting worked up because he chose the wrong insult out of the many, many insults we have relating to both male and female body parts and functions is silly. Calling someone a douchebag doesn't insult anyone else who uses a douche the same way calling someone a dick doesn't bother me everytime I use the restroom.
Based on your argument, calling someone a dick would be sexist as well
I reread my comment and I didn't call anyone a dick. I checked the article and it doesn't use dick either.
I suppose you're after some false equivocation here which means you don't quite understand how women are being actively repelled from the tech industry. Using language hostile to a minority group is exclusionary. "Dick" as an insult in a male dominated group is not.
I'm not arguing that the author is right to use douchebag; he was trying for entertainment value but to me it came across as unnecessary. But getting worked up because he chose the wrong insult out of the many, many insults we have relating to both male and female body parts and functions is silly.
It's the only way to encourage positive change. I see you'd prefer to ignore it, but that just perpetuates the hostile culture that has ingrained itself over decades.
He could have gone with anything (asshole for instance!) but chose to Other women and likely not intentionally, which is still no excuse.
You are free to ignore the sexism just as much as you were free to ignore my comment, but for some reason you decided to step in and defend the article from my negative rated comment.
>He could have gone with anything (asshole for instance!) but chose to Other women and likely not intentionally, which is still no excuse.
Which is insulting to donkeys.
EDIT:
The problem is that you need to pick your battles. His word selection, out of all the possible sexist terms was quite possibly the least sexist out of all the sexist terms he could have used. On the whole, considering that the sexism of the term douchebag is still an unanswered question, it's hard to find fault.
Profanity is intended to offend you. If you find it sexist and demeaning, it's actually doing the job it was intended for.
Below is a list of alternative curse words you can use instead of 'douchebag'. Please note that the great majority of them are sexist, racist, or religious blasphemes. If you have a list of non-offensive profanity we should use, please comment and i'll add them to the list with a special note.
And here I thought we were professionals and not children, but apparently offending peers in a professional setting is acceptable to you.
Also nice of you to cowardly admit that this stuff is inappropriate and hide it in a pastebin after you regretted posting it here. I'm going to leave your word vomit here. If you don't have the backbone to leave it in I think that just proves my point that it's inappropriate and should not be spread used in professional circles.
....so you think we should stop using sexually-offensive language but reposting an entire block page worth of it is hunky dory?
Honestly I pastebin'd it because it took up an entire page of screen real estate which is really annoying for everyone else to have to scroll past just for me to make a point. I had the "backbone" to pastebin it, so I don't see how not pasting it in-line makes me less-backbone-y.
Come now, lets not all be wichsers about this. The Edit feature is there for a reason, and the OP definitely had a good reason to edit his post. As do you.
professional is a relative word... if someone is a reliable coworker, does quality work, and isn't a douchebag then they've just met my definition of professional.
To be fair, the tone of the article was that of a conversation at an event/party, in which "douchebag" would certainly be used in, especially in the typical tech demographic.
That's the point. The typical tech demographic is hostile to women which is why you're mostly surrounded by men, which is why you feel these casual comments are normal. And the circle of exclusion continues.