News for hackers. Stuff that matters.
Re:Why People Should Learn Python by gremlinsinc on Wednesday August 24, 2016 @08:20PM (#12356161)
Have you tried working with Laravel 5.2+ ? Instead of doing tons of for-loops, etc..

You can easily create a collection from data and process it. For example using the DB class to get data returns an array of Std objects.

For a legacy app I'm working w/ --it needs to be an array of arrays... I could for loop, and then add each to a new array.. or I can simply do:

$data = DB::table('something')->where('something')->get();

return collect($data)->map(function($x) { return (array) $x });

There's a talk at lara-con on using collections to replace just about all loops, and it's pretty insightful and makes code so much more readable and enjoyable.

PHP by itself can be ugly -- but the Laravel community has created something beautiful from what used to be akin to horse shit.

Re:Why People Should Learn Python by dreistdreist on Thursday August 25, 2016 @02:53AM (#12357309)
Laravel is still horse shit that does not follow good OOP practices.

Static calls and active record are not good OOP. Neither are Std objects.

Have a look at doctrine if you need an ORM. Otherwise read up on DDD and SOLID.