• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Ruby Naming Rules (@,@@,$)

Status
Not open for further replies.
Level 18
Joined
Jan 24, 2006
Messages
1,938
*
Code:
@instance_variable
@@class_variable
CONSTANT_VARIABLE
Class/ModuleName
local_variable

Classes and Modules, despite being constants, are named differently so as to make them easily differentiable.

You also forgot the rules on word separators, Hakeem. And yeah, they're not particularly hard to remember and adhere to.
 
Level 6
Joined
Apr 16, 2007
Messages
177
In ruby, these are not just conventions. Your interpreter will complain if you try to do

A = 1
A = 2

^^

And while these are not that many, I still have to look them up every now and then.

Edit: Btw, if they are so easy to remember, why did our dear fellow Hakeem then forget about 40% of the rules when posting them ; )
 
Status
Not open for further replies.
Top