10-03-2018, 12:55 AM
The test units are there to get to those parts that still include errors that desperately need fixes. If we were used to include them, even in RGSS scripting, as coders always recommend, we would be able to properly prevent users to get those weird error messages. Take in consideration that RM game developers aren't scripters usually, that makes scripters get prepared in advance to prevent errors from appearing due to some user's silly mistake or misunderstanding of its actual features.
Safeguards that prevent them from correctly learning how to use script calls or setup a window, etc. would not let them understand why they should get some "Fred" or nil or "---" or "invalid" message on screen while they were expecting some month name or anything else. Since the user would not get the corresponding error message, he or she will come back telling you that YOU should look for the exact line(s) where things go wrong. That would be a difficult task for anybody if you have to check every single place where the player called that scene or method. The error message and its backtrace lets you get there faster than in the previous case.
Why do I keep saying that? Because there's also a custom among coders like those that publish rubygems that makes a script call raise if some user passes some string as a x or y coordinate or as width or height. (That example was taken from gems that let you create custom PNG files!) Coders include their custom Error classes that inherit from StandardError (or some other class depending on their very specific case). Perhaps in compiled languages like C it might look good to include error messages, but you gotta do it in interpreted or precompiled languages like Ruby and RGSS. Those safeguards you're defending here, actually hide defects that lead to incorrect user behavior (based on lack of knowledge or proper instructions).
People, please recall that in strict typed languages, the programmer is capable of troubleshooting his or her own code thanks to built in features in compilers. In those languages the need for raising errors is kind of minimal indeed. (Unless wulfo now prefers to say that a programmer should hide the fact some user was trying to divide a number by zero ) In Ruby we either make things complicated by including too many safeguards or we just implement raise error messages / classes. You might think it's a matter of taste, but I have seen the usefulness of the raised error messages while coding non RGSS stuff. I hope other people get interested in thinking out of the (RM) box and implement them wherever they might help you prevent people from misusing your code. (Especially if they come back telling you that YOU made a mistake not them - without actual evidence of it!)
Safeguards that prevent them from correctly learning how to use script calls or setup a window, etc. would not let them understand why they should get some "Fred" or nil or "---" or "invalid" message on screen while they were expecting some month name or anything else. Since the user would not get the corresponding error message, he or she will come back telling you that YOU should look for the exact line(s) where things go wrong. That would be a difficult task for anybody if you have to check every single place where the player called that scene or method. The error message and its backtrace lets you get there faster than in the previous case.
Why do I keep saying that? Because there's also a custom among coders like those that publish rubygems that makes a script call raise if some user passes some string as a x or y coordinate or as width or height. (That example was taken from gems that let you create custom PNG files!) Coders include their custom Error classes that inherit from StandardError (or some other class depending on their very specific case). Perhaps in compiled languages like C it might look good to include error messages, but you gotta do it in interpreted or precompiled languages like Ruby and RGSS. Those safeguards you're defending here, actually hide defects that lead to incorrect user behavior (based on lack of knowledge or proper instructions).
People, please recall that in strict typed languages, the programmer is capable of troubleshooting his or her own code thanks to built in features in compilers. In those languages the need for raising errors is kind of minimal indeed. (Unless wulfo now prefers to say that a programmer should hide the fact some user was trying to divide a number by zero ) In Ruby we either make things complicated by including too many safeguards or we just implement raise error messages / classes. You might think it's a matter of taste, but I have seen the usefulness of the raised error messages while coding non RGSS stuff. I hope other people get interested in thinking out of the (RM) box and implement them wherever they might help you prevent people from misusing your code. (Especially if they come back telling you that YOU made a mistake not them - without actual evidence of it!)
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE