Ask HN: Still acceptable to use PHP for new projects?
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?
[+] [-] twog|13 years ago|reply
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.
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.
[+] [-] Lazare|13 years ago|reply
Yes, PHP is objectively 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.
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.
(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?)
[+] [-] tjlytle|13 years ago|reply
Just a few quick thoughts:
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.
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 too hard). This may or may not be important to you.
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.
Bottom line is - it's certainly sill worth considering, just know why you picked it (or whatever other language/platform you use).
That said "it's what I know" or "I wanted to try something new" aren't necessarily bad reasons.
[+] [-] Spoom|13 years ago|reply
[+] [-] methochris|13 years ago|reply
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...
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.
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.
Good luck!
[+] [-] jfaucett|13 years ago|reply
1. Its easy to scale (horizontaly) because it has a "share nothing" archtecture.
2. like tjlyte states its centered on the HTTP protocol which is almost always your app protocol
3. its fast
4. its an "easy" language to program, but still supports OOP, namespaces, closures, anonymous funcs, etc.
5. Its highly portable
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 )
[+] [-] Chrix|13 years ago|reply
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.
[+] [-] gardentheory|13 years ago|reply
[+] [-] allardschip|13 years ago|reply
If your ideas need thing like massive concurrency or lots of number crunching, you may want to look at some other options as well.
[+] [-] stevencorona|13 years ago|reply
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.
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.
[+] [-] jfaucett|13 years ago|reply
[+] [-] mukundmohan|13 years ago|reply
[+] [-] hobonumber1|13 years ago|reply
[+] [-] adolfoabegg|13 years ago|reply
[+] [-] jhaaps|13 years ago|reply
[+] [-] 0k1n|13 years ago|reply
[+] [-] rweir|13 years ago|reply
[+] [-] rsanchez1|13 years ago|reply
[+] [-] yousuffauzan|13 years ago|reply
[deleted]
[+] [-] bathorex|13 years ago|reply
[deleted]