News for hackers. Stuff that matters.

Regarding PHP.

Every time the issue of language choices is raised and php is suggested, many are quick to speak against learning php. I've gotten the impression that php is something I should stay away from, but I am very interested in learning it. Is it worth learning? What are the advantages and disadvantages? Should I just stick with Python (the only language I know currently)? Many of you also say that php will teach you bad habits. It'd be nice to list them so that I, and perhaps others, can stay clear of adopting such habits.

Thanks.

( 7 comments | 2 points | on HN )
Re:Regarding PHP. by bct on Wednesday September 26, 2007 @08:23PM (#60079)
PHP isn't going to ruin you, but if you're comfortable with Python then why bother?

edit: I should be more clear here. There are lots of good reasons to learn PHP, eg. you want to work on a project or job that uses it.

If you want to learn it to expose yourself to new things, some other language is probably a better choice. If you want to learn it because you think that it's a better choice for a particular application than Python, I suspect you're wrong.

Re:Regarding PHP. by chadboyda on Wednesday September 26, 2007 @10:39PM (#60124)
Python and Ruby are great. But if you are interested in PHP and like MVC (such as Rails), I recommend trying Symfony. I use it for a lot of projects. There are still plenty of good reasons to use PHP just as there are any other language. Use what's best for your project. Be sure to consider feature requirements, developer skill sets, and your timeline when deciding.

After enough experience at programming you'll begin to realize understanding 'how to program' is fundamentally different from knowing one particular language or another. It's a logical mindset and way of thinking or problem solving that ultimately matters. Language is just syntax and can be picked up in under 24 hours for most languages once you understand 'how to program'.

Re:Regarding PHP. by rms on Wednesday September 26, 2007 @07:12PM (#60055)
It seems like sentiment is slowly shifting away from PHP hatred as more people that understand good programming practice start or return to PHP for whatever reason. PHP lets you use whatever code you want in combination with html and doesn't force you to use the MVC paradigm. As long as you stick to the MVC architectural pattern, you should be fine.
Re:Regarding PHP. by bct on Wednesday September 26, 2007 @08:18PM (#60072)
What language does force you to use the MVC paradigm?
Re:Regarding PHP. by rms on Wednesday September 26, 2007 @08:30PM (#60082)
Ruby on Rails
Re:Regarding PHP. by bct on Wednesday September 26, 2007 @08:31PM (#60083)
erm... Rails is a framework, not a language.
Re:Regarding PHP. by run4yourlives on Wednesday September 26, 2007 @10:58PM (#60132)
So does python "on" django, but python itself in no way forces MVC.