symbol

MY_CONSTANT = “abcdeeeedfjeouwpuo”

too long to compare to check if a string equal to MY_CONSTANT

Use symbol:
MY_CONSTANT = :string

symbol having an object identifier; that’s the reason of a O(1) comparison between symbols

symbol is just something fixed, not a string. When you need to use it, use :sym, not “sym”.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s