Everybody lies @ PHP.FRL

Everybody lies @ PHP.FRL

This talk is about browser sniffing. And yes, I do realise it is 2016. I know browser sniffing is ugly and we should all be using feature detection and build our front-end code to be more resilient. But there are legitimate uses for browser sniffing. We will dive into history and show the origin of the user agent string and the hidden battle between browser makers and web developers. We will see its simple beginnings and the horrible monstrosity it has become. And of course why building a browser sniffing library is difficult to do right. But when creating WhichBrowser - my own browser sniffing library written in PHP - I’ve also encountered some other technical challenges. We will talk about code coverage and testing without PHPUnit and a bit about using Travis for continues integration. And finally how I improved the performance by 400% by creating indices for the data files. This proved to be a challenge because the data files didn’t contain just strings, but also regular expressions. And how do you build an index for regular expressions?

De023a9aff4c7a5ede3a81e8c76f17b5?s=128

Niels Leenheer

August 23, 2016
Tweet