Live data from Hacker News

High Quality PHP

acquia.com

81–90 of 98 posts

Re: High Quality PHP

#81
post #22

It is really easy to talk smack about PHP because as a language it is not the prettiest, best designed, or cleanest language out there. It often leads to some very gross code. However, programmers write ugly code in every language and even in a much more beautiful language like Ruby, there are so many projects that end up with ugly codebases, poor performance, etc. that PHP by no means holds an exclusive ownership of…

You can trot out the trope about how you can write good code or bad code in any language as many times as you wish but it will not change the fact that php makes it unnecessarily difficult to write good code and, through both the language's and its standard library's misfeatures as well as the surrounding culture of sloppiness, encourages writing bad code.

Nailed it. The sea of bad habits has bred an ocean of bad code.

Re: High Quality PHP

#82
post #26

Earlier quoted context omitted.

That's true. But why make it worse by choosing a bad language. Surely you have good practice and a language that makes it easier.

You wanna know why PHP is so popular and why many people chooses it? Because it's so easy to get started using. Compare that to almost any other language out there that is a nightmare to set up. At the end of the day the code if it works it works and PHP just simply works. Not for everything but for most things.

If I didn't use PHP, I would have to explain to my clients who just want a simple website for business x why it's written in a language they've never heard of, that they can't find cheap maintainers for, and can't host just anywhere they like. PHP has the advantage of being able to create "black box" solutions for non-technical clients because the hosting environment is ubiquitous and you can just throw a rock out of your window and hit a Wordpress developer, and 9 times out of ten all you need to deploy with is FTP.

Re: High Quality PHP

#83
post #80

Earlier quoted context omitted.

While we're at it, how about you dig up some blog posts where someone switched to PHP after failing with alternatives?

Here you go -- a classic post by Hacker News heartthrob Derek Sivers, founder of CD Baby, "7 Reasons I Switched Back to PHP": http://sivers.org/rails2php I threw away 2 years of Rails code, and opened a new empty Subversion respository. Then in a mere TWO MONTHS, by myself, not even telling anyone I was doing this, using nothing but vi, and no frameworks, I rewrote CD Baby from scratch in PHP. Done! Launched! And it…

I hate to sound like an apologist, but the fact it was 2 years of Rails code thrown out in 2007 seems highly relevant to the context of the article.

This was also a rewrite. He already shot himself in the foot with PHP the first time around, then chose this brand new thing called Rails as his basis of a new codebase about as early as humanly possible without your initials being 'DHH', then went back to PHP for several reasons, some of which are still hotly debated today (SQL vs ORMs, frameworks vs. custom code or minimal frameworks, etc).

It's disingenuous to draw any conclusions about Ruby or Rails today from its state 7 years ago (likewise for PHP).

Re: High Quality PHP

#84
post #22

Earlier quoted context omitted.

You can trot out the trope about how you can write good code or bad code in any language as many times as you wish but it will not change the fact that php makes it unnecessarily difficult to write good code and, through both the language's and its standard library's misfeatures as well as the surrounding culture of sloppiness, encourages writing bad code.

blindhippo: you are hellbanned. Most readers cannot see your comments.

As a casual HN reader and as one who doesn't post comments that often, I have to say, that shit exists here??? my god, so we're basically reddit? So do we have a hivemind too?

This isn't directed at you. I just didn't realize HN was part of that nerd subculture. I thought HN was for adults.

Re: High Quality PHP

#85
post #77

Earlier quoted context omitted.

And yet FaceBook used HipHop when that became to big a of a problem. I have worked with people who make same claims as you resulting in us spending endless hours doing preparing for a scale that never happened. Guess what our client felt about that invoice? It's a pseudo problem, a theoretical problem, something that can be solved even though it might not be as elegant as the purists would like it to be. But it can b…

Yeah I'm not talking about hundreds of thousands of requests, I'm talking about three developers and fifty code files. Which I thought I made eminently clear by talking about dev scaling in my posts rather than load scaling. That isn't a "pseudo problem".

Of course it is otherwise PHP wouldn't have been so popular as it is even for more complex solutions.

Re: High Quality PHP

#86

Earlier quoted context omitted.

You wanna know why PHP is so popular and why many people chooses it? Because it's so easy to get started using. Compare that to almost any other language out there that is a nightmare to set up. At the end of the day the code if it works it works and PHP just simply works. Not for everything but for most things.

Setting up Apache to serve raw Ruby .erbs or .rhtmls like you'd serve .php files out of a folder is nearly identical in length and difficulty of steps if you're configuring it yourself: http://iamjamesblog.wordpress.com/2011/11/14/configure-apach... Nobody does it because there's just no demand for two crappy default hosting configurations (this isn't even a criticism about PHP the language, it's just a bad model to…

Thats not what i meant but fair enough I could have been more clear. I was talking about setting up as in getting started.

Download MAMP or create a folder with your web host.

That's it you are ready to create a web application.

Now find me one other system that makes it just as easy.

Re: High Quality PHP

#87
post #65

It still baffles me that whenever an article like this comes up, people still justify choosing PHP because of its ease of setup compared to other languages . Seriously? What are you going to tell me next, that you chose Ruby because the "Hello World" tutorial was 15 minutes shorter, than the Java one? Come on now. Yes, the fact that PHP is easy to setup may explain its popularity, it doesn't however justify choosing…

Lots of hate for php in this thread, but this has me thinking: does anyone know a better solution to solve my problem? I have to build a CRUD-like webapp for some database, and with a bunch of authentication and authorization. Lots of forms and reports, think MS access. I was planning to use symfony2 and a generator bundle for this, as symfony2 has those things build in and the generator will write a lot of the code i need. I'm also pretty time constrained (2 weeks), but I'm still curious what other options there are out there or how other people would solve this.

Re: High Quality PHP

#88

Earlier quoted context omitted.

Setting up Apache to serve raw Ruby .erbs or .rhtmls like you'd serve .php files out of a folder is nearly identical in length and difficulty of steps if you're configuring it yourself: http://iamjamesblog.wordpress.com/2011/11/14/configure-apach... Nobody does it because there's just no demand for two crappy default hosting configurations (this isn't even a criticism about PHP the language, it's just a bad model to…

Thats not what i meant but fair enough I could have been more clear. I was talking about setting up as in getting started. Download MAMP or create a folder with your web host. That's it you are ready to create a web application. Now find me one other system that makes it just as easy.

http://railsinstaller.org

Re: High Quality PHP

#89
post #77

Earlier quoted context omitted.

Yeah I'm not talking about hundreds of thousands of requests, I'm talking about three developers and fifty code files. Which I thought I made eminently clear by talking about dev scaling in my posts rather than load scaling. That isn't a "pseudo problem".

Of course it is otherwise PHP wouldn't have been so popular as it is even for more complex solutions.

That doesn't follow. Loads of software is written with inferior and suboptimal tools for all manner of reasons. Unix was first written in PDP assembler. That doesn't mean it was a good idea, it means it was done.

Popularity is a bad, bad metric of a tool's quality.

Re: High Quality PHP

#90
post #89

Earlier quoted context omitted.

Of course it is otherwise PHP wouldn't have been so popular as it is even for more complex solutions.

That doesn't follow. Loads of software is written with inferior and suboptimal tools for all manner of reasons. Unix was first written in PDP assembler. That doesn't mean it was a good idea , it means it was done . Popularity is a bad, bad metric of a tool's quality.

It means it was a good enough idea and apparently a strong enough tool.

Yours or mine definition of quality is of no importance to this discussion.

Post reply on HN