In the ever growing "Bad Advice" series on TOF

And NO caveats about Timer.CallLater
There should be

While it CAN be useful you have to be careful about using it since it schedules the callback in a way that it can crash your app IF you’re not careful

And the tips on how to be careful and avoid this are NOT given !

So what can it do ?

Timer.CallLater can try to “call later” a method that no longer exists because the instance that method is on no longer exists. Like on a window that you have closed so the instance may be destroyed. Since the instance is missing the method is basically missing and boom !

So be VERY wary and make sure you CANCEL CALL appropriately as well

Your toes will love you for it

1 Like

I thought it interesting the THEY think good programming involves tons of timers….

Timer were often the workaround for a number of issues.

1 Like

Well maybe its about time to explain them, how threading and mutexes work?

1 Like

I’m not surprised. I don’t think anyone reviews the blog posts with a critical eye. So the user base is going to be fed ‘great power’ ideas without the requisite ‘great responsibility’ part.

2 Likes

Xojo is so 1990s.

1 Like

I wonder if it is just me… In my perception all Blog Posts by G.L. seem AI generated to me, such as if someone just quickly entered some topic and “write some fancy blog post about that”.
That’s been my impression ever since, and I somehow can’t get rid of it. And that results in me not even reading it, and certainly not trusting it.
I’m well aware I might be totally wrong - but then I’d still would write this as a feedback if asked :wink:

:man_shrugging:
They do seem that way to some extent

But they also have that “Hey I just figured this out” feeling as a dev moves from just getting started to having just enough knowledge to be truly dangerous

1 Like

Yeah, that makes sense, honestly. And no experienced Xojo developer is reviewing.

2 Likes

I’ve read a few and written the author to get revisions

I quickly discovered that was as pointless as submitting bug reports
like this https://tracker.xojo.com/xojoinc/xojo/-/issues/59520

1 Like