Hacker News new | ask | show | jobs
by laszlokorte 2038 days ago
Ruby is extreme flexible in terms of metaprogramming in rails uses that very much. And ruby is not statically typed.

So if in rails you declare an active record model with belongs_to etc it's hard to keep track of what is really happening under the hood.

In php you have almost no runtime metaprogramming so the things that could happen if you read a piece of code are reduced to a smaller set of options that are easier to understand. well you have reflections but at least they are used in a more static way.

1 comments

Ruby also raises an exception for a string coercion to an int when the string isn't an obvious int.
That's a local effect that can be avoided once you know the sematincs of the language. The issue with abused metaprogramming and monkey patching is that it results in global effects that are hard to track.

I would prefer to review a messy 50kloc php project over a messy 50kloc ruby project.

I was citing it as a good thing versus PHP's (and Perl's) "foo" == 0;// true behavior. I believe that still to be the right thing despite other issues Ruby has.
Then I agree of course!