Your favorite error in code

Close to 30 years ago, wrote a simple DOS program using Debug in my secondary school computer lab.
But forgot to specify proper number of bytes to write / save the file.
Debug wrote the entire hard disk (or something like that)
and wiped the entire 4MB hard disk of that poor pc.

2 Likes

When I started my hobby programming around 2000, I made my first steps with PHP. When a friend of mine asked if I could implement an e-mail distribution list to inform his customers about important news, I was sure I could do that. Enthusiastically I wrote a script and made a test run on his server.
Fortunately the only available e-mail address at that time was my friend’s one, because I hadn’t seen the infinite loop in my script, so that in minutes my friend’s mail client was flooded with tens of thousands of mails and there were more and more to come until I finally managed to stop the script.

Lesson learned: Leave pro stuff to the pros! (My dictionary says, there is an English proverb for its German pendant currently in my mind: “Cobbler, stick to your trade!”)
Since then I shared a few applications I wrote for my own use with friends, but never ever again will I meddle in business matters …

2 Likes

Believe me, business is often now way better :-). When I worked for an SAP consultancy I was at the end of the career a performance specialist for SAP Retail. So that basically meant I had to fly like fireworkers from project to project. But as I did know ABAP Script, which is a (nasty) language by its own to print “special stuff”, I got one day a project to optimize the printout of price labels put on the shelf for a large retailer.

Being a good developer I quickly realized that the labels were a bit larger than the longest possible product name I found in the 20.000 large product table. So in development I did add a few characters to identify the max possible length and to limit the printable string to that found length to avoid problems in future. So in Xojo this would equal to something simple like this:

productname = "Jeannot's special " + productname

Hence this will result in:

Jeannot’s special Kellog’s cornflakes
Jeannot’s special Diet Coca Cola 33cl

etc. you get the idea.

My boss called me that I urgently had to fly to another customer. What I did of course, someone else would continue my work.

I forgot about this activity until 4-5 years later. My company was not even doing much for this customer, but I got a call from their big boss, that all labels in all retail stores in Germany are all the sudden printing labels in a strange way … He was the only one who recalled my first name :wink: … and he was right! :slight_smile:

The issue was that my work never got finished and my comment of this change request was badly “programmed”. It read “Optimization of label printing, avoiding to print too large product names”. It didn’t say anything about Work in progress etc. When the customer was managing the SAP system on their own, they bumped into this change and thought: “Well, that sounds like a very good change, let’s move it into production! Now!”

(Lessons learned, in a business context comment everything! If you have to urgently leave a project, leave at least a comment that this is not yet finished nor tested, and generally speaking, don’t ever put into production what you haven’t tested yet, and try to avoid that others will put it by mistake into production).

BTW I was lucky that I only left my firstname, I often used f-words for such activities, but the printer was staying in a different room, that was the only reason why I chose a “civilized” prefix :slight_smile:

Coupling with Tom Hare’s error, more than once I’ve been called in to debug a problem and found an “If X Not equal A OR X Not equal B then” … because that’s the words people have in their head when they want something triggered both X isn’t A or B. But of A is true, B is false, and if B is true, A is false, and the “OR” assures the statement will ALWAYS BE TRUE.

On deletes, once I was working AT, not FOR INTEL. I came from a Macintosh background and the supervisor wanted me to write a routine to delete some files. The specs said the trigger should be, “press any key to delete.” I asked him if (Apple style at that time), he wanted me to add and “Are you sure?” secondary check. As was the attitude of the times (in the PC world), he said that pushing a key to delete would be enough.

So I wrote the routine and brought him over to watch it run. I launched it and it came up with the “Press” message. Then I opened a ring binder that was next to the keyboard and let the cover land on “any key”. Files deleted. We then added an “Are You Sure” secondary confirmation to the routine.

2 Likes

Well done Paul ! Ang thank you for the laugh !

In the same vein: I had a Windows laptop where I used to put the cover of the music CD I was listening to until the day he pressed the start key (turn off the computer?) .

I stopped this practice.

I had a change coded, tested and ready to go into production. At the very last minute, I realized that there was one case I hadn’t covered. So I quickly fixed it, sent it out, and mopped my brow thinking, “that was a close one, glad I caught it!” Sure enough, the last minute change brought the whole thing crashing down.

Always resist that urge to fix something last minute. Unfortunately, I have “learned” this many times.

1 Like

This. A thousand times this.

The ‘Columbo’ request at the end of a hard day.
‘before you go…I dont suppose you could
-make this bit look a bit wider
-sum the averages
-just add one more field…’

Done. Bye.
Back again the next day for free work because the last thing you added as a favour broke it all.

1 Like

Talking about keyboards, it just comes to my mind that as junior consultants we sometimes liked to change 2-3 keys on a desktop keyboard for those supervisors, customers, etc., who really got on our nerves :-). Quick and easy change in the old days, and unless someone can blindly type this drives people really nuts and only very few did realize it quickly.

My mom worked as a bookkeeper at a multimillion dollar kitchen and cabinet business many decades ago that did work for many apartment complexes including ones owned by Trump. One day everything is fine until the computer fritzed out as my mom was entering data. Turns out that the program they were using didn’t have any error checking when it encountered a “Database too large” issue and the entire database was wiped. The company did make daily backups however this was the first time they ever tried to restore a backup so the IT guy made a comment saying “Well, we’ll find out soon if these backups work”. The backups were on cassette tape. Luckily the boss is an old fashioned guy that had everything done on paper as well so nothing but a little time was lost. One a non-programming error note: my mom also broke many computers in her office due to her electric (static) personality so they got her a rubber chair mat to stop the static.

When I was first getting started with Linux and Xojo, I had a Shell object that executed something along the lines of “cd /path/to/backups/; ls -t | tail -n 2 | xargs rm -rf” to remove all but the 2 latest backups. I mistyped the backup folder and it could not change directories. Little did I know that the default directory for the Shell object was “/”. It deleted just about every file on the server including all backups, luckily I had an offsite backup ready to go and it was a quick fix.

Another noob mistake was when bouncing between C++ and Xojo, I screwed up the difference between lengths and ubound and caused my loops to write data to index 21 of a 20 element array. I could not for the life of me figure out why element 1 of another array somewhere else in the code was getting set to garbage.

1 Like

Three recent BIG mistakes that cost me a client:

1 - I did not have UPS on my production machine which was a laptop being used really as a desktop. Storm rolled in and both the laptop’s motherboard and the HDMI connector to my NICE, very large monitor were killed. That monitor will now only work over VGA port - :cry:

2 - I did not back up any of that work to anything like a USB drive, and lost a month of work to the storm.

3 - I did not realize that browsers would react differently with Xojo and in a rush to a client meeting, I opted to use my new replacement (see above two mistakes) laptop and did not test the code on the laptop prior to my demo meeting to show my work. When I tried to show what I had created, it was broken and the client ended the meeting and fired me via e-mail.

I will repeat - laptops can be nailed by lightening - GET A UPS!!

1 Like

ooh, that’s a real nightmare :frowning:

1 Like

Lightning is cruel. Ages ago, when PCs were starting to get popular for small businesses, I used to help configure and install them for friends and associates. One gimmick at the time was a free modem card. I’d remove them and recommend an external one that used a serial port.
A couple of them had better ideas and re-installed the modem card. They would buy a UPS and surge protectors but found out the expensive way that those did NOTHING to stop a lightning pulse coming directly to the motherboard via the telephone cable.
A real RS232 port has current/voltage protection built in so while the external modem toasted, the main computer was fine. Much cheaper to replace than the entire motherboard.

2 Likes

a short while ago …
there was a overview excel that contains manually entrys of written excel sheets orders (these going via pdf & mail to extern.)

ok, how about createing this overview list with xojo? sounds fine, read all files in a list, open each, read the data for the overview, add data to overview excel, close current excel.
what i not expected … that when excel object close is used it overwrite the current file.
it had a timestamp formula in a cell = Today (= Heute) arrgggg
i had luck that the execution was Interrupted so i only need to fix the date of one file. huiii
excel have an extra option that closing do not overwrite the file.

this project is placed on hold :ice_cube:

2 Likes