10 ms·
PHP needs to die. What will replace it?
- escoz 15y agoDon't want to be inflamatory, but: PHP has already been replaced by Ruby/Rails as the good thing that should be used for new projects. Only PHP developers don't see that. You lost me when you tried to argue that ORMs are not useful. Its easy to see why PHP developers think that, though.
- xdissent 15y agoAs the author points out, Rails is a framework and PHP is a language. There are countless (great) frameworks for PHP - my current favorite is Symfony 2. And PHP developers do in fact know and value ORMs, hence the existence of Doctrine 2.
- michaelchisari 15y agoYou're being inflammatory. Rails has nowhere near the install base that PHP has, and furthermore, it's a framework, not a language, so the comparison is unequal. Further, setting up and installing Rails is nowhere near as frictionless as installing, for instance, CodeIgniter. Until that can be said, Rails is not a viable alternative. I'm all for a PHP alternative. I use it because it's ubiquitous, but I have no love for the syntax or the internals. But the only way you can compete with it is to have the same kind of momentum mixed with the kind of frictionless use that comes standard.
- pjscott 15y agoIf installing Rails (or Flask, or whatever) isn't trivial compared to the difficulty of writing the actual code, then either your project is a toy, or your web host needs to get its act together.
- michaelchisari 15y agoLet's be clear, we're talking about popularity here. We're talking about the massive popularity of Wordpress and Joomla, of which no Rails project can match. We're talking about the fact that most websites on the web, by that standard, would be "toys". But that doesn't matter, because those toys are what power the web. Not everybody is Facebook, not everybody is looking to secure VC, not everybody is coding their own site. In fact, I'll go so far as to say that what you're saying is indicative of the kind of out-of-touch response that keeps any of the proposed alternatives from replacing PHP.
- escoz 15y agoI was not talking about popularity, I was talking about mindshare, two very different things. If you're talking about popularity, Java, C and C++ are more popular than php, but I don't see you pointing them as viable solutions. tiobe.com
- michaelchisari 15y agobut I don't see you pointing them as viable solutions Java, C and C++ are viable solutions, due to their popularity.
- dagw 15y agoI take it you have never tried to get major changes to core server infrastructure approved at large bureaucratic institutions. Writing your code in php is often orders of magnitudes faster, easier and cheaper than getting a decent RoR setup installed.
- MartinCron 15y agomajor changes to core server infrastructure approved at large bureaucratic institutions It sounds like you've already lost.
- dagw 15y ago
- hackermom 15y agoIf you have unlimited hardware at your disposal, work on projects where a slightly faster development for certain, specific cases can be obtained, or work on projects of a size that can be managed by the performance of a single machine, sure. If not, R/R isn't replacing PHP.
- escoz 15y agoRails doesn't really need that much hardware, that's a very common misconception. PHP is not the fastest thing in the world either, unless you go with a compilation cache server. Rails can be easily perform well under single machines. I have VMs with 512Mb of ram handling thousands of users per day with Rails with no problem.
- hackermom 15y agoOf course, it's not like a modern first person shooter or anything. My point was that on one and the same machine, PHP gets a whole lot more done per portion of computer power than Ruby does :)
- freshhawk 15y agoBecause all projects are CRUD apps? You aren't going to convert the masses of php hacks with an opinionated and rapidly changing framework like Rails. These are people who still mix logic with templating and you want them to learn an ORM, Coffeescript, Sass and Moustache? > You lost me when you tried to argue that ORMs > are not useful. Its easy to see why PHP > developers think that, though. Really? So the object-relational impedance mismatch problem isn't real? You lost me when you completely ignored the real engineering trade-offs involved in choosing abstraction layers like an ORM. Its easy to see why Ruby developers think that though.
- escoz 15y agoThere are problems with ORM, but there are much larger problems with PHP+SQL. Most of the problems created by ORMs are easy to workaround, though (to the point of having to write SQL sometimes), while problems created by SQL only are not (like n+1).
- zachwill 15y agoAs a Python developer in SF, I can 100% agree with this. Ruby/Rails has replaced PHP for almost the entirety of new projects going forward out here — at least with the developers I know and respect — and Python makes up the rest.
- dagw 15y agoSo by looking at a tiny subset of programmers (those that you respect), of a tiny subset of programmers (those that you know), of a tiny subset of programmers (those in SF), you feel you can say something representative about programmers and programming as a whole.
- Rust 15y agoI will argue that ORMs are not useful to the majority of good developers. The PHP app I am currently saddled with generates anywhere from 100 (absolute minimum) to 40,000 MySQL queries on every single page view thanks to a developer who didn't know what ORMs are for and was clearly behind the curve when it came to architecting scalable applications. I have never seen a PHP application abuse a database connection so thoroughly in my life. If he had just stuck to a nice, lightweight PDO wrapper and been able to craft some decent SQL statements, we wouldn't be rewriting this thing right now.
- mikey_p 15y agoI won't argue that PHP is getting long in the tooth, has a somewhat unclear future, and some of the standard lib is hella inconsistent, but these points: then what PHP is lacking is lambdas and method chaining. Does the author know anything about PHP at all? As far as I can tell method chaining has been available as long as PHP supported OOP and Anonymous functions have been supported for several years since PHP 5.3 was released. This makes it really hard to take the author and the article seriously.
- berntb 15y ago>>Does the author know anything about PHP at all? The author doesn't know about any other languages either, it seems. I stopped reading when he argued that PHP's assocative arrays was an advantage; hashes/dictionaries are in all the scripting languages. (Afaik, they come from AWK by the way of Perl, anyway -- they were created many years before PHP existed.)
- sciurus 15y agoWhen I read >> the critical thing Perl was lacking was PHP's wonderfully flexible "associative arrays" I grabbed my copy of "Learning Perl" from 1997. Chapter 5's topic? Hashes.
- pak 15y agoPerl hashes don't preserve order. PHP's almost always do. i.e., the order you insert keys is the order in which you will receive them back when you iterate over the array. It's similar to a LinkedHashMap in Java. CS types might recoil at the mixture of behaviors that are baked into PHP's workhorse data structure, but most of them turn out to be quite useful. (And it makes it easier for the beginner programmer to decide what data structure to use: you have keyed data? a list of data? a set of values? doesn't matter, just use an array!)
- berntb 15y agoThere is CPAN for that. (iirc, this is solved with a module in the Perl Cookbook. I don't have that book where I am writing this.) Edit: For a beginner that wants a Visual Basic for web, sure. By now I have different needs, to enjoy using my tools. (And for the record, if I need to keep order of a hash/dict/etc in some language, I generally use a "traditional" array in addition. That is probably too complex for a beginner? :-) ) Edit 2: I'm not dumping on PHP, it is a useful tool for many people. I just wish the development of the language had been handled a bit more carefully.
- hackermom 15y agoI'm convinced that PHP is just too big, too popular, and, as the author realizes and points out, too fast and utility-wise too well-equipped to die at this point in time. Whatever may be able to kill it off surely won't be Ruby, Perl nor Python.
- davidu 15y agoPerl used to be "too big, too popular" and writing Perl apps that plugged into mod_perl was what every company was trying to hire for. PHP will likely be replaced, but not for a long time and it will take time. And there are still a lot of perl hackers out there too, none suffering (aside from having to use perl).
- ashrust 15y agoI understand why rails continues its ascent but the LAMP framework is still very popular - you can get to hello world on your home computer or free hosting account extremely quickly, that's pretty powerful when your're starting out. Services like codecademy may change that but we're a ways off imo.
- deleted 15y ago[deleted]
- there 15y agowhy does one language have to die for another to become more popular? if you don't like php, don't use it.
- michaelchisari 15y agoThe article states that php doesn't have lambdas and method chaining, although it does. They aren't well done, as per usual, but it definitely has them. Honestly, we may be best off doing a CoffeeScript style pre-processor for PHP. Because PHP isn't going anywhere, no mattter how much we may prefer other languages, PHP's popularity is one of pure pragmatism, something the language purists don't seem to understand. Get me from 0 to "Hello, World" as fast as you can. That's how you build the next PHP.
- jmathai 15y ago>> Get me from 0 to "Hello, World" as fast as you can. That's how you build the next PHP. Well put.
- thrashr888 15y agoI can't think of any other languages that let you do `echo 'Hello World' > /Library/WebServer/Documents/index.php` and you already see that in the browser because it comes with your OS. It's hard to beat that for normal folks just starting out making web pages.
- deleted 15y ago[deleted]
- deleted 15y ago[deleted]
- jinushaun 15y agoExactly. To beat PHP, you have to be as easy to write as static HTML. Even though I have done Ruby, Node.js and ASP.NET projects, I still go back to PHP because of how easy it is to go from 0 to hero without all the fuss. The closest thing I've found is the serve gem, which lets me launch a web server from my current working directory. It lets me quickly mock something up in ERB, Haml and SASS without messing with Rails or Sinatra. As a complete newbie, with no coding experience, PHP is a much easier hill to climb than Rails or Django, which is Mt Everest by comparison.
- jamesmoss 15y agoWhy is the article comparing PHP (a language) to RoR (a framework). There's plenty of good PHP frameworks which have emerged over the past few years that take care of the boilerplate code needed for a web app. Symfony 2.0 was a released a few months ago; Fabien Potencier's hard work brings a lot of great patterns and conventions from Java to PHP users.
- wccrawford 15y ago"Needs to die" needs to die. Let's replace it with "Here's how we can improve."
- pbhjpbhj 15y agoYes.
- russell 15y agoCOBOL is still alive after more than 50 years. PHP will still be being used in 2050 for government web sites. It wont be getting any respect. but the octogenarians who can still program in it will still be making some pretty change.
- aristus 15y agoI'm surprised that you didn't mention HipHop, especially if performance is your biggest gripe. It really is the bee's knees and will only get better. I spent a good chunk of my day looking at PHP code and profiling data. Assocs are terrible for performance but it's not a fatal flaw IMO. What people really want are separate "vector", "dict" and "set" types. It also needs a decent standard library to replace dyslexic crap like explode(). And don't get me started on the string libraries and the abuse of preg_* functions. Lastly, comparing plain PHP to Ruby+Rails isn't fair. I prefer Python myself but even then I need something like webpy or Google's appengine library to make reasonable app.
- nolok 15y agoShow me a website where php is the source of the performance problems and I will show you a website php allowed to reach success/a large audience. Frankly, unless you are very large scale php is never your bottlenecks, I/O is. And if php become your bottlenecks, you have already won. (of course you could find exemples of math-heavy calculating sites where this isn't true, but that just means you don't know how to pick the right tool for the job)
- aristus 15y agoYou are right that I/O is usually the first bottleneck. I assure you that being CPU bound is no picnic, not least because most optimization knowledge and experience out there relates to I/O. :) Even if you are not CPU bound, HipHop is steadily adding grown-up features to the language that make it quite nice to use, functions like mysql_connect_with_db() which save a database round-trip, and extensions like xhprof which will tell you what is actually slow.
- Mikushi 15y agoIf performance is a problem, then PHP is most certainly not the source of it, the vast majority of performance issues people are having in PHP are related to poorly written code, bad understanding of the language, and most of all use of third party software that were never meant to be performant(WordPress, SugarCRM, Symfony, ZendFramework ...). And HipHop is most definitely not the solution, the only reason to use HipHop is if you are Facebook.
- chc 15y agoThis entire essay seems to be predicated on the frankly weird assumption that if something is part of the language, it's good, but if it's part of a library, it's not — even if the two are indistinguishable. For example: Code that writes your boilerplate for you is helpful and all, but if your language requires a pile of boilerplate to get anything done, then something is already wrong. If the same functionality is implemented, the code is being generated somewhere. Ditto with his dismissal of Ruby on Rails because Rails is not built into Ruby like PHP's web app support is.
- racoder 15y agoHe lost me at "The most obvious potential successor to PHP is Ruby on Rails". why compare RoR framework written in ruby vs PHP programming language... go for Ror VS cakephp, RoR vs codeigniter, RoR vs symfony etc
- Legion 15y agoFor better or worse, the Ruby web community is so centered around one specific framework that people tend to just say Rails instead of Ruby. The post isn't comparing PHP with no frameworks versus Rails. Indeed, the author's conclusion is that Rails doesn't sufficiently separate itself from PHP with an MVC framework (and he listed a few).
- phatbyte 15y agoIt's 2011 and people still compare frameworks vs languages. PHP may suck, but oh boy, the author doesn't have his facts right. No method chaining ? really ? Rest assured that I would rather hire a good PHP developer than this guy to code in Ruby.
- pak 15y agoYou're right, both things that the author claimed are lacking are in fact very much available. PHP >5.3 has lambdas: http://ca3.php.net/manual/en/functions.anonymous.php http://ca3.php.net/manual/en/functions.anonymous.php PHP >5 can support easy method chaining if you return $this from your method. Lambdas are not yet common, but method chaining is already easy to find in most well-designed PHP libraries and frameworks.
- Lukeas14 15y agoEven though he "can make Rails run just as fast as PHP, but needs between 2 and 4 times as much hardware to do so"?
- jemeshsu 15y agoI can confirm that I will die first before PHP.
- deleted 15y ago[deleted]
- petervandijck 15y agoPHP is totally fine, for startups and for web projects. Examples aplenty.
- jordanlev 15y agoOne word: deployment To me, the best thing about PHP is that it is so easy to deploy to pretty much any shared hosting on the planet, not to mention really easy to set up on your local machine (with WAMP/MAMP). I love Rails, but on many occasions have built projects in PHP (using a decent framework like Kohana) just because I was putting this on my client's shared hosting account and didn't want to deal with having them get a new server, or just plain setting up Rails. Yeah yeah, I know there's passenger now, etc. -- still not as stupid easy as dropping a php file into a web directory (and assuming that Apache is set up with mod_php, or FastCGI or whatever -- which it always is).
- generalk 15y agoOne of the interesting things about doing Passenger deployments for Rails is that it's very similar to doing PHP deploys, with the added benefit of the server not reloading any application code until you tell it to. For example: you can update the Rails code on the server, maybe run some data migrations or last-minute production tasks against the new codebase, and THEN tell Passenger to reload the application code. On an unrelated note, having the Heroku service around for low-traffic side projects or whatever is just plain awesome.
- joelhaasnoot 15y agoLots of PHP folks call that a disadvantage... It's nice knowing I can mess with files and after pressing F5 I'll always have the latest version. Yes, ok, caches can get out of sync, but they're easy to clear. There are furthermore no good PHP deployment automations, things Rails and Python have because of the level of complexity.
- bad_user 15y agoYou do know that reloading is just a configuration option, right?
- FooBarWidget 15y agoYou claim that deployment automations for Rails and Python exist because of the complexity? Have you ever worked with PHP apps that are larger than 1 single file and use the database? Things like Capistrano do a lot of things that even PHP would benefit from. Deployments are rarely atomic actions. With Capistrano, apps are stored in versioned release directories. Apache points to a 'current' symlink which points to the latest release directory. Upon deployment, Capistrano creates a new app directory, runs database migrations or updates configurations or creates asset files or whatever is necessary to upgrade the app. Only after it's done will it update the 'current' symlink and instruct the app server to restart. Consider what happens if you upload your new PHP app with FTP. If someone visits /some_page.php while you're uploading then he could access an old version of it. Suppose some_page.php depends on common_library.php which may have been updated to the latest version in the mean time. Then things blow up because the new common_library.php is not compatible with the old some_page.php. With Capistrano, the deployment is as good as atomic. Capistrano also supports deploying to multiple servers at the same time, and even to servers that are behind a firewall and can only be accessed through a gateway server. It supports rolling back to a previous version. And much more.
- dmk23 15y agoOMG, Julius Caesar had to die too! There is no need for any language or framework to "die". If you do not like PHP (or Perl or Python or COBOL or Ruby or Java) just do not use it. There are plenty of alternatives. If you and your team can be productive with any of these languages, go for it. PHP with modern OO-frameworks, like Yii, can support rapid development of complex web apps just fine. Facebook runs just fine on PHP even without any 3rd party frameworks. The proof is in the development and deployment. The only way you can "kill" a language with so much support is to offer something 10x better or create some exclusive tie-in. Where is that magic offering? Vote with your feet and dollars and just take it easy. There is no need to fight the imagined oppression.
- deleted 15y ago[deleted]
- mcs 15y agoNode.JS will replace it. Not a fanatic Node user either.
- jcampbell1 15y agoI have used node and like it, but there is no way it will replace PHP. It is just too easy to drown in callback soup with node.
- deleted 15y ago[deleted]
- bryanh 15y agoPHP is not the devil. It has some funky design decisions, but oh well. Mixing HTML, SQL and logic is the devil. The problem is that PHP makes it too easy to do (some would say it encourages it).
- tjogin 15y agoPHP is not that bad? What other popular language is worse?
- MostAwesomeDude 15y agoLua and JS both come to mind. Neither of them are worse than PHP, but they're right around that same level of (un)usability and number of pitfalls.
- mtogo 15y agoLua, really? Could you provide some examples?
- MostAwesomeDude 15y agoNo basic string manipulation, only RE-based stuff. One-based indices instead of zero-based.
- compay 15y ago> No basic string manipulation, only RE-based stuff It's trivial to write, there are lots of libraries that do this. I've worked on a lot of string processing code in Lua. It's not as easy as Perl or Ruby but it's not by any means hard. > One-based indices instead of zero-based. Other than violating the expectations of people used to other C-like languages, this is not in any way even remotely a problem. I don't know anybody who's spent any significant time with Lua who regards this as more than a minor detail.
- 15y ago
- sophacles 15y agoI really really think this is asking the wrong question. Sure PHP beat perl at its own game, and really was the master of the CGI style web. But the thing is, that really isn't where the world is anymore. Sure, there is a place for building pages from templates, particularly in piecing together custom splash pages and whatnot, or xml feeds, but honestly, the CGI style web is just going away. Look at what everyone is doing right now: make an app in javascript+html5+css, serve those static files, and feed the app with json. Save bandwidth, scale easier, and just have better control of the display by manipulating the display directly. tl;dr - Nothing will replace PHP, because no one is making tools for that case (file-oriented-web) anymore.
- pcole 15y agoMy thoughts exactly as I was reading the post :-)
- encoderer 15y agoI've come to expect hackery from this guys blog. The truth is that for professional, skilled developers, mastering their Nth language is an increasingly smaller investment compared to their first. But for people north of HTML coders and south of professionals, they have a lot invested in the scripting skills they've developed and nobody is interested in seeing the value of their investment diminish for a reason like this. People here always tout PHP's installed-base as a big "plus" for the language. But I think more than that is the mindshare.
- dasil003 15y agoYeah, the first post I read was the ORM one, which I thought was such an egregious piece of misinformation that I debunked it ad nauseam (http://darwinweb.net/articles/in-defense-of-orms http://darwinweb.net/articles/in-defense-of-orms). Now in this article there's a telling clue to why he thinks writing SQL by hand is better than using any ORM: > I can knock out a good website in an hour in PHP, and an excellent one in a day or two. This suggests that he's working primarily on tiny projects. Of course if you are working on tiny projects than an ORM doesn't buy you much. Also, there is perhaps no language suited better to tiny web projects than PHP and I don't see that changing. If you want to make something measurably better than PHP for general purpose web programming you start having to make decisions that developers don't want taken away from them. Rails does what it does by being opinionated, but it works because if the opinions are ill-suited to your project you can still use Sinatra or whatever. If you move too high up the abstraction layer while trying to still serve a wide audience you end up with the kind of morass that is Drupal, where the system can do almost anything adequately, but it doesn't do a great job of anything because of the creaking weight of the infrastructure that attempts to be everything to everyone.
- geebee 15y agoWell, it's always hard to respond to a claim about professional, skilled developers, since a programmer will always be looking up at a group that is more skilled (well, most of us anyway). But I don't think it's a small investment to learn a language and framework. You can learn the basics of ruby, or python, or Java reasonably quickly if you have a reasonably broad background in programming languages, though even that takes a while. But the frameworks, those really do take an investment. It takes a real investment of time comfortable with Rails or Django. Not to get the initial site or scaffolding up, but to get comfortable enough that you're no longer stymied when you need to do something non-obvious. And the Java frameworks, oh jeez. To get all that working takes ages. A dependency injection framework, an MVC framework, an ORM, getting it all to work with Maven or some other build too, sheesh that takes a long time, and there are so many dispiriting little errors to chase down. Well, maybe there really adept coders just don't have a problem with this, but I have this suspicion that it doesn't come down to being smart. This isn't about mastering some difficult algorithm and then implementing it in python or ruby instead of java. There are a lot of idiosyncrasies. I remember Ellen Ullman (she wrote "Close to the Machine", a reflection on programming before these types of books were so common) described programmers as "serial monogomists", becoming very loyal to their environments for a while, then abandoning them and finding something new. I remember another line, about how you can be a senior developer in one environment but not even know how to turn the machine on in another. I'm not saying there aren't people who can switch easily, but I do think it comes at a cost, even for people who are reasonably adept programmers.
- kayoone 15y agowhy does he compare PHP to rails ? the latter is a framework, not a language. PHP has excellent frameworks as well, Symfony 2.0 for example is awesome.
- fleitz 15y agoHonestly, why does 2 to 4 times slower mean anything? Why can't you cache? or write that really performance intensive part of the app in something else? There aren't any numbers to back the idea that 2 to 4X performance means something. It's pretty easy to spend $5-10K per month on a single dev, thats a fair bit of hosting. If the concern is speed of page rendering go with .NET, the JVM, or C++ it's much faster than rails or PHP will ever be. The trick is to use RAD/MVP to get you to that twitter like world of hurt. Then you rewrite in a faster language once you know what your product is like.
- jordanlev 15y agoThis brings up something I feel gets missed in a lot of language/platform discussions: a vast majority of sites on the internet are informational sites for people/companies and plenty of those are created by designers (non-programmers). When you say it's easy to spend $5-10k per month, you're obviously thinking of a company whose business is the software, but this does not apply to most websites in the world.
- fletcher 15y agoIt is so nice to be addicted to the coolest abstractions of programming languages, considering PHP undeniable lack of elegance and orthogonality just a mess, but I think when there is to get shit done this is not the only quality a programming language should have. PHP has other qualities: trivial to deploy, a set of libraries built-in, dispatch/execution fast enough. So I would love to see PHP improved as a language as replacing it is not so easy at this point. Instead fixing the language should not be so hard, assuming a competent core team.
- kemayo 15y agoTo replace PHP you need: 1. To be on all shared hosting everywhere. I.e. you need to be really easy to install, and preferably not involve long-running processes that shared hosts might choke on. 2. To be beginner friendly. No requirement of understanding MVC, or running commands in a shell (hi RoR!). Pure instant gratification. Someone's first step into using PHP is likely going to be "I want the current date in the footer of my page", or "I want a random image on my homepage", or something like that. Anything like that you can handle by taking your existing page and dropping a tiny snippet in where you want the change to happen. <?=date('Y')?> is a potent thing to someone who has never programmed before. (Note: For point 2 many of the things serious programmers hate about PHP are actually advantages. All the functions in one big namespace? That's great! A newbie doesn't have to try to understand `<? import datetime; print datetime.date('Y'); ?>.) It's easy to replace PHP for serious developers. We like advanced features, and care about a sane default libary. We're willing to use complex tools to get a payoff. It's hard to replace PHP for non-programmers who just want to tweak their static page in notepad, or install a blogging package on their cheapo shared hosting. To sum up: if you don't address both of these points then you haven't killed PHP. You're competing with Python or Ruby or whatever. PHP will carry right on ignoring you, because you're not addressing its fundamental use case.
- InclinedPlane 15y agoI don't agree that MVC and beginner friendliness are fundamentally incompatible. Nevertheless, if you can't get a "hello world" site set up in a very small number of essentially trivial (and easily memorize-able) steps then that's a big show stopper.
- gaelian 15y agoIt really depends on the beginner I guess. It seems like what kemayo is saying is that there are beginner programmers and then there are people who don't want to be a programmer at all really, but might like the idea of having a dynamic year string printed in the footer of their page. Those of us who have been working with computers for a long time - particularly those of us who write code - too easily forget what it's like to be that true beginner and often have a very different idea of what 'trivial' means compared to the beginner. What might barely be a speed bump for us can often be an insurmountable obstacle for them and I really wish I was better at remembering this more often.
- lparry 15y agoPHP is great! It's like flypaper, attracting and trapping mediocre devs, keeping them from writing their terrible code in nicer languages
- georgieporgie 15y agoRoughly a decade ago, PHP killed Perl. Not completely, of course; it still clings on in some environments, it has a sizable legion of die-hard fans, and legacy apps will need to be maintained in it for decades to come. But as a language for newcomers, and especially for web developers, it was already dying in 1999 and was mostly dead by sometime around 2005. Uh. http://www.indeed.com/jobtrends?q=perl%2C+php%2C+ruby http://www.indeed.com/jobtrends?q=perl%2C+php%2C+ruby I think newbies just found easier languages to work with than Perl for web dev, which says nothing about the use or demand for Perl in industry.
- chromatic 15y agoI think newbies just found easier languages to work with... Change that infinitive to "to deploy", and you're spot on.
- FuzzyDunlop 15y agoPHP is a nightmare, but only once you learn enough about programming or development to understand what you should really be doing, and only once you've seen how other languages do it. After that comes PHP's special flavour of OOP. I'd prefer to call it 'Do Whatever The Fuck You Like Orientated Programming' given the abundance of 'magic methods' and other functions that try really hard to make sure you've got a cheeky workaround for something you can't be bothered doing properly (creating countless security issues in the process). And that's before you start using classes as pseudo-namespaces for collections of static functions. The disappointing side is that someone who learns PHP before anything else will have a heart attack when they realise that very little of what they know applies the same to another language. It's so loose and care-free that it doesn't care what you do or how you do it. (Not helped by the mountains of useless tutorials and documentation that teach awfully bad practices.) So I guess the thing I dislike about PHP is that I learnt to use it but it didn't give me good programming skills.
- maratd 15y ago> It's so loose and care-free that it doesn't care what you do or how you do it. This is precisely why I fell in love with PHP. My first was BASIC, my second was C, my third was Java, but my fourth ... oh god ... like that slutty girl who will let you do absolutely anything. How can you not fall in love with that?
- FuzzyDunlop 15y agoAll I can really say is that I'm getting fed up of it. In keeping with your analogy, I'd certainly prefer one that gave me the odd slap and told me to get my shit together if I tried pushing my luck. (programming languages and sado-masochistic tendencies would be an interesting avenue to explore...)
- damncabbage 15y agoPerhaps a little appropriate: http://c2.com/cgi/wiki?BondageAndDisciplineLanguage http://c2.com/cgi/wiki?BondageAndDisciplineLanguage
- Sodaware 15y agoI get that PHP is not the most elegant language in the World (see kemayo's comment about strpos and in_array for just one example), but I don't understand why people get so worked up over the fact that people use it. It seems like you can't mention PHP without people inferring that you're a lesser programmer or that you clearly don't know what you're doing.
- jQueryIsAwesome 15y agoThe funny thing is that the second most visited and profitable website in the world (Facebook) is written in PHP... not bad for a "beginners language" i think.
- alexwolfe 15y agoHa, don't use it. You must have some other hidden problems if you hate PHP so much, that's my take away. Get a hobby, you won't hate PHP so much ;)
- zzzeek 15y agothe leap from ORM->code generation->magical thinking!! -> IS BAD , just hysterics. A clear example of the slippery slope logical fallacy. Good ORMs are a huge productivity boost and entirely worth it. Those particular PHP coders who barely know programming (keep in mind, this is just a subset of PHP programmers I'm referring to) should not use relational databases at all, they should stick to simple key/value stores - they don't need joins, they don't need subqueries, they've no concept of transactional isolation, foreign what ? Just use a K/V.
- inopinatus 15y agophp lowered the bar to web programming to below "moron" level. so you will need something equally instant-gratificational. only without the horrible warts rails was too clever. stupid people are afraid of clever. I don't see anything to hand.
- snorkel 15y agoI only ask for a language that is readable so that code can be readily understood among a team developers, and PHP is universally understood. It may not be cool, but less time is wasted obsessing over being more clever.
- nir 15y agoTechnologies might "need to die" on blogs, but in the real world they get replaced with better alternatives - once these emerge. Want to replace PHP with your favorite solution X? Write a better Wordpress, Drupal, vBulletin or even PhpMySQL alternative in X. It's incredible to me how the fantastically talented X rockstar ninjas can't produce a better replacement for, say, Wordpress given how much technology and our general understanding of building web apps have improved since 2003. Less blogging, more coding.
- toblender 15y agoKilling PHP is like trying to kill English. Too many people know it and use it day to day for it to go away. It will just carry on with all its inconsistencies and weirdness.
- ryanto 15y agoHow do the articles from this site always make it onto the HN front page? They're full of misleading information, are only written for the link/flame bait, and don't provide any good actionable advice. I know news is slow these days, but this kind of posting needs to stop.
- ArtemZ 15y agoI switched to Groovy/Grails (srsly, why people choose ruby and rails over it?) and I'm so happy with it: it's fast not only in terms of application performance, but also in terms of time to develop applications on grails. It has everything and even more than php can offer thanks to java background, it's also safe and very well documented.
- lupatus 15y agoThis past weekend, for the fun of it, I setup MongoDB and Node.js on Windows. After ~3 hours of downloading, reading MongoDB and Node.js example docs, and looking up some config issues on StackOverflow, I had written a small TODO list app. Last night, in about 45 minutes, I setup CoffeeScript and translated my node.js webserver into CoffeeScript, resulting in about 25% fewer lines of code. This is by far one of the easiest stack deployments I've ever done. I'm even thinking about writing a push-button windows installer to do all the installation and configuration stuff for me in the future. If there is any interest, I'll share it. And heck, couple those technologies with jQuery, and I imagine that you could use CoffeeScript to develop for both the server and client side of a web app. Easy and way cool.
- davemcd 15y agoI'd like to see a windows installer with node.js, coffeescript, mondodb and a couple apps with some collected docs behind a web server for example. that approach bootstrapped a lot of Rails coders. a demo video also helps create a lot of interest.
- cafard 15y agoAda. After all, it replaced COBOL, Fortran, various ALGOLs, and C, right?
- ch0wn 15y agoDjango is capable but not really what developers expect from MVC, and other MVC frameworks for Python have much less traction. Wow, that's a pretty strong statement. I would like to see some sources for it or at least further explanations.
- bundy 15y agoI'm mainly a Python programmer now but used to use PHP fairly extensively. I defended PHP for its ubiquity and how easy it is to get started using it until I saw what was going on with the development of PHP6. That's pretty much when I decided that, personally, it's no longer a language worth investing in.