News for hackers. Stuff that matters.
Re:What do hackers think of PHP? by amrithk on Monday May 05, 2008 @12:31PM (#181538)
Thats interesting. What is it about Phyton that makes it attractive?
Re:What do hackers think of PHP? by simonw on Monday May 05, 2008 @12:47PM (#181560)
It's a significantly better programming language; I don't think you'll be able to find anyone who knows both PHP and Python and will disagree with that statement. PHP is a very simple language with built-in features for web application development. Python is an advanced, multi-paradigm general purpose language that has evolved over more than a decade.

Here are a few Python language features that I seriously miss when I'm working in PHP:

- Modules and namespaces! This is the feature that initially drove me away from PHP.

- List comprehensions (let you construct a new list based on an old list in a one-liner)

- Built in iterator support (easy "for item in collection" support for many different types of collection)

- First class functions and closures (so you can treat your functions as data)

Those are just four off the top of my head. If you haven't looked at Python before (but already know how to program) I suggest taking a look at http://diveintopython.org/ which is a free online book.

Re:What do hackers think of PHP? by norbert on Monday May 05, 2008 @01:25PM (#181601)
Not to take a stand, just FYI: PHP5 has built-in iterator support now and PHP 5.3 includes namespace support as well (TBR this month).
Re:What do hackers think of PHP? by apgwoz on Monday May 05, 2008 @01:53PM (#181633)
But, PHP5's iterator is broken. The only way you can use it is in a foreach loop. In Python, iterators can be used with any iterative construct.

Namespace support in PHP never really bothered me, but I've occasionally run into problems with name clashes with built in functions. It'll be welcomed anyway for sure.

Re:What do hackers think of PHP? by Jesin on Monday May 05, 2008 @12:45PM (#181557)
It's incredibly clean and simple.
Re:What do hackers think of PHP? by rbanffy on Monday May 05, 2008 @12:47PM (#181561)
Zope, Grok, Plone and Django, mostly.

Python is a very good language: easy to learn, powerful and fast enough (provided you understand how to make its various frameworks scale).