Re:Implementing a simple object system from scratch in Ruby
by block_dagger on Sunday December 15, 2024 @08:57AM
(#42423394)
Interesting. Why the inconsistent use of hash rockets?
[ Parent
| on HN ]
Re:Implementing a simple object system from scratch in Ruby
by metacircu1ar on Sunday December 15, 2024 @09:09AM
(#42423451)
Thanks for spotting this. The parts of code were written at different times. I'll fix this to standardize on :key => value form, as I want symbols to be clearly distinguishable both on call sites and in the method table.
Re:Implementing a simple object system from scratch in Ruby
by alehlopeh on Sunday December 15, 2024 @09:15AM
(#42423482)
Not that it necessarily applies here but any time I see hash rockets in a PR it just screams “an llm wrote this”
Re:Implementing a simple object system from scratch in Ruby
by metacircu1ar on Sunday December 15, 2024 @09:22AM
(#42423527)
I write some ruby code for my job to automate some API testing stuff, where I use hash rockets exclusively.
Re:Implementing a simple object system from scratch in Ruby
by caseyohara on Sunday December 15, 2024 @10:01AM
(#42423761)
You should know that using the hash rocket syntax has not been idiomatic Ruby since the new hash syntax was introduced in 2012. Unless your keys are not symbols, there’s no reason to use hash rockets.