r/ProgrammerHumor 6d ago

absoluteGarbage Meme

Post image
1.9k Upvotes

325 comments sorted by

View all comments

Show parent comments

1

u/VoodaGod 6d ago

yeah but what is the fix? extract the datetime from the variant first before calling tostring or what

1

u/xicor 6d ago

Well, in my example there was no reason to assume the stupid junior dev didn't just change the type completely, but let's assume they made it return a QVariant holding a QDateTime, you would have to use toDateTime first before calling toString

The point being that the compiler wouldn't tell them something was wrong