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

> Do you disagree and actually love the behavior of Ruby instance variables

yeah I wouldn't say i love it and i'm not sure why they did that but i imagine they had a reason for it originally. i would say it should have crashed instead of return nil as a default. they did tend to try to make the programmer happier and maybe they did it to that end but i don't see a large upside to it... not too much we can do about not using instance variables though... at the end of the day you just have to be a little more careful.

tests are a pretty good thing to have though and can catch this kind of error.



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

Search: