Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
inferiorhuman
on Nov 7, 2022
|
parent
|
context
|
favorite
| on:
Making a DNS query in Ruby from scratch
Ah hah, you've discovered how long it's been since I've thought about Ruby performance.
One important advantage of symbols versus strings is that Symbol#== is constant time.
At that point though why not use integer constants?
knodi123
on Nov 7, 2022
[–]
syntactic sugar- you don't have to pre-declare them or worry about conflicting values. And occasionally the symbol.to_s method is useful in logging or whatnot. That's pretty much it.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: