This is now part four of my ongoing blog posts on writing our latest web app HR Partner. Parts one, two and three are here.
One of the things that we have realised from previous web apps we have written, is that the process of deleting critical data is almost automatic for most of our users. Even putting the usual "stop and confirm" dialog box in front of them to make the absolutely sure they want to delete a piece of data becomes an automated response after doing it a few times.
For minor data like lookup files etc., this is not really a problem. However, in HR Partner, the most critical data we have is the employees themselves. We wanted to make the process of deleting an employee a tad difficult - to be absolutely sure that they could not do it accidentally.
To this end, we came up with the idea of the user having to type in a short deletion code, very similar to a Captcha code, each time they wanted to delete an employee. Thankfully deleting employees is not a task done regularly, so we hope that the added thinking and stopgaps involved will not irritate users too much, but instead that they may be grateful for it.
When generating these codes, we also discovered that users could easily get confused between the letter O and the number 0 etc., so we decided to 'borrow' an algorithm that we spotted on StackOverflow to generate a non confusing code. There should not be any guessing between the characters. Here is the short helper code to generate the deletion code:
def generate_activation_code(size = 6) charset = %w{ 2 3 4 6 7 9 A C D E F G H J K M N P Q R T V W X Y Z} (0...size).map{ charset.to_a[rand(charset.size)] }.join end
Have we gone overboard with this? Would love to hear from other programmers and designers out there as to what you think about our approach.