CamelCasing a Constant: Acceptable Practice?
#4
Well, since I've been searching for pure ruby scripts and I joined #ruby-lang channel at freenode.net I think, the comments I can now recall make me think that in Ruby there are many "flavors" when talking about how to deal with syntax in a few aspects but one thing I'd like to mention is that Constants are supposed to be written in CamelCase or be capitalized only (Capitalized) if you're using the Constant as a class or module name. For any other purposes they're supposed to be written all in uppercase. They say it'd distinguish the use or purpose those Constants have...

One thing I only found in RGSS(2) but never in pure Ruby was the underscore. Really, I've downloaded RB files, installed Ruby Gems, etc. and I've never seen a single Constant written with an underscore in between (especially if used as a class or module name). There are some basic programming books based on Ruby saying you should never use underscore, others just ignore that the underscore even exist... except for naming methods with def end... That makes me think that Constants like This_Is_A_Constant can only be found if the scripter is someone who usually codes or works in C or any of its variants.
"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.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

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! Laughing + Tongue sticking out

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
Reply }


Messages In This Thread
CamelCasing a Constant: Acceptable Practice? - by kyonides - 02-17-2010, 07:24 AM



Users browsing this thread: 3 Guest(s)