Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Come, that's just plain wrong to say that the code quality cannot be questioned because it's an optimization and because it's made by "smart people" and it "makes sense to them". No code is sacred.

It's perfectly valid to question using a macro to rename a function instead of just renaming calls, especially if the renamed function is only called twice. It also would've been more pragmatic to mention in the code that rb_obj_equal is being used due to an optimization in opt_eq_func, as it's not obvious.

There might be reasons for using a macro in this case, like wanting to underline the fact that symbols are being compared, but I strongly suspect the author was just focused on changing the implementation of sym_equal to be better, and didn't think of the option of throwing it away.



I didn't say it couldn't be questioned. I was just explaining some possible reasons why the patch was so esoteric, and pointing out that things that seem straightforward to MRI hackers often aren't to people who don't dig through Ruby internals every day.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: