Devs – It’s Okay To Have Fun
27 Jun
Recently, I was assigned a task for my job to create a jQuery script that deleted elements from a sortable list, and then gave the user the ability to undo the delete action. I thought I would have a little bit of fun with a doctrine I don’t subscribe to at all, but it worked for this application.
- I created a hidden element to store unwanted list items: <div id=”purgatory”>.
- Then I created a hidden element wrapper for the undo button that shows once the delete button is clicked: <div id=”rescue-from-purgatory”>.
- Once the undo button is clicked, I set a Javascript variable to count the number of items in “purgatory” as follows: var lostSouls.
- So, in a nutshell, when a user clicks delete, they send the unwanted list item (lostSoul) to purgatory. When they click undo, the user rescues the lostSoul from that dreaded holding cell.
The point of this silly story is that you don’t have to get bored with your job. There are plenty of other ways to keep the ‘fun’ in functional, especially with long boring code blocks.
If you enjoy what you do, you never have to work a day in your life.










