Live data from Hacker News

PHP is much better than what you think

fabien.potencier.org

151–160 of 346 posts

Re: PHP is much better than what you think

#151
post #94

Earlier quoted context omitted.

So why did you comment in the first place, in what world do you find it expectable to berate something with no working knowledge? Also I have no trouble developing PHP code that halts on the first sniff of an error. But yes, with no experience of the language it will happily chug along.

See my clarification. I think I may have been a bit unclear and/or you may have misunderstood my post.

Talking about the PHP of 2006 and then blasting the PHP of 2012 is like talking about George W Bush and then blasting President Obama.

They're almost completely different language, and while PHP 5.3 certainly has warts it's vastly better than PHP 5.0.

Re: PHP is much better than what you think

#152
post #110

Earlier quoted context omitted.

You've heard of PHP SAPIs right? You can most defiantly use PHP outside of a "web environment". I have PHP daemons managing the sending of email and sms, and another used to manage incoming data that is fed into our local database. These have all ran for years (7+) with no issues.

I have used it for all kinds of things. However your code is still embedded in SGML output ;-)

Erm, no it is not.

Re: PHP is much better than what you think

#153
post #135
post #55

Earlier quoted context omitted.

Learning how to use a language is, essentially, an O(1) operation. The constant factor may be high, but it's just that--a constant. Moreover, it should not take you more than a couple of weeks to learn any language (save obviously impractical ones like Malbolge) well enough to use it for a web project. The policy at my school is that you should be able to pick up a new language well enough to use in a class over the…

> Moreover, it should not take you more than a couple of weeks to learn any language This is why I find the "you can't find Ruby/Python/whatever developers" argument unconvincing. If you're a good software developer, you can learn new languages. You like learning new languages. It's only the crap developers who typecast themselves in one role throughout their career. And while I don't believe in all the nonsense abou…

You can, but I think the benefits are vastly overestimated. Languages are tools and the purpose of engineering is building, not having a tool fetish. This doesn't mean one should use bad tools, but when learning new frameworks or languages I almost always feel like I am wasting time.

The innovative ideas in programming language design are few and have been known for many years. Learning Ruby or Python instead of let's say Perl will bring you almost no benefits from a technical perspective.

You're essentially paying with your time to enter the Ruby&Rails ecosystem of jobs, consulting gigs, events and so on but you're still building websites using the same protocols, servers, databases, etc.

Re: PHP is much better than what you think

#154
post #110

I am not convinced. My argument is not that PHP sucks or that anything else. It is rather that PHP is lexically tied to corner-case development. In that case PHP is very good at some things but not really all that great for others. PHP started out as being a pre-processor for SGML documents. All PHP code is contained inside SGML program instruction tags. PHP has never changed this, so however it has developed it is s…

You've heard of PHP SAPIs right? You can most defiantly use PHP outside of a "web environment". I have PHP daemons managing the sending of email and sms, and another used to manage incoming data that is fed into our local database. These have all ran for years (7+) with no issues.

7 years? Really? Cause resource ids in PHP are not recycled, and I figure that at some point during those 7 years, you'd have opened enough connections, files and database handlers that you'd reach the limit of integers and PHP would just abort.

Re: PHP is much better than what you think

#155
post #64

Earlier quoted context omitted.

Do you have inside info on this? I've seen several people from Facebook comment that they are in fact using PHP. The fact that they're compiling to C++ is a consequence of the slowness of the programming language implementations of those languages that are used traditionally for web development. AFAIK Ruby was and still is the slowest of the bunch.

A couple people I know well spent the summer there (I actually visited one at the old headquarters; it was pretty cool). One now works there full time (the other hasn't graduated yet). I also talked to some fulltime engineers who were not using PHP. Now, it's reasonable that I did not get the full picture, but the people I did talk did not use PHP themselves and claimed that new projects didn't either. Perhaps this v…

Interesting. What were they using, C++? I've heard about D...

Re: PHP is much better than what you think

#156
post #126

Earlier quoted context omitted.

I have not found this to be the case. There are a lot of small/medium sized companies that probably started out with a custom Drupal/Wordpress site and have now out-grown it, but don't want to re-write the whole system just so that they can use Python/Ruby. Using PHP is then a no-brainer and so moving the codebase to Symfony2 is a great option for them. While Wordpress and Drupal command such a large share of the web…

How is moving to Ruby/Python needs a rewrite, but moving to Symfony2 does not?

That's what I was wondering.

I also had a look through the Symfony2 docs. Perhaps it's just me being a Python bigot, but the code there doesn't look any better than the raw PHP: http://symfony.com/doc/current/book/from_flat_php_to_symfony... And the "helper function to render templates" in the section above it also looks fairly deranged. Isn't that included in the framework somewhere?

The bits that do look ok seem to be because they're copying Django/Jinja2 templating.

Re: PHP is much better than what you think

#157

Earlier quoted context omitted.

Yeah - "shit" being the operative word there. The problem I've found is that there's a kind of anti Python paradox at work with PHP: Better than 95% of the PHP jobs out there are horrible scut work for companies that don't give a shit about quality or decent development, even though it costs them an arm and a leg maintaining their steaming legacy codebase. The 5% that you'd actually want to work for need to have a se…

horrible scut work for companies that don't give a shit about quality or decent development, even though it costs them an arm and a leg maintaining their steaming legacy codebase Damn, you just described my job perfectly. "Test framework? What's that? Sounds like it'd take up too much valuable programmer time. PS enjoy walking on eggshells whenever you try to change something because there's no regressions." (╯°□°)╯┻…

The best bit about those environments is that the devs who crank out the most code (ie. LOC-wise) are feted, but they're basically just standing in the bottom of a hole, digging.

Re: PHP is much better than what you think

#158
post #32
post #13

PHP is easy to deploy on. That's it. That's why it's popular. It's braindead easy to go from text editor to web URL, it's braindead easy to unzip someone else's project and run it. It requires virtually zero sysops experience to be able to use. You don't even have to worry about setting those +x bits like you used to in the good old cgi-bin days. For those of us who aren't afraid of a little ops work, there are far b…

"PHP is easy to deploy on. That's it. That's why it's popular. It's braindead easy to go from text editor to web URL, it's braindead easy to unzip someone else's project and run it. It requires virtually zero sysops experience to be able to use. You don't even have to worry about setting those +x bits like you used to in the good old cgi-bin days." And that's exactly why PHP is the better choice for those of us who d…

But it still doesn't make PHP a good programming language.

I am doomed to fix legacy PHP projects for the rest of my life, because they are so badly written they simply cannot be upgraded to newer versions of PHP.

Yes it's popular and I've even seen designer jobs asking for php knowledge (lol), but that just tells us why it's so hated!

The new PHP might be great, but all those numbers the article has don't tell us how many of those are using newer versions of PHP. I bet 80-90% of everything written in PHP is STILL Why is PHP so big? anyone can use it. Why is it so bad? When people actually learn how to program, it simply lacks everything.

I have been stuck with PHP for 4 years now and if at any point my boss lets me fix these projects, I'd run away from PHP as fast as possible...

Re: PHP is much better than what you think

#159
Well, the reasons I started learning PHP were:

1. It was the most popular web language when I started (in 2000), the alternative being ASP...

2. It's extremely easy to use and set up. Most starting programmers/developpers work on Windows. If you want to start developping on Ruby or Pythons you have two possibilities:

- Install linux, which (whatever you may think) is not easy for any newbie.

- Try to work out the Windows ports of your programming language of choice. In the case of ruby, you have to find windows installs for ruby, gems, bundler, rake, rails (or whatever app you want to use), git, probably cygwin, your webserver of choice, etc... Most of these elements are not made for the Windows ecosystem and the ports are usually pretty poorly documented.

If you use PHP, you just have to: 1. Install XAMPP. 2. Click on "launch server" 3. go to http://localhost/

This is why PHP is still popular.

Re: PHP is much better than what you think

#160
post #110

Earlier quoted context omitted.

You've heard of PHP SAPIs right? You can most defiantly use PHP outside of a "web environment". I have PHP daemons managing the sending of email and sms, and another used to manage incoming data that is fed into our local database. These have all ran for years (7+) with no issues.

7 years? Really? Cause resource ids in PHP are not recycled, and I figure that at some point during those 7 years, you'd have opened enough connections, files and database handlers that you'd reach the limit of integers and PHP would just abort.

Hah! Yeah, sorry I should have worded that better. They have been restarted as servers have been upgraded / restarted.
Post reply on HN