Live data from Hacker News

I Like PHP

beust.com

251–260 of 269 posts

Re: I Like PHP

#251

Earlier quoted context omitted.

If you're talking about the search.cpan.org links to source, I'm right there with you. The only thing I wish they had was a way to pipe it through a highlighter like perltidy with html out. That'd probably just lead to holy wars on formatting/colours though.

MetaCPAN ( http://metacpan.org ) has a pretty source view. For eg. https://metacpan.org/source/DRAEGTUN/Builder-0.05/lib/Builde...

Awesome. search aliases duly updated.

Re: I Like PHP

#252
post #67

Earlier quoted context omitted.

> If you want to defend PHP in any meaningful way then you can't just list things that can be done easily in almost every semi-modern web ecosystem Did you ever read Python's documentation? Or Ruby's? Or Java's? Show me one popular web programming language which has a full page, up to date, with examples and user comments and version incompatibility info, per function . Of course, it's just one point and I otherwise…

> user comments Ha-ha-ha. You're kidding, right? Check strlen: http://www.php.net/manual/en/function.strlen.php Comments: 1. Comment about how PHP converts types. "Conclusion: The values are converted to string before check the lenght." 2. Comment from a novice user who posted a solution to the problem of subtracting the number of spaces in string from its length. 3. Comment about someone who thought that there was a…

When I wrote some php years ago, the comments were actually useful. They had the most up-to-date information about the latest bugs in the php standard libs.

Re: I Like PHP

#253

Earlier quoted context omitted.

Comments, Item 8: http://ycombinator.com/newsguidelines.html

guess what? You aren't going to stop me from my opinion, sorry. You sure as hell aren't stopping the mass amounts of people from down voting my above comments for merely stating my opinion on frameworks. oh and btw, my point has pretty much been proven.

Feel as righteous as you want, but bitching that you got downvoted and nobody explained and then accusing random downvotes of being young amateurs is indeed boring fucking reading.

Re: I Like PHP

#254
post #201
post #89

Earlier quoted context omitted.

This is unfortunately true. I'm a PHP programmer (currently writing a book, A Highly Negative Book About PHP , that I've been billing as "like Essential Java but tells you what not to do") and, I like to think, a fairly good one; reading this article made me cringe because this guy is emblematic of most of the problems in the PHP community. He: -accepts uncritically gobs of code dredged up via Google -considers somet…

I suspect you are missing some context here. Cedric wrote the book on unit testing (literally! [1]). He uses PHP at times when he doesn't need the reliability unit testing gives you and can't justify the extra time it takes. Given that he works at Google, I suspect his "in production" doesn't actually mean big, real sites. [1] http://testng.org/doc/index.html

I'm less astonished at his lack of unit testing (because I often eschew it in PHP projects, too) and more the, uh, everything else that he said that was horrible.

And I don't care if it's a "big, real" site or not, making mods to a live site is (almost) never good practice. Fix it offline, test it, push.

Re: I Like PHP

#255
post #213
post #149

Earlier quoted context omitted.

He was talking about small sites, in which case a deploy script, etc. is probably more trouble than it's worth.

Was I incorrect that he was talking about small sites, or do people just believe that every site regardless of size should use a deploy script and the other trappings of large application/high volume production development? Because the latter is silly.

He was but I don't think that's a valid excuse.

Doing a tested change and then a pushing to production is a 4 command overhead using git as lazily as possible with maybe an additional 5 minutes spent during initial project setup. You're doing the same coding work, you're just helping to ensure it's not going to create any completely useless work spent undoing mistakes. It's an ounce of prevention, pound of cure argument in my mind.

Re: I Like PHP

#256
post #250

My first web language was PHP, I started working with it 12 years ago. Back then you didn't have Rails, Django, ORM, unit testing (in web dev that is), and javascript was looked as a language to just show popups and have confirm()'s before submitting forms. If you wanted to connect to a MySQL, you have to do it all by yourself, you need to create a database, tables, PKs, connect to database, execute RAW mysql queries…

I don't think it's a good idea to advice newbies to learn the hardcore way. I'm exactly like you, started with PHP, had to do everything manually, etc... except I have a different opinion. The reason you and I and all the others like us put in so much effort in solving problems in PHP like CSRF, XSS and SQLI was because we were passionate enough to learn about that and then implement solutions for it. Developers who…

The point was that a good programmer is a good programmer regardless of their tools. And a bad programmer will always be a bad programmer no matter how much their tools do for them.

Spend time becoming a good programmer, and you'll be better off in the long run. If you don't want to spend that time, go find another profession...

Re: I Like PHP

#257

Earlier quoted context omitted.

For the record, "PHP: The Good Parts" is downright fucking awful. Apologies to the author if he reads this, but I'll buy him a beer and restate my opinion.

Weird, whenever I look up "PHP: The Good Parts" it comes back completely empty.

Haha, I get it! Because the language is bad! Oh, you jokester.

Re: I Like PHP

#258

The biggest problem with PHP isn't anything built into the language itself, but rather the culture of mediocrity/naivety surrounding it. As at least one other commenter has said, there are disciplined and skilled PHP programmers. If only they were the majority! Sadly, for the PHP ecosystem, a few good apples don't unspoil the bunch. Here are a few ways PHP's bad culture manifests itself. 1. Cargo culting The web is f…

> the culture of mediocrity/naivety surrounding it

Unfortunately there is also a counter-culture of elitism and condescension. I'm constantly encountering PHP devs who look down their nose at their fellow developers and assume that anyone who doesn't write sites exactly the same way they do is ignorant and full of failure.

That's the feeling I took from the article. The author _knows_ all the best practices, but sometimes he just wants to get shit done and PHP lets him do it.

Re: I Like PHP

#259
post #220
post #193

Earlier quoted context omitted.

Oh, absolutely! Except that they're more prevalent in PHP applications than anything else. It's simply way, way too easy to do the wrong thing. If you want to introduce XSS into, say, a Rails app, it's significantly more difficult; generally, you have to explicitly throw something back as 'raw'. Sure, some PHP frameworks handle it the same way, but it's rare to see this in the real world. While testing apps, PHP imme…

I'd like to think that the apparent security weaknesses in many PHP applications could be attributed to the fact that PHP was already around back when web security practices were more primitive. Thus, in your career you tend see more PHP apps that were badly-implemented.

Agreed. The older a PHP application is, the more likely it is to have incredibly serious security vulnerabilities. But I've looked at and broken plenty of vulnerable applications that were written within the past couple years.

Re: I Like PHP

#260

The biggest problem with PHP isn't anything built into the language itself, but rather the culture of mediocrity/naivety surrounding it. As at least one other commenter has said, there are disciplined and skilled PHP programmers. If only they were the majority! Sadly, for the PHP ecosystem, a few good apples don't unspoil the bunch. Here are a few ways PHP's bad culture manifests itself. 1. Cargo culting The web is f…

I can't disagree with much of what you said. However, you are being too critical of Drupal. "the chunks of functionality you download are not likely to match your needs perfectly, so you're forced to make due with software that's almost what you want" Drupal starts you off with 80% of the product functionally complete (!), for free, and leaves you with the spit and polish jar to squeak out the other 20. I find that t…

"Drupal starts you off with 80% of the product functionally complete (!), for free, and leaves you with the spit and polish jar to squeak out the other 20. I find that this 80/20 rule is true for even very complex products. The lazy developer will never do that remaining 20%; this says nothing about Drupal."

I agree with that statement 100%. I don't think Drupal forces you to build a half-finished site with ten security holes. My problem is that lots of people do anyway. I don't necessarily blame Drupal for this phenomenon. I just think it's emblematic of a culture of quick and dirty coding that ultimately makes life harder for professionals and our clients.

Post reply on HN