Live data from Hacker News

PHP: The Right Way

phptherightway.com

111–120 of 233 posts

Re: PHP: The Right Way

#111
post #80

The comments about namespace are somehow ironic: is it very common to find developers that know what classes are but not namespaces? The namespace concept is much simpler than class. Which makes me wonder: who is the target audience?

It's only been in the last 2 years or so the php web hosts have upgraded to version 5.3, which is when namespaces were added.

There are a LOT of long term php developers who have never used them.

Re: PHP: The Right Way

#112
post #92

Earlier quoted context omitted.

Yes, how dare he talk about the problems with PHP in the comments on a site dedicated to talking about how to avoid problems with PHP. Seriously, WTF? Are people actually offended that discussion of PHP's defects take place in a conversation about PHP best practices?

I think it is because we (as a community) should be past the piling-on stage and on to the constructive discussion stage. Snark doesn't add to the discussion.

I don't intend to jump into the ring, but as an observer, I don't think we're at that point yet. Here's the progression of the current anti-PHP flare up:

  Jeff Atwood says PHP sucks
   |- Says we should make other languages fill in on what PHP does best
   |- Post goes on HN
      |- PHP apologists say "No! PHP is fine, I've made a career out of it!"
      |- 'Atwoodians' continue to reject PHP, ruby/python need to be more accessible
      |- PHP apologists make reasonable arguments for why PHP isn't as bad as everyone says, while admitting its probably worse than python/ruby

There remains a conspicuous lack of response from the 'Atwoodian' camp regarding what could be done to add PHP's quick-start strengths to other languages so that PHP developers can develop similarly to how they currently do, just with a less wonky and problematic base language.

By no means, as an outsider, do I perceive the PHP apologists as having redeemed PHP to the point that the discussion should be about 'how to fix PHP' rather than 'how to discourage its propagation' as was originally put fourth in a fairly reasonable way by Atwood.

I realize why saying 'PHP apologists' is problematic, but I'm mostly seeing responses that are in themselves critical of PHP, while espousing its widespread use, quick-start capabilities, and developer intertia--and not espousing why the fundamentals of the language are better of the equals of ruby/python.

Re: PHP: The Right Way

#114

Earlier quoted context omitted.

PSR-2 isn't trying to say that there is one correct answer. Instead they're trying to provide a single answer from the many valid possibilities. "When various authors collaborate across multiple projects, it helps to have one set of guidelines to be used among all those projects"

Exactly, this is what infuriates me about the arguments and whining against PSR-2. Spaces, Tabs, OTBS, whatever. It doesn't matter which one was chosen, just that something was chosen. Ask the Pythonista's what PEP8 did for their developer's ecosystem. Also it's important to note that that PSR-2 was based off already existing coding standards like Zend's and Symfony's.

And what do you do with all the coders like me who would refuse to change their habits? Does the Python community have tabs holdouts who are github lepers because no one wants their code "infected"? (I don't do much in Python, I actually don't know what the community norms are.)

I think it's silly to pursue per-language consistency; it's a pipe-dream that just leads to more religious wars over minutia. Per-project (or per-organization) more than suffices.

Re: PHP: The Right Way

#115
post #101

Earlier quoted context omitted.

We get it, man. PHP sucks, you're cool/smarter/better because you use something else, and you need to remind us all about it by jumping in every time the letters P-H-P are seen in sequence to let us all know how it sucks by retreading the same old lines used by the last fifty guys who said the same thing but to your credit you really tried to be clever about it. A good portion of why people like to mock PHP is due to…

I used PHP for five years professionally, I consider myself as well positioned as many to have an informed opinion about PHP weaknesses and strengths. My diagnostic is that PHP weaknesses are structural, and no amount of guidance can fix that. If facing the choice, one should not choose PHP over other solutions. (It happens also that I am working in Chinese tech sphere, where many startup choose PHP just because it i…

He doesn't defend PHP as a language.

He is sharing some useful guidelines to approach it more properly and help people that are still using it.

I, for one, am a fan.

Re: PHP: The Right Way

#117
post #89

Earlier quoted context omitted.

I don't disagree with you, but if you've got someone actively trying to exploit you sitting between you and the Internet, you've got bigger problems.

Someone trying to find an exploit is a bigger problem than giving them one?

Oh, definitely. If someone has a launched a targeted attack against you and they already have the ability to seamlessly view and modify your internet traffic, you are in pretty serious trouble whether you download your development tools from wget or apt-get.

Re: PHP: The Right Way

#119

Earlier quoted context omitted.

Exactly, this is what infuriates me about the arguments and whining against PSR-2. Spaces, Tabs, OTBS, whatever. It doesn't matter which one was chosen, just that something was chosen. Ask the Pythonista's what PEP8 did for their developer's ecosystem. Also it's important to note that that PSR-2 was based off already existing coding standards like Zend's and Symfony's.

And what do you do with all the coders like me who would refuse to change their habits? Does the Python community have tabs holdouts who are github lepers because no one wants their code "infected"? (I don't do much in Python, I actually don't know what the community norms are.) I think it's silly to pursue per-language consistency; it's a pipe-dream that just leads to more religious wars over minutia. Per-project (o…

"Does the Python community have tabs holdouts who are github lepers"

This actually happens? People who don't understand tabs sure as hell shouldn't be lecturing other people about using them. Infantile.

Re: PHP: The Right Way

#120

Earlier quoted context omitted.

Not sure if you are trying to make a joke (and if so, it's incredibly subtle), or you are being serious. In case you are serious, to explain how HTTPS as it's used means anything about the trust-worthiness of the two parties involved?

Look at the original post. "curl -s http://getcomposer.org/installer | php" It's not just about trusting Composer, it's about trusting every point between you and their server. If I want to know that I am actually executing Composer I need to use a secure download method.

I'm looking at the post you replied to. So maybe you replied to the wrong post, or ignore context and tried to be witty or smart.

In context, what you say makes no sense.

Regardless, https would be better, but if you are that nervous as you suggest you are, then https doesn't solve your problem either. Neither does some hash thrown up on some site for you to compare against.

Post reply on HN