Live data from Hacker News

PHP is much better than what you think

fabien.potencier.org

191–200 of 346 posts

Re: PHP is much better than what you think

#191

Earlier quoted context omitted.

It's a double-edged sword however. Users stuck on PHP 5.2 will miss out on potential security fixes to Symfony 2. This can potential compound an already bad situation. I'm not saying Fabien didn't have good reasons, more playing Devil's Advocate.

If only cheap shared hosting was consistently up to date :<

If a host doesn't stay up to date and doesn't let you stay up to date, you shouldn't be using it!

Re: PHP is much better than what you think

#192
post #129

Earlier quoted context omitted.

MRI Ruby is actually significantly faster than CPython these days.

Citation needed. Both CPython and MRI are slow - if you need computational speed, use something else. But when your are comparing them to each other, CPython is faster. I don't know where you are getting that significantly faster bit from. Since most benchmarks are unscientific, this one is as good as any. So here goes: http://shootout.alioth.debian.org/u64q/benchmark.php?test=al...

I suspect that parent was referring to the python 2.x branch, which has been catching up with ruby 1.9, but on most benchmarks started at ~ 3x slower and are now ~ 2x slower.

Since benchmarks are completely worthless, let's just stop this pissing match right now.

Re: PHP is much better than what you think

#193

Do PHP engineers even know what multithreading is? ps. I don't mean crontab

Do you even know how many days/weeks/months I've seen engineers waste on tracking down threading issues? ps. I don't mean sewing shirts.

PHP programs are indirectly affected by those issues anyway

Re: PHP is much better than what you think

#194
post #179

Earlier quoted context omitted.

What does that have to do with SGML?

It's the opening of an SGML process instruction tag. That's why PHP code is inherently embedded in SGML documents...... That's why the LedgerSMB project uses Template Toolkit with tags (that and [% %] causes problems in LaTeX).

You seem to think you have some understanding of PHP which you blatantly do not. You've made a nonsense assumption based on the choice of tag used by PHP to tell the interpretor to treat the text following the tag as code and not to direct it back out the SAPI.

Re: PHP is much better than what you think

#195

Earlier quoted context omitted.

If only cheap shared hosting was consistently up to date :<

If a host doesn't stay up to date and doesn't let you stay up to date, you shouldn't be using it!

I'm referring more to end-users of PHP packages :/

Re: PHP is much better than what you think

#196
post #123

Earlier quoted context omitted.

I got downvoted on another PHP related thread here for bringing that up. Can you truly say they use PHP when they've invested a hell of a lot of money into HipHop to essentially allow devs to write additional PHP code and transform it into C++ binaries? It's a strange way of using it for sure, but it seems to be effective for them.

Right, but Facebook supposedly receives 1 billion new comments + a couple billion likes + a couple hundred million status updates daily , and is probably the largest photo sharing site on the net. Twitter gets about 200 million tweets daily and Reddit has 250 million comments total. Disqus is not much larger than Reddit. So, since most people here are suggesting Python or Ruby, what real world example can we provide…

Google is the real-world example of Python deployment you're looking for, although we don't have the full details of where it begins and ends in their no doubt complex stack. So again, the comparison isn't that useful.

Talking about what languages programmers find enjoyable and productive is perhaps more meaningful. This is where Python and Ruby shine, and PHP falters.

Re: PHP is much better than what you think

#197

I am so sick of this kind of talk. What language do you like to code in? Really? That's great. Now shut up and go code in it. What difference does it make to you that I use PHP, Ruby or original ASP? My website achieves the result I desire. I chose the programming language I use because of reasons that made sense to me and my project, not because I want the approval of a bunch of hipster start-up kids.

agreed. Language is nothing but a tool. A good programmer will get the job done with any tool.

Even good craftsmen prefer top-notch tools over tools in bad shape.

I don't know if PHP is in a particularly bad shape nowadays, since I haven't touched it since 2005, but I do know that tools are just as important as the end result.

Re: PHP is much better than what you think

#198
post #24

Earlier quoted context omitted.

I very specifically didn't say that PHP couldn't be used to build real products, but that still doesn't (at least on it's own) make it good or make it the best.

I guess the worlds most popular websites, and the vast millions of PHP programmers must all not really exist. They can't exist, and can't be making good stuff, because PHP is just doesn't work. Here is a list of template languages people on 'real' platforms use: Python. Airspeed, Castalian, Chameleon, Cheetah, CubicTemp, Django template system, Elements, EmPy, Evoque, HRL Powerful macro preprocessor for HTML, Genshi,…

I guess your point is that there are too many options. But you have artificially inflated the count as you have made this point. Most of the things you have listed are not applicable (either not used any more, or are not general and were never used to compose full HTML pages). Cut out the ones which are not actively developed and you only have a handful for each language.

Since the problem seems to be that you need someone to choose for you: use Django on Python, use Rails on Ruby, and for each one use the templating that comes with it. If you switch to another framework, use its templating language. If you are advanced enough to use a microframework then you are advanced enough to plug in Jinja2 or whatever it is you really want.

Django, Rails, and Jinja2 have excellent documentation. I can't understand why you would think that PHP's documentation is significantly better.

You get what you pay for on super-cheap hosts who are somehow incompetent to understand Python or Ruby.

And choice is not a bug.

Re: PHP is much better than what you think

#199
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?

A framework shouldn't (and most all the popular PHP frameworks out there, including Symonfy adhere to this) matter when your business logic is decoupled from from your framework. Yes, you might have to rewrite some constructors. And some frameworks have different features, but can still be carried over if you need it. You aren't beholden to a single code base.

For example, I can easily move my models from Zend to Symfony without rewriting a thing. Decoupling is a wonderful thing.

So, you have this code base you are using, these libraries that are already written, and tested, and working. Moving to Ruby/Python would require that they all be rewritten, and appropriate libraries be replaces.

Moving to another language isn't a weekend endeavor when you have a workflow and toolset built up over a 10+ years of development in another language that, in that domain, accomplishes the same thing.

Re: PHP is much better than what you think

#200

To be honest I don't like PHP for exactly the reasons I don't like javascript. It's easy to write in a way which is stupid. You can write good php and you can write cool stuff with it. It is easy to non-technical folk to pickup and write a little bit of. It's also amazingly easy to: 1) Write code which is broken and stupid (woops, left error_reporting(E_ALL) on! silly me. dumped all the passwords out into the website…

Read the Symfony source, it's a template for how good PHP should be written.
Post reply on HN