Facebook never bet on HTML5
I'm going to jump into the mix, but my post is short and sweet. In fact, I wrote it while waiting for tests to run.
Facebook never bet on HTML5. Anyone remember the convoluted rambling of Dave Fetterman at f8 developer conference last year? I remember being both dumbfounded and confounded by it.
So, how does this work? Project FaceWeb is an extension of this progressive enhancement idea. So, instead of the phone saying I am rendering for a WebKit browser, we send an agent that says you are going to be rendering for a WebKit UI WebKit view inside the iPhone app. So, what you have to do is detect that, style a Web code to make that work, build a bridge between the things that you want to write to interact natively with the Objective-C, say in Javascript, then build HTML pages for Facebook in the iPhone. So, you build much smaller native goop instead of having to build over and over again.
...
HTML5 is probably the way that we should have done it.
Near as I can tell, Facebook invented their own PhoneGap (i.e., FaceWeb) and sent m.facebook.com to it, then FaceWeb changed webkit's rendering logic* to match m.facebook.com instead of changing m.facebook.com to a mobile HTML5 site? That's not HTML5 - that's just stupid.
* UPDATE: as pointed out in comments, this isn't exactly accurate. Faceweb does some funky stuff though, and their engineering manager in charge of the project couldn't even articulate what it is. So it still sounds like bad engineering unrelated to HTML5.
* UPDATE 2: You should read Matt Asay's analysis of Facebook's HTML5 fiasco. In fact, you should read everything Matt Asay writes.
phpunit travis ci undefined offset
or
How I learned to stop hating on PHP
TL;DR - "Undefined offset" is an E_STRICT level PHP error, and travis-ci.org uses E_STRICT+ by default. Put error_reporting( E_ALL ); at the top of your phpunit test suite to find and fix all your warnings and notices to fix Travis builds.
pHpaters
Today Laura and I chatted briefly about djangocon presenters bashing PHP. I mentioned that the Promote MDN code is some of my favorite code - in any language. As with my Zend_Rest code, the two keys I've found to writing good PHP code are:
- Use a coding standard
- Write unit tests
Coding Standard
I use Chris Adams WordPress Coding Standards for PHP_CodeSniffer to stick to that. It was amazing how much nicer the PHP code was when I took just an hour to clean up what I inherited from SEO Smart Links. The PHP community would do well to embrace, encourage, and even enforce coding standards more - the way the Python community does with PEP8.
Unit Tests
I write unit tests for Promote MDN too. My tests/doubles.php is hacky, but it Freaking Works™; I didn't have to build out a set of fixture data or couple the test suite to a running WordPress instance. Like WordPress, I just (ab)use the global namespace to (re-)define dependency functions with doubles.
I also took the opportunity to try out Travis CI. After fixing the travis.yaml and phpunit.xml files just right I got a bunch of test errors with the message "Undefined offset: 1" which frustrated me because I didn't see them locally. While we chatted about PHP, Laura reminded me about PHP's error reporting levels, and she was spot-on. I bumped up to E_ALL locally and got the same errors as Travis.
Error Reporting Level
I spent the next 10 minutes fixing my warnings and notices and realized - I should always use a higher error level in PHP. Python will rightfully gripe at me if I try to access a dictionary element by a key that doesn't exist. But PHP can be equally strict if I set my error level to E_STRICT or higher. So, I'm adding it to my list:
- Use a coding standard
- Write unit tests
- Set error level to E_STRICT
I really think these 3 practices could make any PHP code into good solid code. Instead of simply bashing on PHP, from now on I'm going to simply advise PHP dev's to stick to these practices - it's good for the developers and good for the community.
Mozilla & WordPress

TL;DR - I made the Promote MDN WordPress plugin and enjoyed it; why isn't(?) there a more intentional relationship between Mozilla & WordPress communities?
WordPress development
To make the Promote MDN WordPress plugin these last couple weeks, I've worked with WordPress more than I have in the previous decade. I've run dozens of sites with WordPress, but have never been active as a developer or contributor. Observations:
- Keep code tidy - Okay, so there's globals and no MVC. But I copied messy code from SEO Smart Links, ran it thru PHP_CodeSniffer and it was actually easy to follow and work with it, due to the ...
- Good docs - The codex has lots of good info. I Googled for stuff like "wordpress http get", "wordpress cache", and "wordpress i18n" and the codex docs always had what I needed.
- Can leverage Verbatim for l10n - After I made a .pot file for the plugin, I added it to our existing MDN project on verbatim. Within hours it was translated into Dutch, Polish, and German. Then a couple days later Brazilian Portuguese and Spanish too. I love our localization teams so much.
- Releasing is painful - It's exactly this painful. It makes me really love and appreciate our new chief deployment system on MDN, and heroku for my other sites.
- Releasing is cool - It's cool that the plugin is now just a couple clicks away from millions of users. The appeal of "app stores" I guess.
WordPress development at Mozilla
I coordinated a "WordPress at Mozilla" talk for an OKC WordPress User's Group meetup. When I asked about WordPress on Yammer, only Craig and Jake claimed to have WordPress dev and deployment experience at and for Mozilla. They say we have many dozen - approaching a hundred? - WordPress blogs & sites at Mozilla. In addition to that, we have:
- Mozilla Persona Plugin - Persona for your WordPress site.
- Open Attribute Plugin - Add licensing information using OpenAttribute from Mozilla Drumbeat
- WPBadger - Issue badges and add them to a user's Open Badges backpack.
- Promote MDN Plugin - adds links to MDN to your WordPress site content
Mozilla and WordPress
WordPress runs about 55 million websites in the world. 332 million people view over 2.5 billion pages on WordPress.com's hosted sites alone, where there are also 500k new posts and 400k new comments every day.
Which makes me wonder - does Mozilla have any official or intentional relationship with WordPress? Should we?
WordPress empowers people to make and control their own content on the web. (As opposed to, say, Facebook Pages) It seems like we could combine efforts in some cool ways. At the very least, many of our projects and websites could probably put together a cool and useful WordPress plugin of some kind. It's really not bad at all. :)
Firefox rapid releases: developers *are* users
Jono
There's a tempest brewing in the Interteapot over Jono's post about the Firefox rapid release cycle. I reacted the way he probably anticipated - "Good points that are already well taken." But tech media is sensational, so the story reported was "Firefox dev hates Firefox ZOMG!" prompting an official Mozilla Press Statement™ and a sincere face-palm from Jono.
Let me make something clear: Jono is one of my heroes. When he writes something, I read it. And when he writes how Silicon Valley culture has a monomaniacal obsession with hugeness, I read it so often that it's the first hit in my browser bar for 'le'. But I want to add another perspective to his main point - at least the main point he wanted to make.
The main point I wanted to make was about the distance between the developer perspective and the user perspective, the costs for users of updates (even good updates), and the reasons why developers (everywhere, not just Mozilla) may have trouble seeing updates from the user perspective.
Web developers
I'll emphasize that Jono means the Firefox developer perspective vs. the user perspective. Web developers are Firefox users. Working on MDN, acting as a developer evangelism rep, and running Tulsa Web Devs gives me some insight into the web developer perspective, so let me talk about them.
I've showed the new dev tools, HTML5, CSS, and JavaScript support to web developers and they are always surprised how much has been added to Firefox in the last year (i.e., the time they've been using Chrome.) Most of them make an opposite response to the one Jono describes - something like "Wow, I need to look into Firefox again." And I'm able to re-pitch, re-sell, and re-promote Firefox with "What's new in Firefox for developers" every 6 weeks rather than once a year!
In almost every one of these encounters, I also show web developers the Aurora release channel, and they love it. I tell them Aurora is Firefox, just 7-13 weeks in the future. (Because Mozilla has time machines) It gets new features like the awesome new responsive design view and javascript debugger even sooner, and it lets web developers see how their sites work in future versions of Firefox.
Here's the kicker: Aurora updates more frequently than Firefox does - and web developers love it! These are Firefox users. And importantly, they're usually "the people who shout the loudest about browsers."
So that's it. Just want to point out an important segment of Firefox users for which the new rapid release process is a big improvement. Jono knows this, but maybe some clueless tech journalist will pick this up and write a "ZOMG Mozilla web developer likes Firefox" article. Nah, not enough page-views.
UPDATE: Too perfect. Right after I published this, I got an update prompt from Aurora. ;)
tl;dr - If you get "permission denied" errors while trying to dd a raspberry pi disk image on your macbook pro, try blowing out your sd card slot to unset its "disk lock" switch. Seriously.
