Garrulous Glaahk UA Posted June 11, 2004 Share Posted June 11, 2004 It really doesn't make much sense to do... Code: message_dialog("Something",""); A more sensible approach would be: Code: message_dialog("Something"); , where the second parameter is optional (can be treated as if it isn't there), but can be supplied if you want to use it. This syntax is commonly signified using the following syntax: Code: void message_dialog(string string1[, string string2]); Would be a good timesaving idea, and makes for cleaner code. Link to comment Share on other sites More sharing options...
Well-Actually War Trall Fort Posted June 11, 2004 Share Posted June 11, 2004 It's just easier to program an application that has to take in all values, including null ones. Otherwise, it has to fill in other values and may have to do a bit of guessing. This is the same reason why the W3 wants us to use XHTML instead of sloppy web design. Link to comment Share on other sites More sharing options...
Garrulous Glaahk spyderbytes Posted June 12, 2004 Share Posted June 12, 2004 Quote: Originally written by Grey-Eyed Stranger:Would be a good timesaving idea, and makes for cleaner code. Timesaving? Three or four keystrokes (depending on whether you omit or use spaces between parameters). I don't know about you, but I don't make enough message_dialog calls (or any other calls with null parms, either) for that to add up to much. As for cleaner code, I'd say it's a matter of opinion. It could be argued it leads to sloppier code, as well as confusion when newbs don't realize you CAN pass more than one parm to a particular call. Regardless, this would be low on my own personal list of changes I'd like to see made to Avernumscript. For the amount of time it would take JV to implement, I'm not sure all of us combined would save enough of our own time to balance. Link to comment Share on other sites More sharing options...
Magnificent Ornk Drakefyre Posted June 12, 2004 Share Posted June 12, 2004 Overloading a method/function is simple and doesn't take that much work at all. Link to comment Share on other sites More sharing options...
Garrulous Glaahk spyderbytes Posted June 12, 2004 Share Posted June 12, 2004 You're presuming JV's interpreter can handle C++-style overrides with aplomb. I have my doubts about that. Link to comment Share on other sites More sharing options...
Recommended Posts