Thursday, May 24, 2012

Just as I feared: the newest Autopoke doesn't work

As I was getting ready to deploy the newest version of Facebook Autopoke, I decided to open it up to see if it still works.  Just as I feared, it doesn't.

A very quick look at the source and it looks like that it will take quite a long time to figure out how to do automatically again.

Back in January, I decided to stop development on Facebook Autopoke because there were various copies of my script on userscripts.  While a vast majority of them have been deleted and removed, it shifted my focus elsewhere.  And with the ever-changing landscape of Facebook, it's becoming clear that the "Poke" feature is becoming antiquated.  What I mean by this is that the "Poke" feature isn't a major button anymore.  It's actually tucked away under the "Gears" menu.

I believe it's only a matter of time before Facebook does away with the whole poke thing.  Originally, this script allowed me to beat friends in poke wars.  And since I'm no longer poking anyone, this script was maintained only for others.

My personal philosophy in coding has been to code to make my life easier and then release the code to others to see if anyone else can benefit from it.  Since I'm no longer using the script, I'm sure this announcement will cause you pain.

Effective immediately, all development on my Facebook Autopoke script will cease.

I will be releasing the latest changes to the Facebook Autopoke script this weekend so that if you want the latest code, you can get it.  Be advised that it's set to "developer" mode so it produces a lot of noisy output.  I want to thank users who have put up with me inconsistent build schedule and for all of the support over the five-ten years that this script has been in development.  The userscript uid is 5200!  This was one of the first scripts I ever wrote.  Going back through each revisions show how much I had learned as a programmer and how much my style has evolved.

Normally, when I retire a program, I release the code under the more permissive MIT License.  But because of the numerous violations, the code will stay under the GPL until further notice.  If you would like to use a different license, please contact me.

Finally, you'll notice that tailgate is more than just for the Facebook Autopoke.  Instead of creating a Google code project for individual script I write, I decided to create one repository for everything.  The latest script that I have written is Give Me Paste Back.

Saturday, May 5, 2012

Give Me Paste Back!

As a web-developer and a programmer, there's a rule about never trusting user input.  It's similar Murphy's law and why software companies spend lots of money beta testing.  If there is a wrong way to enter data, a mindless user will find a way.

The rule of thumb to counter this is to programatically eliminate user error on the server-side.  This means that if you're expecting a phone number in format "(555) 555-1212" and the user enters it as "555.555-1212", you either give an error or you process the data anyway after you fix the entry.  Eliminating the user's ability to type a period does solve the aspect of not being able to type a period only.  It does not eliminate a user from typing "555    55 5 -  1212".

I recently had this "discussion" with the good folks at @CreditKarma in 140-characters or less.  They told me what I expected, but 140-characters isn't enough to tell why using JavaScript to turn off a browser feature is ultimately stupid and pointless.

Overall, JavaScript should be used to enhance the browsing experience.  Eliminating paste, right-mouse-click, obfuscating image URLs are all things that cheapen the user experience because the browser does not do what the user expects.  An user should not have to jump through digital hoops to be able to use a website in the way they would like.

Specifically, pasting is something that most people do everyday.  They expect every application, whether it's Microsoft Word or their favorite browser, to do what they've come to expect when pressing "Ctrl-V".

On the other hand, as a web-developer, I understand why folks like Credit Karma choose to prevent pasting via JavaScript.  It's cheaper to write one line to stop pasting than it is to actually test user input.  Testing user input would require more programming hours to test for each possibility.  Furthermore, you run the risk that the user was stupid and accidentally fat-fingered something in one box and then pasted it in another.  I will admit that I have done this.

This is NO excuse for disabling a critical feature of the browsers.  However, if you simply MUST do this, consider the following:
  • What frustrated me the most is that there was no feedback as to why paste did not work.  INFORM THE USER that paste has been disabled and offer a reason.  They may not like it, but at least they know that the problem *isn't* between the monitor and keyboard.
  • PROVIDE A WAY TO PASTE ANYWAY.  A switch, a preference...anything that says, "Hey, if you want to paste, we'll let you, but be sure you know what you're doing."  Doing this will help people like me who get frustrated and then write Greasemonkey scripts fixing your mess.
  • No matter what client-side solution you create, a user will find a way to mess things up so BE PREPARED TO HELP THEM.  Users make mistakes.  Give them a way to fix these mistakes instead of forcing them with the digital equivalent of cattle prods.  Guide them by giving them clear and concise instructions.
  • DO NOT RELY ON JAVASCRIPT TO FIX YOUR CARELESSNESS.  Users expect their browser to behave in a specific way. Things like autocomplete are a great way to augment the user experience.  However, forcing the user to wait while their browser counts down to 30 seconds is ridiculous when a crafty user can just read the source to get the final URL.  Furthermore, blocking the word "DROP" via javascript doesn't mean that they won't type in "; DROP TABLE customers". 
  • Finally, DO NOT "EDIT WAR".  If people are downloading and using my script, it's because they are frustrated like me.  Listen to your users.  The frustration that we feel doesn't color your company well.  Web Development is like electricity: we don't think about it until something goes wrong.  And users will make sure you hear them loud and clear.
Bottom line: Do not negatively alter the user's browser behavior unless you have absolutely exhausted every other option.  And if you have to, let the user know that you have done so.  After all, you are a guest in the user's browser.  (Technically, the user is the guest, but I digress.)  Don't scruff the floors, drink all the milk and put the carton back in the fridge.  Be a great guest so that the user will invite you back.  Otherwise, you'll find yourself lower and lower on the user's favorites/bookmarks and less and less on their minds.

All of this aside, Credit Karma is a great service.  They provide a way for you to get your credit score for free.  Yes, actually free unlike FreeCreditReport.com.  I do recommend them, even with their broken registration process.

So here it is: Give Me Paste Back now in version 0.2, tested specifically on Credit Karma.  Download the script and then go to Credit Karma and sign up for an account.