4 ms·
> I have never felt so uninspired by a language. I agree with this sentiment very strongly. I understand that there's a lot of hate, flamebait, etc etc about t
by chias 10y ago
> I have never felt so uninspired by a language.
I agree with this sentiment very strongly. I understand that there's a lot of hate, flamebait, etc etc about the language, with which from my own experience I agree with or disagree with in fairly equal parts. At this stage, I have written more large web projects in PHP than any other language (for varying reasons). I don't proselytize on why it is (or is not) a good language. But for me, personally, a huge chunk of whether I'm happy or not comes from whether I feel inspired while I'm working. Quite separate from the excitement of solving problems: while working with Rust or Python, I get excited, and am generally happy (even when fighting with Rust's compiler); while working with PHP, I tend to feel vaguely annoyed. Take from that what you will.
I'm of the opinion that the best tool for the job is the one you know how to use, and in the real world of deadlines and opportunity cost, if you get a great PHP dev to write your application in Python it's going to be far more expensive and far worse than if it had been written in PHP. But it's also going to be far less fun to both write and maintain. I think you have to make your language decision depending on your priorities.
> the egregious security issues in PHP have been fixed
This I strongly disagree with. And I don't think it's possible. It's not that the existence of the language includes vulnerabilities, it just makes it extremely difficult to write applications securely. I actually teach an upper-division university class on Network and Application Security, I am writing my PhD dissertation on the topic. I have worked on the internal security team of a very large company, and I have worked as a penetration tester / security auditor. I am very familiar with the vulnerabilities that plague web applications. And I still occasionally find the odd XSS vulnerability, timing concurrency attack, etc. in PHP code that I myself have written. And most PHP applications are not written by people with my background.
- 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.