6 ms·
I get the nature of your comment, but you have to acknowledge that this does nothing to address any of the actual issues that many devs have with PHP. It's not
by ninjac0der 13y ago
I get the nature of your comment, but you have to acknowledge that this does nothing to address any of the actual issues that many devs have with PHP. It's not just a problem of perception.
- jmspring 13y agoThere are problems with php? It's not the prettiest language, but people have been building insanely successful businesses on top of it for years. Think Facebook. It's coyote ugly, but it works. At least most PHP devs don't have the attitude associated with other popular web frameworks. They focus on getting things done. As a disclaimer, PHP is not my go to language, but I've done some ugly scaling experiments with it. I'm just tired of the PHP isn't cool, let's mock it with no actual valid arguments that is common.
- ninjac0der 13y agoI could do awesome stuff with cold fusion if I was still stuck in a previous era. There are much better solutions to the problems of web development.
- klearvue 13y agoFrom a developer's perspective - perhaps. But look at it from a business perspective (cost, risk management), and you'll often see it differently.
- ninjac0der 13y agoI would see nothing differently. I would still seek to educate other devs to experience other languages so they might change this problem you've pointed out.
- Mikushi 13y agoAnd I would seek to educate people on modern and proper PHP.
- bdcravens 13y agoI assume you mean ColdFusion (it's been a single word since at least 1999). CF has some definite perception issues, but does have a number of features that go against the grain of the thinking about it: several MVC frameworks, ORM, web sockets, multiple open source engines, an abstraction layer atop the JVM, asynchronous programming options, closures, etc. As for "previous era", it's the same age as Ruby, Java, JavaScript, and others. CF's disadvantage isn't the tech so much lacking an ecosystem such as what has sprung up around options like Clojure, node.js, and RoR.
- jpatokal 13y agoYes, there are a few problems with PHP, and the following rather famous blog post outlines them quite nicely. http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...
- Domenic_S 13y agoThat guy's main complaint is that PHP isn't Python.
- Pitarou 13y agoI guess Python was what showed him that there is a better way to design languages.
- roskilli 13y agoThat blog post is a piece of art.
- wvenable 13y agoThat article keeps getting trotted it out but it's 1/3 opinion and 1/3 wrong.
- straws 13y agoSo then what's the other third?
- roel_v 13y agoValid complains that can be made about it, just like about anything else? I've watched people who don't know C++ bitch about C++ for 15+ years referring to lists longer than this one, and it's still one of the most successful languages in the world. PHP is like the C++ of scripting languages - not the prettiest and there are plenty of things to (legitimately) complain about, but stable, well-understood and used by people who are interested in results rather than getting to those results in the most 'elegant' way.
- kayoone 13y agoAgree. PHP is actually still my goto language for web stuff, even if today its more or less moving to the backend only. The language itself isnt very nice but i simply love the symfony php framework. Ive been using it since 2007 and the 2.x version produces very clean code, is extensible in any way imaginable and just lets me get stuff done really quickly. I think not many people know how mature the tools in the php ecosystem are today, many people that switched to rails or whatnot years ago still think of PHP as it was 10 years ago, and yes that was horrible.
- jiggy2011 13y agoThe biggest problem with writing PHP is picking up projects from other developers who have built massive systems as if it was 10 years ago.
- cranklin 13y agoisn't that the same problem with any language? C for example?
- kryten 13y agoHaving picked up both knackered PHP and C projects, PHP is usually worse as the barrier for entry is much lower meaning that the code barely works in most cases. Plus it's usually plugged into turds like WordPress. Currently dealing with helping someone upgrade a wordpress+buddypress nightmare. Yuck. C stuff is easier to refactor as well as you have a strict compiler and valgrind on your side.
- kayoone 13y agothats bad and i have always avoided using limited systems like CMSes or Blogs to use as a basis for big systems because of it. But you are right, alot of the PHP community is based around Wordpress, Typo3, phpbb etc but i have been using PHP for 10+ years and apart from installing Wordpress for blogging i have never used that stuff ;)
- dspillett 13y ago> There are problems with php? I left PHP around the time that v5 was recently released and v4 was still common, as did a lot of people (moving over to Python and later Ruby+Rails). I think a lot of people put PHP now down using their experiences of PHP4 (awful "object" features, irritatingly inconsistent standard library, ...) and PHP4/5 transition problems (which IRC were not really massive, but many libraries didn't deal with the compatibility breaks quickly so there were for a while issues knowing which libs and example code outside the "standard" library were compatible with 4,.x, 5.x, or both) before migrating away. I assume a lot of the above has change considerably in the intervening years, but I think a lot of people assume instead that it is just as bad as it was when they migrated elsewhere. That and there is a lot of bad code written in PHP largely due to its perception of being a beginners language (any environment that is easy for a beginner to dive into tends to make writing bad code as easy as it makes writing good code). > It's not the prettiest language, That I take as understatement, though I'm still supporting some ancient "classic" ASP code (fingers crossed that legacy will finally be stomped out by the end of this year...) so I can conclusively state there is worse in use out there! > but people have been building insanely successful businesses on top of it for years. Think Facebook. Remember though that Facebook don't use stock PHP: http://en.wikipedia.org/wiki/HipHop_for_PHP http://en.wikipedia.org/wiki/HipHop_for_PHP
- laumars 13y agoI loved PHP at first too, but the more I started to do serious work in it, the more I grew to hate it. There's so many better languages out there these days, but PHP seems to live off the hype it gained when it was basically a choice between CGI/Perl, Classic ASP and PHP. PHP ended up annoying me so much that I switched back to Perl (using mod_perl for performance critical stuff). However my latest project is being written in Golang (I know it's all just personal preference, but everything that I hated about PHP, Go seems to get right) I know many HN members will already be familiar with the following blog post, but it highlights up many of my frustrations: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...
- phryk 13y agoI loved PHP at first too, but the more I started to do serious work in it, the more I grew to hate it. I can second that. It's great to get into quickly and just hack something together. But it has lots of problems. Admittedly the devs have begun addressing a lot of issues - like the database access one, where you had just a bunch of functions that didn't even offer auto-escaping and resulted in a lot of unsafe sites - but the old stuff is always kept for backwards compatibility, which means that a lot of sites just continue to be unsafe. I think a lot of those problems are stemming from the fact that php doesn't have any sort of built-in module system and everything is just on the root level of the language. There are optional namespaces, but even for those they use "\" (like \parent\child), which IMHO is just about the worst choice ever. Then you have issues like the devs just pushing out a new version even though like 99% of their tests failed (but hey, apparently they at least have tests). And of course you have the never-ending story of bad php-developers which came into the field because you can just hack stuff together with copy-pasting googled code-snippets and not understanding anything. Seriously, if anyone thinks this issue overstated - it's not. If anything, it is understated. I have seen productive systems over which money in the tens of thousands of Euros came in which had hidden fields in the HTML containing complete SQL queries which even included the price (apart from the obvious downfall of enabling someone to just POST a 'DROP TABLE' statement, etc.). I have seen systems with something like static 5-digit user authentication tokens that would show up in the URL; You could just sit behind an admin, note the token and be an admin forever. And of course I have seen the ugliest, completely unmaintainable mess of code that would be humanly possible, with no documentation whatsoever (of course). I also heard from a friend who had to fix something in the C-code making up php about hundreds of lines of codes being copypasted to different locations twelve times. While I haven't verified that for myself, it's not something I'd be surprised about. Then of course there's the issue of php's design. For one your complete software has to be loaded for every single page view, which is just really fucking inefficient. But having the application not run continuously is also a problem if you want to write any sort of real-time application, which are going to become more and more frequent. You can do stuff like long-polling, but that's just another ugly hack. You might of course be able to have another hacky solution with continuously running php-cli with FastCGI or something like that, but even if that would work in principle, some php script would just die within a few minutes and the site'd be dead. TL;DR: For small projects that may be hacky and potentially insecure, php is fine - For everything that is supposed to be proper, secure or highly performant I recommend you stay away from php as far as you possibly can. Everything else will just result in huge frustration.
- johnward 13y agoIt addresses some of the issues with the php.net site though. The site which hosts all of the official docs. It must help a little bit.