Skip navigation

Category Archives: Code

Stuff that is directly related to coding.

There has been a recent outcry from many users of Firefox when it was learned that developers implemented the ping attribute for the a element. Personally, I think people are overreacting, and I hope to present a list of reasons why this is a good thing as opposed to the ‘evil’ thing that many are portraying it as.

For background information, this attribute is spec’d out by WHATWG, who, as stated on their website, are “a loose unofficial collaboration of Web browser manufacturers and interested parties who wish to develop new technologies designed to allow authors to write and deploy Applications over the World Wide Web.”

The ping attribute is supposed to allow tracking of what links a user clicks on. Now, many might say “Woah, I don’t want my clicking to be tracked!” However, I can assure you that many websites already do this. The catch is that they don’t exactly inform you that they are doing it. The idea of this spec is to make this easier for developers to do, but at the same to have User Agents (i.e. browsers) give the user options. The whole spec can be found here, but in summary, the benefits of this attribute to the user are numerous.

  • It will allow the user to see the final target location plainly
  • It will allow the user to disable the notifications without losing the underlying link functionality (many methods that currently accomplish the same goal will break if the user disables javascript)
  • It will allow the browser to send the ping when the user isn’t actively loading a page so that the target page loads faster

Maybe it’s just me, but it seems to me that this is a good thing. By making things easier for developers, they’ll probably use it (especially once a few other browsers pick it up), and by doing so give the users more control over their privacy. It seems as though most people just pick out the fact that it is now easier for websites to track where you are going, and are completely overlooking the fact that it gives the user a lot more control. Even with this though, I think most people probably won’t care, but will get the added security of easily knowing when they are being tracked. For me, that is significantly better than the current situation on the web.

So, while coding today I came across a very strange bug in PHP. It seems as though subtracting two arrays will return null.

However, if I wrap that in the floor() function, it works as expected.

Go figure. Took me 30 minutes to find that annoying bug.