10-01-2018, 07:59 AM
Actually I disagree with your previous correction, wulfo. It's true one should make sure that a method will work as expected, BUT that doesn't mean we should always do things like turning a "Fred" string into a an integer.
The actual way coders work with non web based stuff, where you can get a 404 error message if the webpage could not be found, would be raising an error by calling the raise Kernel method and posting a descriptive error message on screen. It would not be necessary if Ruby were strong typed as C and C++ are, but being weak typed forces Ruby coders to add conditions or raising errors whenever it's needed.
raise would be the best way to tell the coder or game developer that they should go fix the error found in a given line. The backtrace feature was implemented for that very same reason. I hope you already knew about those features and used them accordingly. Otherwise you would have been "stealing" the coder the chance to debug his or her game or code.
The actual way coders work with non web based stuff, where you can get a 404 error message if the webpage could not be found, would be raising an error by calling the raise Kernel method and posting a descriptive error message on screen. It would not be necessary if Ruby were strong typed as C and C++ are, but being weak typed forces Ruby coders to add conditions or raising errors whenever it's needed.
raise would be the best way to tell the coder or game developer that they should go fix the error found in a given line. The backtrace feature was implemented for that very same reason. I hope you already knew about those features and used them accordingly. Otherwise you would have been "stealing" the coder the chance to debug his or her game or code.
"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