Live data from Hacker News

PHP: A fractal of bad design

me.veekun.com

471–480 of 514 posts

Re: PHP: A fractal of bad design

#471
post #123

A nit: "Subclasses cannot override private methods. Subclass overrides of public methods can’t even see, let alone call, the superclass’s private methods. Problematic for, say, test mocks." IMHO you don't want private methods to be visible in subclasses, because this makes the fragile base class problem worse. If I'm a framework developer working on a UI library, I should be free to add private methods to my Button c…

Well, that's coming from the perspective of someone who doesn't like "private" in the first place; it forces me to rely on whatever use cases the author has imagined and makes extending the class in a novel manner a pain. Except this is PHP, so I can just go change the "private" to "public" anyway. Namespacing within an inheritance tree is a problem, yes, but just hiding as much of your namespace as possible sucks. A…

> it forces me to rely on whatever use cases the author has imagined and makes extending the class in a novel manner a pain

It's purpose is to isolate you from implementation details you're not supposed to care about and allow the library/framework developer to update their code without fear of breaking your components. It's also a form of enforced documentation.

Re: PHP: A fractal of bad design

#472
post #12

> PHP ... bad design PHP wasn't "designed" ... it evolved. Pieces were added, here and there, re-factored, deprecated, etc. etc. PHP is a natural language. It wasn't fabricated at some university, nor in the lab of some billion dollar company. It evolved. That is its strength. It is the most adaptable language around. It can be used for anything and it has been used for everything. And that is why it is the most popu…

> That is its strength. No. That's it's weakness. Programming languages are not like natural languages. PHP did not emerge spontaneously from conversations amongst PHP programmers -- people actually sat down and wrote code . When that happened, they had the choice to exercise some degree of higher thought. They did not do so. PHP is a perfect example of how local optimality -- slap on the first thing that "works" --…

The implicit assumption here is that the world doesn't change. PHP comes from the world of Perl, C, and ASP/VBScript. Procedural programming, embedded HTML, etc. It's impossible to predict the future.

Other languages have evolved as well; Python has changed significantly from it's earliest incarnations. And, during the time of early PHP, Python was a complete failure as web language.

Re: PHP: A fractal of bad design

#473
post #465

Earlier quoted context omitted.

The article lists "E_ACTUALLY_ALL" as if it's really a PHP constant. I'm not sure the author has even used PHP -- this is just a bunch of information culled together from different blog posts with very different levels of understanding. There are many things that are just factually wrong with it. I could complain about PHP all day but at least I know what I'm talking about!

really? that's your example? I read that constant name very clearly as "snark". If that's the best you can come up with then I think you just made my point for me.

You didn't notice this comment http://news.ycombinator.com/item?id=3821029 posted 21 hours ago only 2 comments below this one. Really?

Re: PHP: A fractal of bad design

#474

Earlier quoted context omitted.

> That is its strength. No. That's it's weakness. Programming languages are not like natural languages. PHP did not emerge spontaneously from conversations amongst PHP programmers -- people actually sat down and wrote code . When that happened, they had the choice to exercise some degree of higher thought. They did not do so. PHP is a perfect example of how local optimality -- slap on the first thing that "works" --…

The implicit assumption here is that the world doesn't change. PHP comes from the world of Perl, C, and ASP/VBScript. Procedural programming, embedded HTML, etc. It's impossible to predict the future. Other languages have evolved as well; Python has changed significantly from it's earliest incarnations. And, during the time of early PHP, Python was a complete failure as web language.

Again, Python et al have not evolved. They have continued to be modified and refined by the deliberate application of thought, particularly the kind of insightful, discursive thought that programming language design calls for.

Re: PHP: A fractal of bad design

#475

Earlier quoted context omitted.

The implicit assumption here is that the world doesn't change. PHP comes from the world of Perl, C, and ASP/VBScript. Procedural programming, embedded HTML, etc. It's impossible to predict the future. Other languages have evolved as well; Python has changed significantly from it's earliest incarnations. And, during the time of early PHP, Python was a complete failure as web language.

Again, Python et al have not evolved. They have continued to be modified and refined by the deliberate application of thought, particularly the kind of insightful, discursive thought that programming language design calls for.

The point is, Python wasn't (and perhaps isn't) perfect. Mistakes were made. Fixes introduced. PHP continues to be modified and refined as well. PHP developers are hard working developers with a difficult job; I can't help but think you're being insulting to them.

Re: PHP: A fractal of bad design

#476
post #220

Earlier quoted context omitted.

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,…

You can get really excellent, easy $10/mo Python hosting but if you ask for 'free,' beggars can't be choosers, so you will get whatever they feel like giving you. This is not a function of the underlying technology. 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 t…

Instead of blaming "the other communities" blame the web hosts which decide that they only like to support PHP out of the box. Many other languages can be made easy to deploy on shared hosting, it is up to the host to actually do so. Nobody can force them.

Re: PHP: A fractal of bad design

#477

Earlier quoted context omitted.

People hate PHP because it's an incredibly stupid and frustrating language to use, and most of the people who use it don't know anything else. The money comes from them fucking things up, and their boss having to call in people who know what they're doing to fix it (aka. hack it back into some semblance of "working"). The amount of waste that goes on in most PHP shops is what irks me - use the right tool, spend at le…

>>The amount of waste that goes on in most PHP shops is what irks me - use the right tool, spend at least 50% less time working around stupid quirks. Yeah, but why would you care unless you're begrudgingly participating in the PHP industry? It's not your problem unless you make it your problem - i.e., if you're so against it, don't work in a PHP shop, don't take PHP contracts. Problem solved - if other people want to…

Even those of us entirely outside the PHP economy (mobile, desktop, big-iron server) occasionally stumble into a monster of a mess that some PHP idiot left behind, and have to clean it up (usually by just replacing it outright, because PHP isn't worth maintaining).

The money is nice, but after watching the ridiculous waste of PHP idiocy for the Nth time, you can't help but want to get people to stop.

Re: PHP: A fractal of bad design

#478

Earlier quoted context omitted.

More than half of the top level comments are from people who use PHP. You can tell by how they rush into PHP's defense and try to argue against the article. The original post just can't be sensibly called "anti-PHP snobbery". It just points out PHP's shortcomings. But when all these PHP-users can't really attack the truth, they attack how it's presented instead (and of course whip up some strawmen and generally just…

(I didn't downvote first off) PHP devs certainly know its shortcomings like JS guys know that languages too. It's not the fact that he points out the shortcomings, that's fine. What makes it snobbery is how the author points out flaws and is so passionately anti-PHP with the subtext being "what I use is superior". He points out flaws in his preferences but in a way that makes it seem like flaws in Python are acceptab…

It's easier for PHP developers to write it off as "a pissing contest" than to face the cold hard truth: PHP is, objectively, awful. There is literally no reason to choose it over today's alternatives other than market inertia, which is exactly what articles like this one are trying to stop.

Re: PHP: A fractal of bad design

#479

Earlier quoted context omitted.

They say eventually you learn to love your captor. Frameworks can help a lot, but what PHP really needs is an equivalent to CoffeeScript that fixes all of these glaring issues with PHP. Although there's issues with the PHP language implementation, the biggest problems are the enormous number of functions with quirky argument ordering that need to be understood by a developer before they're operating at full efficienc…

There's a CoffeScript-ification of PHP called Snow. You can see it here: http://code.google.com/p/php-snow/ Frameworks definitely help a lot. I've done a little work with FuelPHP, and I found that to be pretty pleasant.

It's all fun and games until you want to find a string in an array.

The entirety of the PHP API should be bundled up in a burlap bag, beaten savagely with a baseball bat, then thrown in a shallow grave to be set on fire before being buried. The "Goodfellas" treatment is way too kind in this case.

Re: PHP: A fractal of bad design

#480
post #177

Earlier quoted context omitted.

<? echo "Hello World";

Actually, you just need this: Hello world If all you want to do is print some text, just put some text outside the <?php delimiter. If you want to do nothing else, you don't even need the <?php delimiter.

True, but he/she mentioned specifically a "Hello World" in PHP.
Post reply on HN