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

It is fairly easy to avoid symbol soup in ruby.

First, don't use global variables. I'm perfectly OK with global variables sticking out and looking ugly.

Second, use the English module packaged with Ruby if you find yourself using Perl-like special global variables a lot. I very rarely use them and so never need to use the module.

Finally, use accessor methods to work with instance variables instead of accessing them directly. This also makes it easier to add logic to handle your instance variables without having to rewrite or break any code.

If you follow these three steps alone, you will have about the same amount of symbol soup as you would in python, which is almost none.

(By the way, I am also a fan of both python and ruby and think they are both great languages).



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: