Snippet 1:
switch (aVariable){
case 0: doAThing(); break;
case 1: doAnotherThing(); break;
default: doSomething(); break;
}Snippet 2:
switch (aVariable){
default: doSomething(); break;
case 0: doAThing(); break;
case 1: doAnotherThing(); break;
}These two snippets of code do not exhibit the same behaviour, as you would expect them to (and as they do in any other programming language with switch statements I've used.) Instead, in the second snippet the cases for 0 and 1 do not run and instead call the default behaviour.
Yes, I can just put default at the end but what if I want to do this?
switch (aVariable){
default: doAThingFirst();
case 0: followUpWithAThing(); break;
}At least put it in the manual that default has to be last and have GM throw a compiler error from doing otherwise.
if statements are broken
if (instance_exists(someObject) && someObject.x > 100){
//This code will crash if someObject does not exist
}It's a very standard coding practice to do things like this in other languages. The second check has no reason to run if the first one returns false, yet it does. Not only does it lead to crashes the first check is supposed to prevent, but it's an unecessary drain on resources. Again, it also runs counter to the behaviour of other languages.











