4 ms·
"while working with PHP, I tend to feel vaguely annoyed" Exactly! I was never satisfied with my PHP code, as there does not seem to be a better and worse answe
by TheLarch 10y ago
"while working with PHP, I tend to feel vaguely annoyed"
Exactly! I was never satisfied with my PHP code, as there does not seem to be a better and worse answer in many cases.
For the record I did not mean to assert that PHP has become secure, I meant that I presumed it had. Some years ago it was a laughingstock on Bugtraq.
Thanks for the feedback!
- gremlinsinc 10y agoHave 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.
- dreistdreist 10y agoLaravel 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.