3 ms·
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 recor
by laszlokorte 6y 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.
- tyingq 6y agoRuby also raises an exception for a string coercion to an int when the string isn't an obvious int.
- laszlokorte 6y agoThat'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.
- tyingq 6y agoI 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.
- laszlokorte 6y agoThen I agree of course!