That moments of wonder …

when you are working for over a year on a project that was started by another developer and finally find a piece of code that makes you wonder how on Earth the whole thing could ever work – as it obviously did.

The most recent one: Data upload to a server. An XML containing a JSON.
But then the data itself inside the JSON being a string as a combination of a string ID and doubles formatted with the format method, and without explicit locale. How could that produce comma-delimited values on an US computer (because the server expects them)? This shouldn’t work.

What are your favourite moments of wonder?

Finding that the dozens of reports are in separate methods, each with a page or more of Xojo code long, but differing only in the one SQL command at the top.

1 Like

Finding that Xojo for iOS has no Val() command.

I’m reading “the daily wtf” since 2007 or so. There your WTF wouldn’t even been worth mentioning.

Yesterday I found a nice bug in my code: I’ve got a check for free space because users are saving lots of data into their small SSDs. The check only works for mailboxes with 1000 emails which nobody has. The check was failing when writing to PDF instead of Valentina because of a missing nil check. So I was lucky that nobody has larger mailboxes or I would have noticed the bug much sooner. Now I need to do some refactoring that the check is done more often.

I’m probably not allowed to mention anything but a decade at Xojo made me go “WTF?” a LOT

2 Likes

I hate magic numbers. The amount of open source code that I port is starting to get a little ridiculous and one thing I come across all the time are random hard-coded numeric literals that have very important meaning but I be ****** if I know where they come from!

Huh? ALL my mailboxes (and folders) have over 1000 emails. My Inbox always has the mail from this year and the last, and in summer I put the old ones into a separate folder.

The total number of emails across 5 accounts and 21 years is about 1.2 million emails.

Btw I’m using Apple Mail after Entourage silently corrupted its mail database and lost 2 months of emails (which coincided with my backup drive dying).

Nope. Most of my users have an intricate mailbox organisation with hundreds of mailboxes.

The bug in Mail for Catalina where Mail silently eats the emails is bringing me a quite a bit of money. AFAIK the bug still isn’t fixed in 10.15.3. Outlook nowadays is much more stable than Mail.

I’m still on High Sierra and Mojave so no problem there :wink:

My main computer will stay on High Sierra, too. That means more testing. But I can’t stand the sheer stupidity of Catalina.

Anyways. I love finding stupid bugs in my code. And I’m always happy to tell my customers “the bug has been fixed”. image

My moment of wonder?

When I try to run my project and get 20+ error messages.

I fix one with my magic fingers and ALL the errors disappear … :astonished:

Aka the cascading parser failure.

yeah :frowning: and its not even ordered in a way that fixing the first error in the list IS the right one to deal with
that one might actually be a cascading error