I'll preface things with, I don't care about the cleanliness/consistency/correctness of languages, I really just care about tools to get a particular job done. PHP isn't sexy, hell, it might be classified as a backwater these days. Fact is, it is a simple language, it works, and a whole lot of useful tools are built on top of it. I've done many bad things with PHP, some I will admit to, some I won't. Hell, I built a…
PHP: A fractal of bad design
211–220 of 514 posts
Re: PHP: A fractal of bad design
#212Earlier quoted context omitted.
Until people stop using PHP I welcome detailed critiques of the language. There are still enough PHP apologists out there that we can use all the ammunition we can get.
Why do you care so much about what other people use to get a job done? Care about what you use.
Re: PHP: A fractal of bad design
#213Sure, PHP is full of inconsistencies and irregularities. You know what else is? English.
... and that's why we don't use English as a programming language.
Re: PHP: A fractal of bad design
#214JavaScript was rushed to the market in a few weeks so it is also a fractal of bad parts, for example, the == operator sucks just like in PHP, the + operator is used for both addition and concatenation, semicolon insertion has an unintuitive behaviour, etc. See JavaScript the bad parts for more detail. The entire web is built on a terrible foundation with languages like JavaScript and PHP that it is a wonder how it go…
Re: PHP: A fractal of bad design
#215Earlier quoted context omitted.
You're right. This is a supply-and-demand problem : which choices does non-programmers or casual programmers have when they want to create an app ? How can someone who's working or studying 40+ hours a week find the time to learn the basics of MVC, inheritance etc ... There is a demand for easy to create template-based websites and PHP is the only kid in town for this kind of things.
This is no excuse. If you want to learn how to do something, effort is required. How much time will that person waste in the long run battling all of the problems and traps PHP brings with it? I contend that learning a proper language will be of greater benefit to a person just starting web-development, and putting in just a few extra hours at the beginning to get a solid foundation will in fact save them time in the…
Now you have two options. One is to learn the entirety of automobile engineering before touching your car, second is to learn enough fix the problem for the moment. Needless to say any normal person will prefer the second approach.
Now some mechanical engineer may make an argument that this small quick fixes are harmful for long term mechanical engineering practices. But for the guy who does this quick fixes, none of this matters or is even relevant.
Re: PHP: A fractal of bad design
#216Re: PHP: A fractal of bad design
#217"(And strictly speaking, Facebook isn’t written in PHP; it’s written in a C++ macro language with a striking resemblance.)" I'm a Facebook engineer who works on the HipHop compiler and HipHop virtual machine. It's in PHP, absolutely full stop. It's amazing how much the fact that g++ is involved somewhere in the toolchain confuses people in this matter. C++ is just an intermediate representation; the source language r…
Re: PHP: A fractal of bad design
#218JavaScript was rushed to the market in a few weeks so it is also a fractal of bad parts, for example, the == operator sucks just like in PHP, the + operator is used for both addition and concatenation, semicolon insertion has an unintuitive behaviour, etc. See JavaScript the bad parts for more detail. The entire web is built on a terrible foundation with languages like JavaScript and PHP that it is a wonder how it go…
JavaScript has its bad parts, but it's nowhere near as bad as PHP in its bad parts. JavaScript has some really good ideas in it as well. Plus, it's actually quite easy to code in JavaScript avoiding the bad parts.
I am not familiar with any precise quantification of the bad parts of JavaScript and PHP which could serve as a basis of that conclusion. That said, both PHP and JavaScript are web scripting languages that are full of bad parts. Extrapolating outwards, the entirety of modern web development is flawed.
> Plus, it's actually quite easy to code in JavaScript avoiding the bad parts.
In a sense it is harder to avoid the bad parts of JavaScript because it is tied to the browser platform, with PHP you can avoid basically all of its bad parts by simply using a different language like Clojure or Scheme.
Re: PHP: A fractal of bad design
#219I'm going to be unfair and quote just two words from the article: > empowered amateur PHP is a gateway drug to web development. And that's awesome. With almost every other popular web development language I've heard of[1], there's this grey area between "my app works on my local machine" and "my app works on the server" that is really hard to grok as a beginner. There's a reason entire businesses are built on the ide…
I find it odd how many people keep saying it's that simple to push PHP code to a box and get it working. Sure, if you've got crazy simple requirements it's generally a cinch. Once you do anything remotely non-trivial (want to read from a file? use some third party library, handle errors in a consistent manner) then you start hitting into issues with file permissions, PHP version differences, modules not compiled in b…
While the beginner will love being able to open up an FTP client (probably one that's a browser extension) to upload a few files they've changed, that's not going to fly for us.
We want proper deployment, source control, and for it to be used properly. We don't want to go anywhere near patching code directly on the live server. Just make sure the fixes are committed, nothing's broken, and run the deployment script of choice.
The requirements for 'simplicity' are completely different. And it's for this reason I think Rails and Django* and the like become attractive prospects for developers who want a more reliable, consistent environment.
* I'd struggle to list a PHP framework here because each one has a different vision of what the 'PHP way' is, probably because there is no 'PHP way'.
Re: PHP: A fractal of bad design
#220Earlier quoted context omitted.
I agree with you and I'm really surprised in 15 years, or how over old PHP is, THERE IS NOT ONE SINGLE ALTERNATIVE!! Why? For PHP I sign up for one of the million LAMP ISPs, I upload a .php file with .php embedded in HTML and I'm done. Where's the Ruby version of this? The Python version? The JavaScript version? The Perl version? THEY DON'T EXIST. You wanna use Perl or Python. You either have to use slow slow cgi or…
mod_python was notoriously unstable and is now disgustingly obsolete, it has been replaced by mod_wsgi for some years now (with the additional advantage that apps which work on mod_wsgi will work on many other servers). The reason you have trouble deploying Python is purely that the hosts you are trying to use CHOOSE not to support it. You can get really excellent, easy $10/mo Python hosting but if you ask for 'free,…
Well this is why I guess php wins. Because the other communities have complete disregard for what the common newbie considers valuable.
The question is whether something matches php's economic model. If the answer is no, its no.
You can get the hosting for $x/mo is not an answer nor a solution for most people.