On Call It’s been a bit of a week hasn’t it? Grab yourself a biscuit and settle down for another story from a brave Register reader who was only trying to help. Welcome to On Call.

Today’s tale is from a reader Regomised as “Paul” and concerns his days as a programmer at a manufacturing plant in England. This was in the time of Windows 7, and Paul was an apprentice coder, keen to wedge his foot in the door of application development.

“I was tasked with developing a simple application for the Sales department,” he told us. “This application would simplify the act of moving folders full of customer manufacturing data from the salesperson’s Windows desktop to one of two network drives and folder trees for each customer and job number.”

The current process was manual, time-consuming, and prone to error. With Paul’s whizzy new application, all the salesperson needed to do was to point the app at the folders on their desktop. Processing would happen and data would be available to the engineers to do engineer-type stuff as well as being purged from the salesperson’s PC.

Simple enough – just a bit of file transfer. What could possibly go wrong?

Paul coded up the app, it was tested and then rolled out. Happy with the completion of his task, he was looking forward to his next project when the inevitable call came in.

“Your app took ages to run!” came the trilling from a member of the sales team. “And then deleted my desktop!”

Unexpected deletion of data? Of course, that can happen with Microsoft. But this was back in the glory days of Windows 7. Paul was sure his code was OK – it should only have taken seconds to run and certainly not trashed the desktop.

“So I dutifully went to investigate,” he told us.

“Low and behold their desktop is completely blank. This user was one of those users that used their desktop as a dump for all those important files. All neatly arranged around a low quality wallpaper image of a shirtless action actor rising out of a pool.”

“I believe it was Jason Statham, but that’s not overly relevant,” he added.

What was relevant was that all of the user’s files were indeed gone, as was the snap of a shirtless Statham. The desktop looked lovely and tidy, but the company’s accounts would not be quite so handsome if the salesperson’s files remained lost.

Paul asked around – nobody else had a problem. He peered into the recycle bin – no joy.

“On a whim, I checked the data they’d sent to the network drives, and was surprised to see it was considerably larger than the other folders on that drive…”

Aha. What had actually happened was that the user had misunderstood. Rather than direct the app to the folders on their desktop, they had actually directed the app to their desktop folder. The app had correctly transferred the contents to the network drive and then tidied up after itself.

The transporter had been transported to a server and off the desktop.

Thankfully the files were all intact so recovery was simply a case of copying the folder back to the salesperson’s PC. Paul then made his excuses and left as the inevitable “but all my icons are in the wrong place” complaints began.

And the app? While it had worked exactly as designed, Paul swiftly added a patch “that made sure a user was unable to select their desktop folder.”

“And named the function in honour of them.”

Ever popped the name of a particularly annoying user into the source, only to come a bit unstuck at code review time? Or found yourself being whinged at when your app did exactly what it was supposed to do? Tell all with an email to On Call. ®


Source link