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

A-bloody-men. I read the post and mostly went "What?". If you're calling local variables the same as methods in the same scope then you're just asked for trouble. Mostly because when you come back and read it 3 months later it's harder to pick through.

Think the only related thing I've ever hit and gone WTF at is `foo = foo` sets foo to nil. But afaik that's due to the implementation of MRI/YARV, not all ruby runtimes.

So yeah, as a professional rubyist, reading that post was mostly just me going "WTF, why would you ever think or do that". As Peter says, take it with a pinch of salt.




Ditto. I think it's problematic for a programmer to rely on a language to resolve ambiguities for you. If you see or suspect undesired ambiguities in your code, resolve them yourself. Best of all, make every effort to avoid introducing them in the first place.

I'm reminded of a programmer I read about who refused to learn any language's operator precedence. Instead, he always grouped expressions with parentheses to make sure they were evaluated in the order he desired. (I don't know that I'd do that myself, but he had a point...)


"Ditto. I think it's problematic for a programmer to rely on a language to resolve ambiguities for you."

If you are a C programmer maybe you can learn to live with those and manually "resolve them".

But if you dabble in functional languages, e.g Haskell, that's something you come to expect, if not demand of your language.

A programmer should NOT do what a computer can.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: