We've all heard the discussion of PHP over the years- its faults, why other languages are better. However, it is the language & ecosystem that I know best and have the most experience with.<p>Obviously, the user doesn't care about the backend of a system. From a developer's point of view, though, is PHP still acceptable to use for new projects, even though "better" languages like Python and Ruby are way more available than they were years ago? Or is it no longer considered a good idea to use PHP if I'm starting with a clean slate?
Dont let the HN Hivemind fool you, plenty of people still use PHP and write beautiful, OO code.<p>The language you use doesnt determine whether you're a good developer or not. I have used other languages (node, python, ruby) and I still prefer php, because its quick and simple. Its syntax may not be as beautiful as a python or a ruby, but it php just works, and it powers hundreds of millions of sites.<p>Bottom line, use what your comfortable with, but be open to exploring other languages. Dont ever let someone tell you a language is better than x. Make those decisions yourself.
Use whatever language/framework is best for you. That could well be PHP, and if you only know PHP well, it probably is.<p>Yes, PHP is <i>objectively</i> a bad language. The PHP ecosystem is poor, development is stagnant, the syntax is ugly. Whatever the future of the web may be, it's certainly not PHP.<p>But...you know PHP. Presumably you know what it's good at (and what it's not so good at). You also know your project. Think you could code it faster and easier in PHP than anything else? Yes? Awesome, knock yourself out. As a bonus, a ton of other developers also know PHP, so you'll probably be able to hire coders easily.<p>(On the other hand, as a coder, I like to keep my skills current, and that means learning new technologies from time to time. Yes, PHP is currently dominant, despite what you may hear on HN, but it's not the future. I jumped from the PHP ship a long time ago, and I have never regretted it for a split second. Are you going to learn a new tech stack eventually? If so, why not now? If not, then when?)
There are pros/cons to any language. If you're developing something web related, PHP is certainly worth considering (especially in your case, as you have experience with it).<p>Just a few quick thoughts:<p>PHP is - in most cases - very tightly coupled to the HTTP request. This can be good or bad depending on what you're building. Doing a lot of offline processing? Probably bad. Serving up web pages? Probably good.<p>There's no (or little) state with PHP (you do have the session, which can be pushed to memcache), so - generally speaking - running your application across a bunch of web nodes isn't too hard to implement (even scaling the horrible legacy style code that helps give PHP a bad reputation shouldn't be <i>too</i> hard). This may or may not be important to you.<p>There's really no one true way with PHP - it can be used for a simple 10 line script, or for a large scale web application. If you like (or need) that kind of flexibility, it could be a good choice.<p>Bottom line is - it's certainly sill worth considering, just know why you picked it (or whatever other language/platform you use).<p>That said "it's what I know" or "I wanted to try something new" aren't necessarily bad reasons.
I struggled with this question myself recently. I had minor experience with PHP a long ways back so starting my app with something familiar sounded better than starting from scratch.<p>But after a ton of research, I came to the conclusion that learning to program/mvc/security techniques with php is total chaos. There is 10+ years of php tutorials out there and everyone of them takes a different approach to there programming methods and u have no idea if your adopting the habits of a guru or some punk who just figured out his first script. There are so many php functions that do the same thing (mysql vs msqli), u will struggle constantly just figuring out what the the right/best/newest way to do things is. It's all such a mess...<p>So I ended up taking the 101 udacity.com course and learned the basics of python/programming in really short order. After that I did the 253 web dev class there with Steve Huffman (creator of reddit). After that I fealt like I had a solid understanding of how mondern web apps are put together and I learned from some real pros.<p>I immediately picked up Flask, got set up on heroku, and have been having a blast ever since. Flask is especially nice because there are plugins/defaults/documentation on handling and avoiding most modern web app features/security issues. I highly recommend this route.<p>Good luck!
is PHP acceptable? well, obviously it depends on the project requirements, for instance programming a chat server in PHP is probably not the best choice, but even though PHP has its faults for me it remains a solid language for building new web applications. Here's why:<p>1. Its easy to scale (horizontaly) because it has a "share nothing" archtecture.<p>2. like tjlyte states its centered on the HTTP protocol which is almost always your app protocol<p>3. its fast<p>4. its an "easy" language to program, but still supports OOP, namespaces, closures, anonymous funcs, etc.<p>5. Its highly portable<p>6. It has a very extensive developer base, tons of libraries and frameworks that are starting to reach enterprise Java level maturity (Flow3, Symfony2 for example )
I'm a Grails developer but when friends asked me to develop their web site for an association, I had to learn PHP. Why? Economic reasons! Web hosting pricing are divided by three (3$ vs 9$) between PHP and Grails/JVM website hosting.
Before that, I'd prejudices on PHP like it's ugly, inelegant. And it can be that. PHP is like C language: you can do bad code, ugly implementation if you aren't rigorous.<p>And it's your project is a "standard" website (i.e. only display page and make some SQL queries), PHP is good enough. No need to use a canon for killing a fly.
If you enjoy programming in it, mostly doing http work and you think you can find talented , smart php developers in your area, go for it.<p>If your ideas need thing like massive concurrency or lots of number crunching, you may want to look at some other options as well.
On one hand, you should use the tool that you know best.<p>On the other hand, putting the language itself aside, dev-tools and existing libraries are few-and-far in between (and they usually suck). And when I say libraries, I don't mean snippets on the internet.. true libraries with tests, etc. Besides the frameworks and a handful of active packages on PEAR- good luck.<p>There is a reason why Ruby and Node have awesome tools (gem, npm, webrick, jasmine, cucumber, etc. etc.) and a very active library sharing mentality.
The end goal is to be more productive and to ship something. Given most software development is hidden from the end user, most times its immaterial what its written on.
It's still a hugely popular language and easy to get started. I suggest using some sort of a framework such as CodeIgniter or Zend to make the code easier to maintain.
I really don't think this is the kind of question to ask on HN, which hinges on the latest fads, the latest of them being Ruby on Rails and possibly Node.js. Use PHP if it's most convenient for you. Heck, I would say you should even use Perl if it's most convenient for you.