Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

While I have been at university studying a CS degree I have been picking up web development on the side. As I started in the last couple of years, I have mainly been using Rack/Ruby based frameworks such as Rails and Sinatra but I have also looked at - and occasionally used - Web.py, Django and Lift. I realised that I have never used or seen PHP used for web development. This might seem strange but, as a young twenty something, learning PHP doesn't seem like the most fun/hip route to take.

Given this background (which I am sure is relevant to many people my age). What is the best way to approach learning PHP web development? What are the key differences/similarities? Also, what frameworks are widely used and/or respected?

share|improve this question
1  
Why do you need to learn it? From my experience, PHP has a much less readable and writeable syntax, and Python/Django community has many more quality contributors. There's also Node.js being rapidly developed. That's where a young and daring programmer will be valuable. Why do you need PHP? –  culebrón Aug 15 '11 at 18:45
    
If you must and really must touch PHP then Silex is just about the only micro framework worth touching. It's sinatra based. –  Raynos Aug 16 '11 at 8:40
2  
@culebron - PHP's one ugly SOB, for sure, and lord knows I'd rather use something else (Python/Node personally) - but in terms of jobs (UK), it blows Python/Ruby out of the water (for the moment). I did a search for local vacancies. Ruby = 2 jobs, PHP = 20 pages... –  sunwukung Aug 16 '11 at 12:03
    
@culebrón I don't really but many companies still use it (Tumblr for instance) and it would be nice to keep my options open. EDIT: Also, sunwukung is right. In the UK it seems to be king. –  seadowg Aug 19 '11 at 16:00
    
@sunwukung: it depends on your skills and experience, and on what you search for. Last year I decided to quit php and get a python position, and also I cared of sane relationships and environment and was direct about this. This way I limited possible vacancies to a very small number, and it did take a month, but in the end I had 4 offers to choose from and found something enjoyable. If you say I'm a rockstar programmer, I'm not (not a CS education, do not know pointers, etc.). –  culebrón Aug 19 '11 at 18:02

4 Answers 4

I must echo the surprise among the comments that you would want to learn PHP with that background. Your stated reason - that jobs are easier to get - is really not true. There are indeed more PHP jobs, and probably more vacancies, but anyone with any decent Django experience, for example, could take their pick from any of about a dozen vacancies in the UK right now, not to mention tons of remote work from companies across the world.

share|improve this answer
  • For the language, using the PHP manual will be all you need to learn PHP (especially the online version which has also comments and code snippets from other users on almost every topic). Since you have some Python/Ruby background, you can check this reference sheet for differences between the different languages.

  • If you want to use a framework I recommand CakePHP since it's similar to RoR (which I haven't used personally). From Wikipedia :

CakePHP is not a port of Ruby on Rails to PHP, but makes use of many of its concepts.

share|improve this answer
2  
CakePHP is an abomination. Please avoid it. –  Raynos Aug 16 '11 at 8:39
    
@Raynos Care to explain why? I'm really curious about that. –  Nasreddine Aug 16 '11 at 9:35

My advice is to pick one and learn it well. And I don't mean pick one PFP framework. I mean pick one language+framework combo. If you already know ruby/rails (or django/python, or scala/lift, or whatever) then I would make sure I was a superhero with that. There are plenty of jobs as long as you know your stuff.

share|improve this answer

I think the Symfony framework would be a good way to step into PHP. According to http://en.wikipedia.org/wiki/Symfony, it was inspired by rails. You can get it @ http://symfony.com/.

I mainly use Zend Framework, which is also perfectly OOP and employs MVC much like other systems.

As for learning PHP webdevelopment; I shouldn't really answer because I started in PHP, but I reckon you should just go with what you know, but in a Symfony or Zend environment. The programming details will differ a bit but the general ideas are the same. If you need a reference for the language's own functions, php.net is an excellent resource. The rest will be there for you in the framework documentation.

Does that help at all?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.