Earlier quoted context omitted.
Yes, it is a "good one." Wordpress' source looks like spaghetti with shit sauce. The fact that it runs is a testament to something, but not the readability, maintainability, or usability of the code base. Those people wouldn't know a well-designed API if, well, fill in the rest here.
Good point. Must be why no one uses it.
PHP needs a vision
111–120 of 182 posts
Re: PHP needs a vision
#112Earlier quoted context omitted.
Why is it a crappy tool for non web stuff? It has an absurdly large set of included tools and having all of that in one place is really handy. More concretely- what's an easy non-web task that Ruby (as you suggest learning) is great at that PHP can't handle just as easily? Not trolling here, I'm genuinely curious.
I find the guy to whom you're replying to be obnoxious, but he's not wrong about it being poor for CLI stuff. Loads of stuff non-obviously behaves differently in a web context versus a CLI context (and while it's documented, you still have to know about it). It doesn't have good stream processing facilities. It, as mentioned, requires a php.ini and requires you to think about that when you're writing scripts in it. I…
* PHP_SAPI is defined to 'cli' (as compared to 'fastcgi' or similar)
* $_GET/$_POST are empty, and $_SERVER is missing the HTTP_XXX variables (duh)
* By default, there's no max execution time
I dunno, it works perfectly fine for me. It's certainly easier to read and write than shell, and I genuinely can't think of a time that an ini directive had any effect on what I was doing - unless you count the presence or lack thereof of an extension, but everyone knows that PHP's extension handling is pretty crappy.
I guess it all depends on what you're trying to do. I agree that stream handling is a little rough, although that has little bearing on what I tend to do (YMMV).
At the end of a day, it's a tool, and I have tasks that need to be done. That tool either is or isn't capable of accomplishing those tasks, and based on my own abilities it may or may not be faster than using other tools (contrary to popular opinion, I find Ruby extremely painful to work with, and avoid it at all costs; if it works for other people, good for them!)
This could be a case of "when all you have is a hammer...", but maybe I just happen to have two nails: http://www.codinghorror.com/.a/6a0120a85dcdae970b017742d249d... ;)
/edit: typo
Re: PHP needs a vision
#113Earlier quoted context omitted.
have you ever even tried Symfony? i think a lot of the debate is about how people are starting to get fed up with the Java/c#-like direction PHP is heading. symfony is not like rails, no where close to it. not sure exactly where they started taking the wrong turn but it's really going the opposite direction from other languages like node/python/ruby where simplicity is at it's core.
PHP is one of the major corporate web languages. That is why its heading down Java street. But that's not a bad thing either. Every language covers a specific need. They can't all be everything to everybody. Sure, there is a lot of horrible PHP code (specially in the online ads industry), but that does not change the fact that the language works for the needs of a given market. I don't get why people want to turn PHP…
PHP happened to be the language that websites were written in at a time when the old Java guard came into management positions, bringing with them their failed ideas of what "professional" software design means.
I don't see why you think it is more justified for PHP to become J2EE than Rails/Django. PHP as a language doesn't support one style any better than the other. The only thing that really sets PHP apart from other dynamic languages is that it is a page template engine by default.
So if you absolutely have to ask one of those "why turn PHP into xyz?" questions, why not ask "why turn PHP into anything other than a page template language?".
The answer to all these questions is, because programming languages are indeed languages. People use the languages they know to say the the things they need to say and they use them to experiment with new ideas. That's a good thing.
Re: PHP needs a vision
#114Stas responded here: http://news.php.net/php.internals/64775 "PHP's vision is being simple and practical and focused on the web. PHP is what people use to get their first site off the ground. PHP is what a web designer learns when he/she wants to go into programming. PHP is what a random Joe uses when he needs to whip up a page and he's in "do it yourself" mind. PHP is what you expect everybody to be able to handle,…
That vision is stale and cancerous for the PHP community. The directive is and always has been along those lines, "real programmers don't use PHP". For some reason the core team has pushed that. There are a lot of us who use PHP full time who would also love for some real, cohesive decisions to be made in favour of bringing vision to PHP. Sadly the internals list is always just a shitstorm. Anthony's view is that of…
Re: PHP needs a vision
#115Earlier quoted context omitted.
How is that a fairly strong statement? Here's a much stronger one: PHP is terrible at being a general purpose language. General purpose language doesn't mean you can do things that aren't web dev in it. General purpose means that it is designed to be useful in any application. You know like Ruby, Python, or Perl. General purpose doesn't mean that those things are possible (because I agree that they are possible in PH…
Why is it a crappy tool for non web stuff? It has an absurdly large set of included tools and having all of that in one place is really handy. More concretely- what's an easy non-web task that Ruby (as you suggest learning) is great at that PHP can't handle just as easily? Not trolling here, I'm genuinely curious.
Is there a decent analog for Nokogiri? I stopped paying attention to PHP 6 years ago so I don't know, but a friend of mine needed to do some webscraping today and learned Ruby and then built his script in 5 minutes.
I checked the IRC timestamps between his "it's done installing" and his "hey, look what it outputted". It was seriously 5 minutes. He then went on to do something a touch more complicated (scraping multiple pages and a trivial analysis/report of the results) and that couldn't have been more than another 30 minutes.
(ETA: I don't know if you'd consider webscraping to be non-web. I guess we could swap it out for a bunch of XML files since that's basically the same task.)
Re: PHP needs a vision
#116Earlier quoted context omitted.
PHP is one of the major corporate web languages. That is why its heading down Java street. But that's not a bad thing either. Every language covers a specific need. They can't all be everything to everybody. Sure, there is a lot of horrible PHP code (specially in the online ads industry), but that does not change the fact that the language works for the needs of a given market. I don't get why people want to turn PHP…
Where "modern PHP style" is defined by the kind of OO frameworkization excesses that the Java community introduced to the world over 10 years ago. It's not a specific need of the enterprise, it's just a historical coincidence. PHP happened to be the language that websites were written in at a time when the old Java guard came into management positions, bringing with them their failed ideas of what "professional" soft…
I don't. But like you said (IMO, your comment is spot on), PHP has suffered from the Java mindset. Though I do think that people should not have a language do everything. But thats a problem at the enterprise level, where one size fits all.
Re: PHP needs a vision
#117Earlier quoted context omitted.
"PHP Should Be Implementation Neutral, and Support All Paradigms Equally". This is what I like about PHP. When you want a 4 page site, you can use procedural and functional programming. When you're working on an enterprise level CMS you can whip out the OO paradigm and you're set. PHP is a messy soup but it does web better than most other languages.
One nice side affect of this is that PHP can suit both novice and experienced programmers. Newbies don't have to learn OO before they write Hello World.
In a way this means nothing: experienced programmer can program in any language.
In another way it is wrong: experienced programmer know how so well that building a solid application on rotten grounds is a pain, and would prefer a more solid ground to build their application upon.
Do I need to list again all the mess in PHP?
Re: PHP needs a vision
#118Earlier quoted context omitted.
Why is it a crappy tool for non web stuff? It has an absurdly large set of included tools and having all of that in one place is really handy. More concretely- what's an easy non-web task that Ruby (as you suggest learning) is great at that PHP can't handle just as easily? Not trolling here, I'm genuinely curious.
> More concretely- what's an easy non-web task that Ruby (as you suggest learning) is great at that PHP can't handle just as easily? Not trolling here, I'm genuinely curious. Is there a decent analog for Nokogiri? I stopped paying attention to PHP 6 years ago so I don't know, but a friend of mine needed to do some webscraping today and learned Ruby and then built his script in 5 minutes. I checked the IRC timestamps…
Re: PHP needs a vision
#119Earlier quoted context omitted.
That's also a problem because anyone with a day experience in PHP can claim to be PHP developer, and often companies can't really tell the difference between an experienced and non-experienced programmer. If they can do PHP, they can build our website and we end up with horrible unmaintainable code. I think that's why PHP has such a bad reputation.
maybe we should all switch to brainfuck for web development then so we can weed out the stupids [/sarcasm]
Re: PHP needs a vision
#120PHP is for webdev. That's it. Go outside the bounds of that and it loses its magic. On its own it's great for spitting out a webpage. It's a scripting and templating language in one, which is kind of cool. That said, outside of that to make PHP work on bigger projects you end up with a lot of structure and ceremony that make PHP suck, not quite as much as Java, but it's not amazing. Thiings like testing and testabili…