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.
High Quality PHP
81–90 of 98 posts
Re: High Quality PHP
#82Earlier 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.
Re: High Quality PHP
#83Earlier 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…
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
#84Earlier 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.
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
#85Earlier 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".
Re: High Quality PHP
#86Earlier 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…
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
#87It 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…
Re: High Quality PHP
#88Earlier 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.
Re: High Quality PHP
#89Earlier 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.
Popularity is a bad, bad metric of a tool's quality.
Re: High Quality PHP
#90Earlier 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.
Yours or mine definition of quality is of no importance to this discussion.