News for hackers. Stuff that matters.
Re:PHP 8 by erikpukinskis on Thursday November 26, 2020 @11:11AM (#25221185)
What do you mean without the magic?
Re:PHP 8 by laszlokorte on Thursday November 26, 2020 @11:28AM (#25221313)
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.

Re:PHP 8 by tyingq on Thursday November 26, 2020 @11:32AM (#25221359)
Ruby also raises an exception for a string coercion to an int when the string isn't an obvious int.
Re:PHP 8 by laszlokorte on Thursday November 26, 2020 @11:39AM (#25221412)
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.

Re:PHP 8 by tyingq on Thursday November 26, 2020 @11:41AM (#25221435)
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.
Re:PHP 8 by laszlokorte on Thursday November 26, 2020 @11:48AM (#25221508)
Then I agree of course!
Re:PHP 8 by acomjean on Thursday November 26, 2020 @11:29AM (#25221333)
I think they mean stuff in Laravel framework and Ruby on Rails. Like database access where you can just use it as an object without worrying about queries and such. This is great, gets projects up fast.... until you need to do something different. It generally comes at the expense of flexibility.
Re:PHP 8 by nicoburns on Thursday November 26, 2020 @12:28PM (#25221919)
Most ORMs allow you drop down into RAW for all or part of the query, so you haven't really lost any flexibility.