this post was submitted on 02 Oct 2023
124 points (100.0% liked)

Programmer Humor

19154 readers
2012 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 0 points 11 months ago (1 children)

Right. There is no solution to the halting problem, that's been proven. But you just showed you can very easily create a way of practically solving it. Just waiting for 10 seconds does it. That will catch every infinite loop while also having some false positives. And that will be fine in most applications.

My point is that even if a solution to the halting problem is impossible, there is often a very possible solution that will get you close enough for a real world scenario. And there are definitely more sophisticated methods of catching non-halting programs with fewer false positives.

[–] [email protected] 0 points 11 months ago (1 children)

And that will be fine in most applications.

Have you never written a useful program that took more than 10 seconds to complete?

[–] [email protected] 2 points 11 months ago (1 children)

I fully agree with your sentiment. But just in case: If you’re blocking the main thread of a browser for seconds at a time, you should look into that.

[–] [email protected] -1 points 11 months ago

I'm not talking about web applications.