I recently gave a brief overview of my permanent disability and workers’ compensation benefit calculators. In that post I wrote a little bit about how my online benefits calculators work. My last post in this series was about how and why these permanent disability and workers’ compensation benefits calculators use javascript.

I had tried Microsoft’s ASP (active server pages) in experimenting with a prior version of my permanent impairment calculators, and while functional, the coding was a complete mess since I didn’t fully understand what I was doing. To make matters worse, the only manuals on ASP I could find gave examples using VBScript – which is MS’s version of javascript. ((Can’t we all just get along?))

Just over a year ago a friend of mine encouraged me to try PHP. (Thanks Johnny!) Its syntax, the way in which you write code, is very similar to javascript and was fairly easy to learn.

Unlike javascript, PHP is run only on the web server. There are a lot of benefits to moving all of the calculations from being performed by a user’s computer to my web server:

  • Uniformity. All calculations will always be performed by the web server in the same exact way – irrespective of the user’s computer.
  • Speed. Since all calculations are performed on the web server, the user’s computer doesn’t need to do any number crunching.
  • Protection. All of the formulas, tables, and magical incantations used to generate the calculations are kept only on the web server.

But, PHP isn’t without its downsides:

  • PHP is being used to perform a calculation, even when javascript would be faster. Javascript takes longer to crunch the answer, but you have to “wait” for PHP to send a request to the server and wait for the answer. ((I say “faster,” but we’re talking about the difference between 10 milliseconds for javascript to calculate the answer and waiting 400 milliseconds for the server to return the answer.))
  • A pure PHP calculator would require the user to send the web server the entire page and wait for a whole new page to load. Every calculation would take a full second or more using a pure PHP calculator. ((A second might not seem like a long time – but it is when you’re using a computer. I’d bet that if these calculators took 1 second for everything (such as finding an occupational code or work restriction) no one would use them.))
  • When PHP is used to perform handle all calculations, there is more of a strain on the web server itself.

Using AJAX (more on this later) to create workers’ compensation benefits calculators has allowed me to take advantage of all of the strengths of javascript and PHP and minimize the negatives of these technologies.

Next up, AJAX!

So, it looks like the only phone thus far that can use these calculators is… the iPhone. Don’t blame me – blame every other cell phone maker out there. I played with an LG Dare again a few days ago and was disappointed with its web browser this time.

I’m sure its a great phone. But, let’s be real, that’s not good enough any more.

Pros:

  • Touch screen
  • Virtual QWERTY keyboard
  • A screen that rotates when you tilt the camera
  • MP3 player
  • Digital camera, video camera
  • Removable memory chip
  • 500 contact with up to 5 phone numbers each
  • A web browser that will support AJAX and XMLHttpRequest
  • Decent support of cascading stylesheets

Cons:

  • Imperfect support of javascript
  • No support of cookies/sessions

What does this mean for you? You can go to my site, but you can’t log in. If you can’t log in, you can’t use the calculators. :/

As a side note, just about every Verizon rep I’ve talked to pushes this phone’s 500 person contact list. My question, “How much memory does the phone have?” Their response: “It has 5 phone numbers per contact? Wow. That’s a lot. I didn’t know that.” Riiight – you didn’t know? Why have I heard that exact line from three separate reps? I don’t have 500 contacts. I don’t even know 500 people.

Verdict: It may be a good phone, but you won’t be able to use my calculators from it.