Show off your games, demos and other (playable) creations.
raidho36
Party member
Posts: 1901
Joined: Mon Jun 17, 2013 12:00 pm

I might be mistaken but if I read it right, your entire problem with this is that you created something with a critical bug in it yet it somehow worked on your machine, but on others' machines it failed, and you want the LOVE framework to fail silently on such a critical bug, because on your machine it was somehow working and you wanted it to be that way for everyone - with no extra effort from you.

"Works on my machine" is not meant to be taken unironically. In fact, the reason why it exists is to mock people who don't test things on any other setup than their own machine.

If there's one thing I can take away from all of my programming experience, is that nothing substitutes actual testing. NOTHING. Ever.

pgimeno
Party member
Posts: 1827
Joined: Sun Oct 18, 2015 2:58 pm

You didn't read it right. My (hypothetical) code does not have a critical bug in it; I didn't do anything wrong. Having an unused variable is not, or should not ever be regarded as, a critical bug; it's a valid programming pattern. For example, Lua doesn't punish you with errors if you have unused variables in your code (not even if you misspell a variable; only if you use the resulting nil value in a context where it doesn't make sense). C compilers typically emit warnings, NOT errors, in case of unused identifiers, and you can disable these warnings.

The "actual testing" you're suggesting is unrealistic. Even if I tested it in every OpenGL implementation out there (impractical), some future driver could be smarter about optimization and remove more variables, and then my thoroughly well-tested code would crash in that driver. Who would be to blame?

- The programmer, for following a coding pattern that makes possible future changes more comfortable?
- Every driver the programmer tested the code in, for not being clever enough to optimize out some variables?
- The driver that applies more aggressive optimizations, for optimizing out things that can potentially make the shader faster?
- The engine, for erring on something against the recommendations of the OpenGL creators?

I'd go for the last. Remember, again, that the OpenGL wiki recommends to just ignore the situation and keep going. It does not recommend throwing an exception and forcing the user to remove the unused variable.

All I'm asking is that LÖVE sticks to that recommendation, just returning a value for diagnostics. It keeps adding to the amount of stuff I have to monkey-patch in LÖVE.

Corrected function which returns the diagnostics:

Code: Select all

do
local old_send = mt.send
end
end


raidho36
Party member
Posts: 1901
Joined: Mon Jun 17, 2013 12:00 pm