3 ms·
I love symbols in Ruby. I wish every language had something similar, rather than having me define constants, importing the constants, etc. Just let me create sy
by mratzloff 13y ago
I love symbols in Ruby. I wish every language had something similar, rather than having me define constants, importing the constants, etc. Just let me create symbols I can pass around easily.
- mercurial 13y agoDebatable. I haven't been doing Ruby for a few years, but when I did, it was mostly used as dictionary keys. So, sure, you didn't need to define your constant somewhere, but on the other hand, you end up a typo away from an invalid lookup. Getting a NameError is a much easier way to locate the origin of the problem.
- mratzloff 13y agoYes, that is a valid point, and definitely a downside.