2

I have recently started to learn PHP and while reading through a bunch of different articles and questions posted on Stack Exchange I noticed everyone recommends learning a framework.

While I am up for the task and already selected Zend as the framework I will start learning at some point, I have only just scratched the surface when it comes to PHP and from what I know one should have some experience in a language before learning a framework. I want to learn the language the right way since I want to get a job as a PHP developer (I already know HTML, CSS, Javascript). At the moment my knowledge of PHP is limited to it's syntax, OOP, cookies, sessions and form validation. I have also developed a blog which contains a search panel, login system and a forum.

What I want to know is how much experience with core PHP should I have before starting to learn Zend? In what parts of PHP should I concentrate my efforts to become a good developer?

I remember when I started learning Javascript I didn't pay enought attention to the language itself and went directly to jQuery, something that didn't go very well for me on the long run I don't want to make the same mistake again.

I have found a similar question here but it didn't seem to answer my question.

0

4 Answers 4

2

Learning the framework might help you learn php.

Learning jQuery first might have gone better for you, if you'd studied the source code for jQuery. Granted, that might not have been the easiest way to go about it, but it would have told you earlier when you needed to go back and study the language fundamentals.

2

I'd say learn a framework when you need one.

PHP itself was created as sort of a framework - unlike most other programming languages, it provides you with the basics you need for web programming out-of-the-box: HTTP request handling, sessions, cookies, database connectivity, a truckload of web-related functions (albeit somewhat unstructured), all come with a vanilla PHP install.

So if you can write a decent enough web application with vanilla PHP, but feel that there should be an easier way to do it (or just to cut out the repetitive boilerplate), by all means look into a framework. Get the fundamentals right (my guess would be that you already have), and then, if you suspect it might benefit you, try out a framework. You may even find that the framework gets in your way more than it helps you: that's fine. Some people don't use any frameworks at all, and there is no problem with that.

jQuery is yet another story; it's a Javascript library, intended to make your Javascript-writing life easier and safer. Javascript runs on the client (unless you use Node.js or PHP's built-in V8), PHP runs on the server, so the two languages are orthogonal, and jQuery has nothing to do with PHP really. Whether or not you learn jQuery, and when, is completely up to you, but as with PHP, my advice is to get the fundamentals right, and then dive right into it. But since you don't actually need Javascript for a dynamic website, you can do it later if you want to focus on the server-side part first.

2

What I want to know is how much experience with core PHP should I have before starting to learn Zend?

Zend Framework has an insane learning curve, as does Symfony, and many other full-stack frameworks. While they're designed for rapid application development, your productivity will certainly suffer if you're not totally comfortable with both PHP and full-on OOP principles.

My answer to your question, then, is to offer an alternative that can help you understand these concepts better. If you want to learn how to develop with a framework, start off with something like CakePHP or CodeIgniter. They're still full-stack, but a bit lighter, and come with some decent documentation and communities.

You don't need nearly as much experience to grok these lighter frameworks, and while they do have their own visions of what PHP OOP is like, you can learn a lot from them, or at least get your foot in the door.

In what parts of PHP should I concentrate my efforts to become a good developer?

This is hugely subjective and depends entirely on what you want to develop, and in some cases what you need to learn is not specific to PHP. I don't think it's possible to answer this fairly and definitively, but I would instinctively point you towards security in any case.

I remember when I started learning Javascript I didn't pay enought attention to the language itself and went directly to jQuery, something that didn't go very well for me on the long run I don't want to make the same mistake again.

This isn't so much a mistake as an opportunity cost. By learning jQuery (which is still Javascript, if not an abstraction with its own style and idioms) you chose not to learn pure JS. By learning a framework you run the risk of learning the framework's idea of what the language should be (this is a problem with PHP, as it is with jQuery), at which point you forego the opportunity to learn the pure language minus the framework. In a more opinionated language (like Ruby), you might learn the framework and the language at the same time.

Which way you choose depends on how much time you have, and what you want to learn. Do you want to learn the framework, or how it works under the hood?

0

Before starting with a framework, I suggest you to complete PHP first.

The advantages of learning a framework is that you can

1) Develop the applications rapidly, 2) You can be more productive, 3) Frameworks have advanced capabilities such as Handlers, cookies setting,deletion etc, database connectivity and much more. A framework really helps you develop applications very easily.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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