What are the things you would like improved in the

2019-03-10 03:36发布

What are the things you wish Ruby (and more generally the Ruby community) would improve?

I read somewhere that Ruby is the love-child of Smalltalk and LISP, with Miss Perl as the Nanny.

I have a lot of respect for Ruby's parents, but I'm not sure I like the influence Miss Perl had on the child. Specifically, I don't like the predefined variables: I need a cheat sheet to know what they mean. You could say "just don't use them". Well, I don't... but other people do. And when I download a plugin on the Web, I have no choice but to fetch my cheat-sheet if I ever need to go and touch the source code. I just wish they would remove those from the language itself.

Also, I think that Ruby is too much of a moving target. My code breaks on every new Ruby upgrade, even on minor releases. This is true also of Ruby on Rails and most Rails plugins I have worked with: they just change all the time, and nobody seems to care whether the changes break everything or not. IMHO, although I love a lot of things in Ruby, this lack of stability is almost a show-stopper.

10条回答
我欲成王,谁敢阻挡
2楼-- · 2019-03-10 04:00

I wish they would get rid of the predefined variables: $!, $&, $+, etc.

查看更多
该账号已被封号
3楼-- · 2019-03-10 04:01

Getting rid of the artificial distinction between Modules and Classes would be nice.

Both Modules and Classes are Namespaces. Modules are also Mixins, while Classes aren't. Classes can also be instantiated while Modules can't. This distinction is unnecessary. Just get rid of Modules and allow Classes to be used as Mixins.

An example of a language where this works is Newspeak.

查看更多
▲ chillily
4楼-- · 2019-03-10 04:05

I would like to have support for static compile-time metaprogramming. The Converge Programming Language might be a good starting point.

查看更多
Fickle 薄情
5楼-- · 2019-03-10 04:06

Replace Exceptions with a Common Lisp style Conditions system.

查看更多
爷的心禁止访问
6楼-- · 2019-03-10 04:08

Replace the Mixin system with a Traits system.

查看更多
Bombasti
7楼-- · 2019-03-10 04:13

Make Ruby completely Message Sending based, get rid of everything that is not a message send: local variables, global variables, instance variables, class hierarchy variables, constants, magic globals, magic constants, builtin operators, builtin keywords, even literals. See Self, Ioke or Newspeak for the incredible power and elegance this gains.

查看更多
登录 后发表回答