Genisys wrote...
Constants never change, by the lexicon definition, where a Constant Switch is nothing more than a constant that does change, by the user, to control a script or multiple scripts. That's how I have always inturpreted what switches are, as controls, not only in coding, but in the computer world too...
Genisys, you've been very considerate since this confusion regarding terminology was pointed out to you. I am very sorry that several people who are apparently less familiar with these things are confusing the issue for you. But if you wish other people to clearly understand what you are doing here, then simply say that you are setting up constants to simplify your code. Everyone will understand that perfectly, and it will not be confusing to anyone..
However, one thing you stated above is completely incorrect:
"Constants never change, by the lexicon definition, where a Constant Switch is nothing more than a constant that does change, by the user, to control a script or multiple scripts."
No, that is completely wrong. "Constants" are values that can be changed by the scripter ("user" or programmer) in the toolset before the game is played. What the Lexicon is saying is that once you as the scripter declare something as a constant ("const"), then the script will not compile if you try to change the value later in that script. If a constant couldn't be changed by the programmer as needed, it wouldn't be much use, would it?
What you did in the first thread of this post is a *textbook* example of what constants are used for in programming. The examples that programming students see in their freshman classes look almost identical to what you did. A constant is a value that you set in your code so that you don't have to go through your code making changes in different places if that value changes. Instead, you just set it *once* at the beginning. To make sure you don't accidentally change it later in that script, you add the "const" keyword.
Three different experienced programmers have told you this in this thread, and it is 100% correct.
There is nothing wrong with misusing a term once in a while, partiularly when you are just beginning. And this is not at all about picking on people who are not programmers. Not everybody is a computer programmer, nor do they need to be.
But when several more experienced people tell you that the term you are using is really confusing to others, then perhaps there is some value in using the correct term moving forward. And the term for what you're doing here is simply setting constants in the toolset to control aspects your script, and then changing those constants in the toolset if the script functionality needs to change.
You can call them "switches" if you like, but that is just going to confuse people and make it harder for them to appreciate what you are trying to do here. And that really doesn't help anyone.
Modifié par Invisig0th, 06 septembre 2010 - 06:51 .