9 ms·
PHP is broken in many little aspects but if you use a high quality framework, it's quite enjoyable to work with. The main gripes I have with it are in the detai
by Produce 14y ago
PHP is broken in many little aspects but if you use a high quality framework, it's quite enjoyable to work with. The main gripes I have with it are in the details, like:
You can't do:
$something->doStuff()[0]
if(empty($something->doStuff()))
Overload fucking functions. Fuck.
What sucks:
The namespace separator.
The naming conventions of the core functions.
The speed.
But, overall it works and elegant solutions can be written.
Also, being competent in a market full of incompetents makes you valuable and getting a well paying job is easy. What's not to like about that?
- xd 14y ago"You can't do: $something->doStuff()[0]" Yes you can. "Speed" Care to expand on this one?
- mgkimsal 14y ago"You can't do: $something->doStuff()[0]" Yes you can. ------------- AFAIK, yes, in PHP 5.4 only so far, which is only about 4 months old. The first 15+ years of PHP's life, no, that wasn't possible. I'm glad it's there now, but frustrated it took so long.
- Produce 14y agoDid not know this!
- steelaz 14y agoPHP has array dereferencing, closures, and array short syntax since 5.4. $func = function() { return ['a', 'b', 'c']; }; echo $func()[0];
- eru 14y agoNice to hear that they fixed those. I just read about the new closures. Too bad, scoping is still somewhat broken: You have to explicitly declare the variables you want to use from the outer scope.
- RobAley 14y agoSpeed isn't an issue, at least in my experience, compared to similar languages. Raw PHP usually beats Rails handsdown, and most PHP frameworks are usually comparable. PHP performance has increased markedly over the past few years, and particularly in v5.4. And if you really need a speed bump you can use the APC cache or HipHop compiler. Its never going to be as snappy as, say, C, but in the class of languages its in these days it holds it head up high. I like the namespace separator, but I'll accept I’m in the minority on that one.
- papsosouid 14y ago>Raw PHP usually beats Rails handsdown, and most PHP frameworks are usually comparable Being able to keep up with the slowest competitor in existence isn't very good.
- RobAley 14y agoThe reason I cited Rails is that its usually proposed as the better alternative in these anti-PHP threads. Most "high" performance PHP doesn't use one of the usual-suspects in the framework world and can easily beat Rails (and usually plain ruby too). Edit: I should add "in my experience" to the end of that, I have no stats to hand.
- papsosouid 14y ago>Most "high" performance PHP doesn't use one of the usual-suspects in the framework world and can easily beat Rails (and usually plain ruby too). If you skip a framework on both languages, they end up as the two slowest languages. Hard to say if either is faster overall, but they are both awful. Using jruby provides a huge performance increase, and PHP really has nothing to compare with that.
- RobAley 14y agoTo be honest I've not used jruby. It would be interesting to see how it compares to implementations PHP on the JVM such as IBM's WebSphere sMash, and Caucho's Quercus. Do you have any views on the performance of jruby vs hiphop'd PHP?