Re: What are your favorite Ruby features?
- From: Phlip <phlip2005@xxxxxxxxx>
- Date: Sun, 15 Feb 2009 20:50:55 -0800
Tony Arcieri wrote:
[Note: parts of this message were removed to make it a legal post.]
I'm creating a new language which borrows heavily from Ruby, and I'm curious
what features of Ruby its users enjoy the most.
I've put up a poll here:
http://www.twiigs.com/poll/Technology/Computers/25588
It's multiple choice, but if possible, try to limit yourself to the top 10
features of Ruby you consider important, rather than checking every single
box.
Many of the items you list, such as "metaprogramming", or "easy to create DSLs", are now must-have features for any language, going forward. That is Ruby's impact on the industry.
But about "Redefining the behavior of core types", one might conflate overriding with Monkey Patching. Overriding is good - it's what OO is all about. But...
It would be nice if Ruby, and your language, made Monkey Patching safe. One reason we monkeys must patch is lack of Construction Encapsulation. If we could simply upgrade the target object itself to our derived type, then we would not need to "underride" a method and risk everyone gets it. So a system that encapsulates construction automatically, so programmers don't need to work extra for it, might be useful.
Another way to make MP safe might be Aspect Oriented Programming. I suspect that AOP is actually Monkey Patching, with the added benefit you can declare which modules see the patch and which see the classic behavior.
Finally, this may come as a shock to those who read my posts, but I tend to think that TDD support systems, beginning with the lowly assert() method, should behave like a debugger's variable watch system when they fail. They should report the source code and value of every expression in their neighborhood when they fail. But implementing that for an assertion - even within the mighty Ruby - is often freaking impossible. I have written an assert{ 2.0 } that comes very close, using major hacking with internal Ruby tools on that block. But getting rid of the block, and just using assert(), would be a major win.
Could your language provide all those abilities as first-class features, under the "metaprogramming" and "reflection" banners, so we can use them anywhere? (And [ahem!] why weren't they in your list?;)
--
Phlip
http://broadcast.oreilly.com/2009/02/merb-mind-maps.html
.
- Follow-Ups:
- Re: What are your favorite Ruby features?
- From: M. Edward (Ed) Borasky
- Re: What are your favorite Ruby features?
- References:
- What are your favorite Ruby features?
- From: Tony Arcieri
- What are your favorite Ruby features?
- Prev by Date: Controlling a forked process
- Next by Date: Re: What are your favorite Ruby features?
- Previous by thread: What are your favorite Ruby features?
- Next by thread: Re: What are your favorite Ruby features?
- Index(es):
Relevant Pages
|