Live data from Hacker News

PHP: A fractal of bad design

me.veekun.com

181–190 of 514 posts

Re: PHP: A fractal of bad design

#181

My goal is to move away from PHP completely by 2013 for my websites. I've recently been toying around with various methods of tying C++ to a web frontend, with varying degrees of success. My current favorite method is to use mongoose to create a very simple HTTP interface for any C(++) project (mongoose is great!) and then use AJAX and JSON for any and all communication to and fro client and server. However, this lea…

You realise that there are tools to get around the problems that you describe? Linters and automated testing will both catch the sorts of problems that you're having.

Re: PHP: A fractal of bad design

#182

I had a one-to-one talk with Rasmus Lerdorf a few weeks ago. This is one of the few things he said: " I wrote PHP as a hammer to do my stuff. Around 1993, the only way to write web apps was by hacking C and Perl. This was extremely painful, and you would have to do the same thing over and over again. So I started writing a tool which would make my work easier. " " I never thought while writing PHP that someday millio…

Do you have this in audio/video? It would be nice to hear/see this exchange.

Re: PHP: A fractal of bad design

#183

All those words, and yet the word template only appears once. And that's to assert that PHP has: …no template system. There’s PHP itself, but nothing that acts as a big interpolator rather than a program. As if that was a bug and not a feature. PHP succeeds because there is one PHP templating syntax and it is called "PHP" . PHP started life as a templating language, and that's where its soul lies. Which is important,…

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.

Re: PHP: A fractal of bad design

#184
post #42

I'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 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…

> Where's the Ruby version of this? The Python version? The JavaScript version?

heroku ? you don't even have to upload anything manually, a single command deploys your app.

Re: PHP: A fractal of bad design

#185

Earlier quoted context omitted.

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 by default, etc etc. Although PHP suffers from this, I'm not sure it is alone. I suffer a lot of pain sett…

I have a feeling you've gotten so used to deploying PHP that you've forgotten all the headaches involved in it. I idle in about 3 irc channels that provide PHP support, and pretty much every day someone comes in with some deployment related problem. Someone will come in complaining that they can't read some file (the user apache is running as can't traverse into that directory), complain about some missing function (…

I have a feeling you've gotten so used to deploying PHP that you've forgotten all the headaches involved in it.

That's precisely my point! :)

and even though there were tons of very smart guys, mostly everybody we brought onto the project took a whole afternoon to get set up. To me that's unacceptable.

As mentioned, I can rattle out a PHP environment in minimal time (basically as long as it takes for the installers to run). But task me to work on a Python project, or Rails, it will take a lot longer.

I think my larger point was that for an absolute beginner PHP offers some key advantages over other languages (even you simple description of jumping into Python involves some major pain points - like using Linux, the command line, package management, what is git/hg?).

The advantage to PHP is purely that it is intended as a web language; Python, Ruby et al require additional steps to get to that stage (or, at least, steps that are not braindead-automated for beginners).

Re: PHP: A fractal of bad design

#186
post #2

This is just another example of someone beating a dead horse (which has already been beaten) for page views. Next week we'll have another "bash php" post, and the week after that another. I wish people spent as much time creating new things as they did bitching. As well written as this article is, it contains absolutely nothing that hasn't been said ten thousand times already- in fact, most of this seems to be regurg…

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

#187

Didn't we all go through this? 1. Ooo, PHP is awesome, I can make stuff happen on a server! 2. Hm, well, PHP has its problems, let's open source a microframework to fix it! 3. Oh my god, PHP is horrible, let's rant about it on a blog! 4. Who cares that PHP is horrible? It's the application that counts. OP is at step 3, currently.

5. I'm getting old, and life is too short to write PHP.

Re: PHP: A fractal of bad design

#188
post #117

Earlier quoted context omitted.

Please enlighten me! I'm interested in correctness. The "non-programmers" remark refers to a quote from the PHP 2.0 documentation. I tried to minimize the editorializing.

> Operators are very fragile in the parser; foo()[0] and foo()->method() are both syntax errors. The former is allegedly fixed in PHP 5.4, but I can’t find mention of a fix for the latter. The latter doesn't need a fix because it always worked. Honestly, how hard is it to test that foo()->method() works? > == is useless. Actually, it's not useless. It does have a few stupid edge-cases and I will admit that. But in mo…

Just because once you've learned an unintuitive, quirky, magic trick in a language that becomes useful doesn't mean it was worth being added. Many of your counterpoints seem to be "you don't like foo? I find foo useful." miss the main argument: nobody ever said bizarre things like "@" aren't useful in cases where you need them. The criticism is that things like this were just thrown into a giant pile with no regard to consistency, expectations, elegance, etc.

Re: PHP: A fractal of bad design

#189
post #42

I'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 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…

We don't WANT to replicate PHP's deployment model! It's hard to scale, it's hard to configure, it's hard to secure, it's hard to make work across different web servers. It's convenient for newcomers, sure, but even for something like phpbb the model is strained. We need better deployment tools, not worse forms of deployment.

Re: PHP: A fractal of bad design

#190
post #132

Earlier quoted context omitted.

You would do us all (author included) a favor by pointing them out. Why would you take the time to complain about the articles veracity without providing a single correction?

Because it's late and took such a long time to do! I've posted it in another reply. My wife is actually wondering why I haven't gone to bed yet.

Makes me immediately thinking of http://xkcd.com/386/ ;-)
Post reply on HN