Issues

Issue #736 resolved

Misspelled setMode flags could error

hahawoo
created an issue

Maybe this should error:

love.window.setMode(800, 600, {nsync = true})

Comments (3)

  1. Alex Szpakowski

    Making it error in that case would help prevent typos. On the other hand, it would make code even less backward-compatible in future versions when new flags are added (or if existing ones are renamed.)

    There is no real notion of a "warning" instead of a full error in Lua. Maybe it could print a message when an invalid table key is used?

  2. hahawoo reporter

    While I think printing a message is a clever way of displaying warnings, I don't think it's worth it for this. If warnings were a "thing" then people would have to know about it, and they might start checking the console and stuff, and, you know, things could get more complicated over something trivial.

    In regards to backwards compatibility... is backwards compatibility actually desirable? I like how LÖVE doesn't compromise its design for backwards compatibility.

    And in regards to errors-due-to-misspelled-flags breaking backwards compatibility, isn't it similar to errors-due-to-misspelled-enums? And if you were running code with flags which aren't available in the version you're running, would it not be better to error rather than silently continue?

  3. Log in to comment