I would like to suggest constants to be implemented in a feature version of mIRC. For those of you who don't know what constants are, I would like to point you to google.com. For those of you who are going to suggest that variables using /set can replace this, I would also like to point you to the same site to learn the difference between variables and constants.
Here are some example usages for constants:
- Configuration of very small addons, where using dialogs would be overkill
- Fast access to values that will not change in run-time, but might change later (when I say fast I mean faster than using %variables and hashtables. Constants should be faster than both of these, given that they are implemented correctly)
Here are some benefits:
- Eased modification of scripts
- scalability
- Better code structure
- Less use of global variables
- Improved speed in script execution
These constants should be defined OUTSIDE any scripts, such as aliases or events. They should as well be defined within the first few lines of a script file.
Here is a concrete example, with pseudo-code for the constant:
const £CHUNK_SIZE = 4096
Alias SendFile {
var %filename = $+(",$1-,"), %chunksize = £CHUNK_SIZE
;do stuff here
}
So what do you think? (I would like to remind you that there is a distinct difference between variables and constants.)
Edit: added code tags