Public Information Writeup: The "It Works" Fallacy

mcmonkey

Administrator
Staff member
Helper
Many newer scripters tend to not realize the important difference between "it works" and "it is correct". Just because a script works does not mean everything's fine.

Here's some examples of ways a script might seem to work, while not being correct... a script that seems to work fine might still:
  • Have error messages in the console (eg a flag tag when has_flag was needed)
  • Have useless/redundant lines of code that never run
  • Overcomplicate simple things (eg the infamous - execute as_server "ex narrate hi", which should of course just be - narrate hi)
  • Make use of deprecated options or syntaxes (and thus will not still work in time when those deprecated options are removed)
  • Be harmful to server performance (ie cause lag)
  • Not account for bad user input (eg a command script that doesn't check if all the required arguments are present)
  • Be abuseable (eg a shop script that lets user still buy things without any money)
  • Even have security risks (eg a script that runs execute as_server with user input, which could be used by a clever user to op themself).

There's a lot of real problems a script can have while still seeming to 'work' (the above list is far from complete!), and it's important to avoid things that are wrong even when they seem to work.
Helpers are encouraged to refuse to continue helping a user with the "if it works it's good enough" mindset until they fix all the things that are wrong (but seem to work) in their script.
 
  • Like
Reactions: Andarius68