Navigation
Main | MAIKit: A Framework for Sharing Code Between iOS and OS X »
Monday
Jul202015

The Web Ascendant

The following story is a work of fiction. The setting is entirely hypothetical, and the opinions expressed by the characters do not reflect opinions held by the author.

Five to ten years in the future.

Rob strolled into the office at 8:35 AM to find a bleary-eyed Sai sitting in front of his computer, muttering expletives under his breath.

"Morning," yawned Rob, as he took a seat at the desk next to Sai's.

"Good morning," Sai grunted, not taking his eyes off the screen. Rob peeked over Sai's shoulder to find him issuing terminal commands, rooting around in Chrome's local storage folder.

"What's up?" Rob asked, a hint of concern in his voice. Whatever it was, it couldn't be good if his lead developer was mucking with the terminal.

"I got hit with a nasty popunder." Sai said, running his hands through what was left of his hair. "And it kept spawning new windows and alerts so quickly that I had to force-quit Chrome just to make it stop. I haven't seen popups this bad since before popup blockers. Problem is, every time I launch Chrome, it re-opens that window and the process starts over again, so I'm trying to retrieve my source files before blowing away Chrome's local storage and starting fresh."

"That sucks man. Remind me never to browse the Web with the browser that runs my IDE. You know, if they ever let me escape this hellhole called middle management."

"That's the best part, I wasn't. I was browsing in Firefox, and the popunder injected code into Chrome to spawn itself there."

"For real? That must be some exploit."

"Not even. Support for Web-IPC landed in Firefox last week, and it's been in Chrome for a couple of months now. Firefox just sent Chrome some Javascript to execute, and Chrome happily went and did it! I've seen some stupid Web standards, but this one takes the cake. It's not enough that my browser automatically executes any code it comes across when I surf the Web. No, now all my other browsers have to execute that code too. Process isolation, what's that?"

"You know," Rob interrupted, before Sai could spew any more clichés, "maybe you shouldn't browse those kinds of sites at work."

"What kinds of sites?" Marie asked, returning to her desk with a full mug of coffee.

"It was just Stack Overflow." Sai protested. "And none of your suggestions so far have been helpful."

"Fair enough," Rob said. "Shouldn't the files all be backed up on AWS?"

"You would think so, but there was a massive BGP attack earlier," Sai explained. "Worst case, the files are now stored on the attacker's server."

"That might not be so bad," Marie joked. "Maybe we could ask the attacker for our files back."

"No need," Sai replied, still typing furiously on his keyboard. "I think I've pulled out everything–Hey, check it out, one of these popups contains a Bitcoin miner. That takes me back."

"What's Bitcoin?" Marie asked.

"It was the first cryptocurrency," Sai answered. "When you were busy mining redstone, Libertarians were mining Bitcoin to buy drugs and take out hits on people over the Internet. It's completely worthless these days though."

"I'd have retired by now if it wasn't for the Bitcoin crash," Rob added.

"This thing is using an ARB_compute_shader," Sai commented. "That should give you an idea of how old it is."

"Joke's on them", Rob laughed. "These brand-new Macbook GPUs still aren't as powerful as the PC GPUs that were common 10 years ago."

"Sounds like the joke's on us," Marie observed. Meanwhile, Sai had finished extracting his files, had cleaned Chrome's local storage, had reloaded his IDE, and was now in the process of copying and pasting source code from the retrieved files into the browser.

"I never thought I'd say this, but I miss Xcode," Sai murmured.

"At least it beats Eclipse, eh?" Rob quipped. "What a piece of crap."

"At least Eclipse never did this," Sai said, pointing to the screen. When Marie and Rob leaned over to look, Sai hit Command-V a few times, and each time he did, an advertisement for diet pills was pasted into the window.

"Check the updates tab," Marie instructed. That tab usually contained the IDE vendor's blog, but today it sported the message, "DEFACED BY DARC FORCEZ" in large red text, and was crammed full of non-worksafe advertisements. After Sai closed it, copy and paste once again worked properly, and he was able to get back to work.

"Why do we even allow random Web pages to write to the clipboard?" Sai asked frustratedly.

"It's useful in a number of situations," Marie asserted. "Besides, native apps can do it. If Web apps couldn't, they wouldn't be as powerful as native apps."

"But shouldn't the Web browser ask for permission first?" Sai asked rhetorically.

"If Web browsers had to ask for permission to automate every little thing, regular users would be scared off," Marie stated. "Remember when Web pages had to ask for permission to use local storage? Most users were intimidated by the dialog and denied permission, and then complained when they couldn't save files locally."

"But the code executes in non-app contexts," Sai protested. "The Web is for more than just apps."

"Not this again," Marie goaned.

"People browse regular Web pages all the time," Sai continued, "and these days, pages all execute code with the full permissions of a native app, without the user having any control. You can't even browse with Javascript disabled, since most sites don't work without it."

"That's been the case ever since Javascript hit the scene," Rob pointed out. "Graceful degradation has always been a pipe dream. It's not worth the extra effort to support those few who browse without Javascript."

"All I'm saying," Sai said through gritted teeth, "is that maybe we shouldn't have tried to force all the functionality of native apps onto the Web. It may have made the Web a better app platform, but it also made the Web a decidedly worse browsing platform."

"We all know how much you love native development," Marie chided, "but single-platform development hasn't been economically viable in years, and I can't think of any other cross-platform runtime advanced enough or important enough that every platform vendor is forced to support it."

"Fine," Sai sighed, "maybe we need a new, more restricted runtime for browsing then."

"And where do you draw the line?" Marie pressed. "Hyperlinks and forms provide enough interactivity for basic mail readers, message boards, wikis, and many other traditional mainstays of the Web, but each of these applications benefit from the greater interactivity provided by Javascript."

"They also suffer for it," Sai maintained. "I'm not sure where you draw the line, but there has to be something better than what we have now."

"What were you working on anyway?" Rob interrupted, trying to steer the conversation back to a productive topic.

"I think we've got a memory leak on the server," Sai said, "but I can't track it down. I can see the leaked object in the heap dump, but I can't figure out why it's still being referenced."

"Try the memory profiler?" Rob suggested.

"It doesn't work anymore," Marie answered. "They redesigned V8's garbage collector a few months ago. It's a lot more efficient now, but it doesn't work with the memory profiler yet. And before you ask, we can't run the code in an older version of V8, since we're making extensive use of newer features."

"Besides, the memory profiler never worked reliably," Sai added. "At least, it never worked as well as the Leaks instrument. I really miss having that much detail. No, what I really miss is having decent tools to solve problems like this."

Rob could sense another argument brewing between Marie and Sai, and moved to cut it off before it could begin. Javascript was Marie's first programming language, she was very good at working around its weaknesses, and she still felt that rush that came with writing working code. Rob remembered feeling that way about Perl 30 years ago, and he suspected Sai once had similar feelings, but those feelings caused Marie to be defensive of her favorite language, which didn't mix well with Sai's cynicism.

"Bah, back when I was a Perl hacker, we didn't have any tools to detect reference cycles, and we were just fine," Rob bragged. "One time I even worked around a reference counting bug by storing an object as a string and deserializing it when I needed to use it."

"Oh, I've heard about that bug," Sai said with sarcastic enthusiasm. "They're going to fix it in Perl 6."

"Nice try, but Perl 6 was released years ago," Rob shot back.

"Really? I'm not sure anyone noticed," Sai huffed. "Fine, Perl 7 then."

"Don't even joke about that," Rob protested good-naturedly. "Anyway, how bad is this memory leak? We've got a new P0 that's causing the CEO to throw a fit."

"It can wait," Sai answered, logging into JIRA to check the new bug.

"This bug is hilarious," Marie said dryly after a couple of minutes. "Some jerk took out an ad with our ad provider that targets us specifically. It injects code into our site that hides all our advertisements and replaces our file selection screen with a rant how much our app sucks."

"So we just need to get the ad pulled?" Sai queried. "Why is that a job for engineering?"

"We can't get the ad pulled," Rob explained, rubbing his temples, "the ad exchange is fully automated, so there's nobody we can contact to get it pulled. Curated ad exchanges don't pay enough to keep the lights on. Hell, the even the uncurated exchanges barely cover our hosting costs."

"Even with our massive user base?" Marie sounded confused. "Then how do we make any money? I thought those ads paid our salaries."

"Same way all consumer software companies make money these days: VC funding," Rob replied. "We're hoping to attract enough users fast enough to get bought out by one of the tech giants. The CEO's more worried about the damage to our reputation than she is about the ad revenue."

"So this whole industry is funded by…" Marie began, a disgusted look on her face.

"Yes," Sai smirked, "It's funded by investors trying to siphon money from other investors. We're just the ball in a game played by these investors, and we're lucky enough to take home a salary as long as we remain in play."

"What choice do we have?" Rob chimed in. "The bottom fell out of native apps, users have never been willing to pay for Web apps, and ads just don't pay like they used to."

"There have to be other business models," Marie pleaded. "After my internship is over, I'm sure I can find a company that makes its money from its customers."

"Then I hope you enjoy writing crappy enterprise software," Rob said.

"Forget it," Marie said. "Let's just get this bug fixed."

"This never would have happened with a native app," Sai muttered.

"It's not that bad," Marie countered, trying to bring some cheer and perspective to the gloom that now hung over all three of them. "We just have to patch the XSS vulnerability."

"I should never have put all my savings in Bitcoin," Sai lamented, ignoring her.

"You and me both," Rob commiserated. "You and me both."

 

PrintView Printer Friendly Version

EmailEmail Article to Friend