Live data from Hacker News

Ruby's exceptional creatures

exceptionalcreatures.com

1–10 of 133 posts

Re: Ruby's exceptional creatures

#3
It's painful to see method_missing called out as a first class solution in the first creature https://www.exceptionalcreatures.com/bestiary/NoMethodError.... . "Practical Ruby" has three chapters dedicated to method_missing. "define_method" is more common these days and also painful to see.

Ruby gets a lot of criticism for embracing magic and indirection ("Ruby, the bad parts of Perl"). It has some good parts (no function colors, for example), but the ecosystem is the biggest problem by promoting magic. method_missing is not a good part of Ruby, it's a very bad part that you should only use if you know it's bad _and_ you know you still have to use it. I wish all tutorials would say this. "You can do this with Ruby, but don't, because your coworkers debugging an outage for an hour will hate you once they find out the bug is caused by method_missing".

Re: Ruby's exceptional creatures

#6
post #5

[flagged]

As someone with about 15 years of php under his belt, and now writing my second ruby app…i don’t know I’ll ever go back. It’s just so easy…

It’s easy indeed. Easy to make mistakes you don’t know were there until they bite you firmly in the arse.

Again I’m not interested in how quickly you can create an app.

I’m interested in your ability to maintain very complex business logic over the course of years.

Working at a Ruby shop now, I can say with confidence I will never touch it again with however long of a pole I can find.

Re: Ruby's exceptional creatures

#7

It's painful to see method_missing called out as a first class solution in the first creature https://www.exceptionalcreatures.com/bestiary/NoMethodError.... . "Practical Ruby" has three chapters dedicated to method_missing. "define_method" is more common these days and also painful to see. Ruby gets a lot of criticism for embracing magic and indirection ("Ruby, the bad parts of Perl"). It has some good parts (no fun…

method_missing is a tiny offense compared to what was getting popular at one point - creating classes by forking metaclass and injecting methods into... without knowing you're doing so (something IIRC got lost between people there...)

Result was objects that shared no structure, no field

Re: Ruby's exceptional creatures

#8

It's painful to see method_missing called out as a first class solution in the first creature https://www.exceptionalcreatures.com/bestiary/NoMethodError.... . "Practical Ruby" has three chapters dedicated to method_missing. "define_method" is more common these days and also painful to see. Ruby gets a lot of criticism for embracing magic and indirection ("Ruby, the bad parts of Perl"). It has some good parts (no fun…

The page you linked to discusses NoMethodError, which is raised when a method is not found. Among other things it shows how method_missing is involved in searching for a method. Nowhere in the text is it promoted.

Re: Ruby's exceptional creatures

#9

It's painful to see method_missing called out as a first class solution in the first creature https://www.exceptionalcreatures.com/bestiary/NoMethodError.... . "Practical Ruby" has three chapters dedicated to method_missing. "define_method" is more common these days and also painful to see. Ruby gets a lot of criticism for embracing magic and indirection ("Ruby, the bad parts of Perl"). It has some good parts (no fun…

Respectfully mostly disagree. Ruby is full of sharp knives. Other languages have dull knives.

Writing code without thinking will cut you either way.

Things like method missing are exactly the right solution for a certain set of problems. If used thoughtfully, they’re amazing. If used thoughtlessly, bloody mess. But this is true in every language.

Re: Ruby's exceptional creatures

#10

[flagged]

> why

If you have incorrect code and are happy programming, you fix your code.

If you have correct code, but are unhappy programming, you do not fix your code.

There is no correct code and Ruby prioritizes your happiness, so you get fixed code and happy programmers, instead of permanently broken code and unhappy programmers.

Post reply on HN