Sure, PHP is full of inconsistencies and irregularities. You know what else is? English.
PHP: A fractal of bad design
231–240 of 514 posts
Re: PHP: A fractal of bad design
#232Until there is something else where you can deploy a prototype by dragging a single file onto a server with a FTP program, then PHP is serving a purpose that no other language can meet.
So stop crying about how PHP is horrible; stop trying to fix what is obviously a broken language; make something else that can fit this need, and you will kill PHP.
The only reason why still PHP exists past hobbyists is because people who start businesses want a fast prototype, cheap hosting, and no fuss. It may not be ideal, secure, fast, scalable, maintainable, or anything else, but if it's making money in the shortest amount of time possible, with the lowest cost barriers, then it's a success.
Re: PHP: A fractal of bad design
#233Since my day job is PHP-centric and I was already aware that PHP is awful, this is theoretically helpful to me, but oh lord, it makes my liver hurt. If I could get away with it, I'd never again trust my credit card number to a system based on PHP, but I suspect that that's about as easy as never trusting your credit card to an ATM/point-of-sale machine based on Windows.
That PHP logo trick is going to make it easy to spot companies with a wobbly PHP stack. http://www.0php.com/php_easter_egg.php
Re: PHP: A fractal of bad design
#234Sure, PHP is full of inconsistencies and irregularities. You know what else is? English.
What English is good at is expressing a huge variety of ideas. I once heard someone argue on NPR (sorry, no citation) that English is perhaps the /best/ language at expressing absolutely any idea to another person precisely because it has such a huge vocabulary and so many idiomatic phrases. I've sometimes heard of programming as an art, like poetry, but if so I'd prefer to maintain that it is a minimalist art that e…
And LISP is the best programming language there is, even if I don't know most of the other programming languages, because LISP has macros.
I highly doubt it anybody is qualified to make such statements, because you'd need to speak fluently every language there is, just to be sure. Seems like somebody just wanted to feel better because his language is the best.
Re: PHP: A fractal of bad design
#235Earlier quoted context omitted.
> 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…
Only a couple of these things are outright wrong; I removed the offending bullet points earlier tonight. A few things I listed because they're weird, not outright wrong, and I stand by those. For the most part you've defended PHP's behavior as design decisions or offered workarounds. Workarounds just demonstrate that the language is Turing-complete. Design decisions are only okay if they actually make a useful tradeo…
PHP has a module system: Namespaces and the class autoloader.
Re: PHP: A fractal of bad design
#236Earlier quoted context omitted.
Those bridges weren't continually "enhanced" by slapping on more stone and wood (at least not the ones that remained standing for long). Each bridge was a fresh design, based on the best practices of the day. Kind of like new programming languages.
20-something centuries ago, without the benefit of calculus or Newtonian physics, Romans were better engineers than Rasmus Ledorf.
And they put bridge designers beneath the bridge when legion crossed it for the first time. If we started to do equivalent for programmers, we would have much better code quality :)
And in regard to programming language design we don't have calculus, either. We're just experimenting, and trying to repeat what works.
Re: PHP: A fractal of bad design
#237One of the main reasons why I am so scared to use Wordpress is PHP. The article does a good job explaining why security holes in applications built on PHP wouldn't be a surprise. The only alternative is to constantly upgrade to the latest version. Sometimes, that breaks things like plugins. That is too much overhead for a blog.
Re: PHP: A fractal of bad design
#238I've been to some conference lately and next to me was a guy sitting excited about the high traffic system he's building—I asked about the language he is using: He (playing with his iPad 3): PHP Me: I thought PHP devs died out for years?? He (angry): PHP is still the most used language for the web and it's fast. Me: Do you guys still mix front-end and back-end code? He (still angry): Of course not. Back home I starte…
I've just spent the weekend porting an old site to Silex and Twig (a PHP equivalent to HAML) and its been a breeze.
Both frameworks come from the same people and have excellent documentation and support (i.e. they are not run by a couple of geeks somewhere who might suddenly stop developing them once they get bored). See: http://symfony.com/elevator-pitches
Re: PHP: A fractal of bad design
#239stack traces? learn to throw exceptions and I'm given a very nice stack trace.
complaining ftl..
Re: PHP: A fractal of bad design
#240Those who think otherwise are most likely stalwart proponents of some other language, engulfed in functional programming or have read the latest post by _____ that explains a concept that should be used only rarely and will use it as an attack to state why another language is awful.
The fact is, you will never, ever, ever convince someone that your opinions are better than their own if they don't already think those things. Every language sucks and every language is awesome. Get over it. Bootstrap/CSS, HTML, jQuery and the database are easily 80% of the code of any generic site that isn't a business. The rest is Database access, AJAX functions, Auth, View rendering and hopefully security - and while important are very small in comparison to the grand scheme of things.
You don't need sockets. You don't need Duck typing. You don't need event-driven functionality to do most of the things you find on the internet. Those things are fun, but are not that important in the long run.
PHP is outdated, seemingly random and can let you write terrible code. It also does not get in your way if you are a competent developer and shortcomings are slowly being addressed, which is a good thing. When was the last time you wrote a site that NEEDED the things PHP is missing as a language?