Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

PHP is going towards where other languages have already tread long ago. I highly recommend anyone considering writing a webapp in PHP think twice about alternative languages, Python in particular.

Perl, Python, Ruby, and ASP.NET are all great webapp languages; but Perl is old, Ruby is heavy, and .NET is Microsoft - however PHP developers have no reason not switch to a real OOP language like Python and save themselves from a wheelbarrow-load of trouble.



sort by: page size:

PHP is not the best language anymore for most web development.

Ruby or python is probably the best choice, and I personally favor python.


I find python revolting to look at. I find Pyhton web frameworks confounding to work with. I find PHP to be the most enjoyable language to write web based applications in. PHP just never enters into the discussion of languages but all of it's shortcomings are peripheral to the experience of actually writing code. Minor version upgrades often break things being my biggest gripe.

To folk claiming PHP is to programming what white bread is to a healthy colon, I say that you are the inferior programmer for not being able to love it.

My claim is this: PHP (and most certainly Perl) are to web application development what paint is to painting.

Web application frameworks written in Ruby and Python are to web programming what paint by numbers is to painting.


I used PHP heavily for a few years (~70% PHP, 20% perl, 10% Java), and enjoyed it for awhile. However, it seems like it is impossible to create clean and well-divided code in PHP. This weighed on me heavily, as I had two 10,000 line projects that I was the sole maintainer for. Even if you managed to create well-structured code, it was always very... ugly (too many unnecessary symbols $, ->, etc). It wasn't much fun to work in every day.

I'm using Ruby now and I would never go back.

Here's my rough order of language preference for server-side languages that I have experience in: Ruby > Python > C# > PHP > Perl > Visual Basic > Java > C


For web backend I feel the new PHP and its frameworks are good enough. JS/HTML5/CSS are doing well for web frontend at least, and they evolve fast. Java did well on Android and enterprise software stack. There are also Object-C, .NET for their market segments... Nothing can replace C/C++ for system programming at this point. Additionally, many 'minor' languages are here for different goals(Go, Erlang, etc).

Now the question, why do I need Python at all nowadays? I spent two years trying Python and ended up with PHP/C/C++/JS/Java for nearly all my needs.


PHP is the "Rudy" of web languages. It just won't quit.

I remember switching to PHP for three reasons about 9 years ago. I cycled through Perl, ColdFusion, Java Server Pages, and ASP JScript before getting to it.

1. It was the most accessible free alternative to costly platforms (ColdFusion, MS ASP) or more strict / difficult to configure platforms (Perl, JSP). Error checking was as simple as ASP/JSP and starting up was as simple as paying for a cheap LAMP server that would run it out of the box.

2. It had the largest set of online documentation for both the language itself and tutorials / code examples. This was one of the biggest unavoidable draws to the language. The community was huge and still is to this day although documentation is much more evenly distributed across other languages now.

3. PHP may be one ugly beast but it does pre-package practically every piece of functionality you could ask for within it. I'm not sure I have ever liked the look of the code but there was something magical about being able to grab remote server code via file_get_contents for the first time. It was so damn easy!

If I were to suggest a platform today I would probably have to go with Python. It has all of the same advantages that PHP had in the past but has the added benefit of being better designed and applicable to more than web programming. Ruby would be my second choice simply because the environment setup is a bit more complicated still, although the language is the most beautiful in my opinion.


PHP is one language, I am absolutely not willing to (primarily) develop in. I've left a PHP-only job almost entirely over the matter of language choice (there PHP was used for everything. My worst decision there was -- after getting a Hadoop cluster going -- showing the team how to do Map/Reduce in PHP via the streaming API).

I've never felt a strong repulsion to any language like I do with PHP and I wonder why. I think at the core of are these facts: it's optimized for web development, doing anything complex or CS/math intensive (developing algorithms, doing off line computation, systems programming) is sometimes possible, but always painful. I've played with PHP3 before college and other than what I've learned in a databases course, very little what I've learned in a university seems to be applicable to routine PHP programming. It doesn't feel like actual development.

Ironically, PHP seems to work very well in conjunction with more powerful languages: Yahoo, Facebook and others are built with PHP as essentially a template layer, with Java/C++/Erlang/Perl/Python on the backend. Perhaps the fact that coding PHP doesn't feel like software engineering is it's greatest asset. It's a language that a web developer can immediately be productive in. Yet it also exposes what is often tediousness and triviality of most web development. I remember first playing with emacs, SLIME, cl-sql, mod_lisp and UCW: while I was writing a web application (something PHP is well suited for), I felt I was excercising my brain a great deal more. To a lesser extent it felt true with Python/CherryPy and Perl/mod_perl.

Perhaps what makes PHP successful at Yahoo and Facebook is that they're serious, well-funded technology companies who are able to attract talented developers (who can take advantage of PHP's easy interoperability with C). An early stage start-up choosing PHP seems to almost doom itself by attracting a crowd that treats PHP as Blub (rather than as a sometimes appropriate tool), or in less refined terms "script kiddies".


For web backend, being able to ship a single binary, such as what Rust and Go can provide, is really nice. I don't see PHP as a more compelling solution than either of those languages.

Scripting and command line automation is executed better by Python and Ruby, which excel for writing Unix scripts and tools.

I do not see what the use case for PHP is in 2020.

PHP has one of the most abhorrent language syntax designs this side of Perl, and the standard library is wildly inconsistent.

I really wish PHP would just die. Continuing to drag it along like the dead carcass it is wastes so much human effort. The longer it exists, the longer we have to support it.


There isn't a language that can replace php in 2021. Javascript doesn't have the size of build-in library. Golang is compiled and limited, blank spaces/tabs will kill a Python program. Ruby /rails is slower. All are harder to host. What could you replace php with?

The tales of legacy mistakes holding back php are things with no basis in reality. What legacy mistake holds php back? Method names/parameter ordering?

When I started with php in 2001 those elite programmers at meetups were looking down at php because Java was cool. In 2003 those elite programmers thought php should die because asp took over. PHP kept going along quietly taking over the web until the facebook movie came out making PHP cool for a moment. Those elite programmers decided PHP was too mainstream and the why PHP sucked movement started. The elite guys moved to Ruby On Rails then node/MongoDB, angularjs, React, Nextjs leaving each ecosystem for the next hoping that one day they will strike gold.


I kind of agree. But I still find 90% of extremely talented programmers breath a sigh of relief when they find they're not having to use PHP. Even for web development.

PHP was great a few years ago, and by great I mean "one of the only options". PHP is active on every shared web host around. It's the norm. Only recently have the likes of Ruby and Python become popular on shared hosts. Personally I think that's fantastic.


PHP has been the default language for web development for years and I have no dought that it will continue to be well supported. Python has been the up and comer. Cutting edge tech is being done in python and will continue to be. If I'm going from zero web and are looking ahead I would choose python. If I need a job I would choose PHP. There's a massive amount of php code out there that needs support.

As far as I know, PHP is the only major programming language that considers itself a "web programming language."

Use whatever language/framework is best for you. That could well be PHP, and if you only know PHP well, it probably is.

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?)


Sincere question, but PHP is still widely used?

I remember that around the year 2002 it was almost the only choice (besides Perl) on shared hosting, but on this days its just a nasty language and with so many beautiful languages like Python GoLang and Ruby why would anyone use PHP for a new development?


Folks, I have seen too many HN posts on the fact that PHP is not a good language to develop a robust web application, despite of the fact few of the biggest web sites are running on PHP. We(my team and me) started debating on the issue of choice of the technology for the next project. I am still in some ways not convinced that python may be a better approach.

PHP and Python

* Both have good framework web.py | codeigniter

* Both have good helpful community and support

* Both large set of plugins

How will it impact my webapp if it is written in Python and not PHP


C and JavaScript.

I worked with Perl before PHP but never grew to like it (it's not consistent enough and not exactly easy on the eyes, either).

I do understand the tradeoff between efficiency and power, and PHP hits that sweet spot just right for web programming.

Worrying _too_ much about language efficiency when it comes to web programming is clearly a case of premature optimisation. PHP is efficient enough (probably Perl and Python as well, maybe not Ruby ?).


So, I wouldn't really call myself a "programmer," because I'm a front-end web designer. I'm learning more and more web programming and I'm obviously using PHP. The main issue I see with languages like Ruby or Python for novices like me is that when you ask a novice (running on Windows) to go into the command line, that's like asking a cook to go milk cows. The cook will figure it out, but fuck you.

Sure, there's a learning curve to any new language, and I would love to learn a "better" language, but, if you can't explain to a novice why a certain language is better, the novice is going to go for the smallest learning curve and the language with the best/most ubiquitous documentation.

What do Python or Ruby do that PHP can't? Are they "faster?" I've heard that they are more secure, but does that mean that PHP can't be as secure if a skilled developer is coding for security? People say things like "rapid development," but I've been using CodeIgniter and it seems pretty rapid to me. What it all comes down to is this: are Ruby and Python "practical" for novice programmers like me? Truly? If not, then doesn't it make sense to start with a language like PHP and then, when you have figured shit out, make the jump to Python or Ruby? I wish this was more clear.


I'm a PHP developer (damn, this sounds like I only use PHP, but it's my favorite one). I really like PHP, it's easy to learn, easy to deploy, probably one of the most documented language. But let's be honest, all this easy stuff brings people with poor or no knowledge. Probably if ruby or python were easy as PHP to deploy, we probably would see lame ruby and python code too

PHP doesn't require any libraries to build a simple website. I've yet to see any document that shows in great detail (more than a simple 1 chapter static page based site) how to build a website using Ruby or Python by itself. No libraries, frameworks (no Rails, no Django) or other external stuff, just plain old Ruby or Python. I think this combined with the fact it's very easy to learn, the ton of tools out there, ton of web apps make it a hard language to kill.

What really can be done? Should they make a new version that provides more consistant function names and break backwards incompatibility? I've yet to hear what people think should be done with PHP besides abandoning it.

That being said I don't think it should die, I think it has it's place. I'm not as smart as the rest of the folks on here, but for doing client sites, PHP gets the job done very fast.


Go with Python. PHP is probably the worst language I've had to use (Single namespace, poor unicode...)

Python on the other hand is pretty cool. It can be OO, functional, or procedural depending on how you want to look at it. It also has a lot baked into the standard interpreter and has some really awesome frameworks (Django, Pylons)

next

Legal | privacy