Quote:
Originally Posted by Tigairius
That's correct, Java's switch() statements only allow ints, but that doesn't mean I should model my code after the standards Java runs. You may notice that GScript2 utilizes strings much differently than most coding languages. Following that logic I should also declare all of my variables before using them even though they're automatically declared when they're not equal to NULL.
|
Not true, Java's switch() does not only allow ints (it also allows char, byte, and short types), and for that matter, switch() works the same in just about every other popular language (such as C++ which was used largely in making Graal).
I'm not saying you shouldn't use strings in switch() statements on Graal, I'm just pointing out that other languages wouldn't allow you to do that. Regardless, though, I still feel that it was quite unnecessary in this case.
Quote:
Originally Posted by Tigairius
It really isn't necessary for this... if someone said filteron and it was currently on it would just switch it off. An extra line or two really isn't a big deal in my opinion.
|
I agree that it isn't so important for
this example, but when you're dealing with large scripts (such as the code for Windows that is well past millions of lines), it is quite important to shorten the number of lines as much as possible. Just a general tip.
