views:

133

answers:

5

Frameworks being all OOP, would it not be wise to go into frameworks without having a solid background in OOP? I can write basic classes but nothing too fancy or abstract.

How much should I know of OOP before moving to frameworks?

Right now I am PHP Object-Oriented Programming to learn OOP.

EDIT: Once you start programming in OOP, is there a need to move back to procedural? Or is OOP the way to go because it's more organized and more reusable. (obviously if the site is very small, procedural would be fine)

+5  A: 

Its always good to have a strong understanding of what you are working on. so yes I think to be a good programmer you should learn at a high level how OOP works so you understand how classes can be extended etc.

At some point though you will know enough to get started with your framework. So once you are a few chapters in, start using the framework of choice and any time you see something you don't understand research it and repeat.

EDIT: to answer you updated question about procedural.

You should understand PHP first and foremost, OO is very useful but don't blindly create OO code. Understand why you are doing it and know when you don't need to use it. For example (most programers don't really run into this problem) when you hit large scale you may need to push back on some of your OO code to make it run faster. OO is an overhead but its a very useful overhead.

Derek Organ
Alright, I'll build few 'test' sites in all OOP before moving to a framework.
ggfan
Its always good if you can to try build your own very basic framework for a small test project. You'll learn a lot by doing that.
Derek Organ
What exactly do you mean by building your own framework? Does that mean I should make functions/classes that deals with the plumbing codes and then focus on the logic of the site?
ggfan
Yes build a very small framework for yourself that handles routes, templating with Models, Views and Controllers. Try write the basic plumbing you'd need to achieve this. You can use libraries like smarty and maybe some PEAR or ZEND Classes. Its more a educational thing than anything else but if you have a small project its worth doing.In the long run I'd say don't re-invent the wheel and move on to a fully fledged framework for a bigger project. There are situations as you become more experienced where is better to create your own fully fledged framework instead of using off the shelf one
Derek Organ
+1  A: 

Yes, it is highly recommended that you know the building blocks of OOP concepts before moving into any of the readily available frameworks out there. Many of my friends who started their career in a framework (even worse if its proprietary) are clearly struggling now to absorb the core concepts of Object Oriented Programming.

However, nothing is going to stop you from learning side by side these concepts by participating in online communities like this and many other out there. You can read books regarding Design patterns and Object Oriented Programming too.

Bragboy
+1  A: 

I think its very wise to have at least a basic understanding of OOP before moving towards a framework. Most importantly though i think its important to understand the basics of PHP before anything else. I've seen programmers that would describe themselves as advanced users of Zend Framework (for example) but really struggle with old style procedural code and dont understand basic security concepts when not working in a framework. Given the amounts of legacy code most of us will have to deal with in our day to day programming lives then its vital to understand the basics.

seengee
A: 

It depends on the PHP framework you'll be using - knowledge of OOP will certainly be beneficial if you're planning to use Zend Framework or Symfony. There are many other PHP frameworks that are not object-oriented, however...

Bozhidar Batsov
+1  A: 

One of the main points of Object Orientated programming is the fact that when you build your code, you apply a loose context to your implementations such as iteration.

A simple example of iteration is database abstraction, when you have your database statement object, if you implement the iteration interface to that entity you then have an object that can be iterated..

The same concepts are a major factor in frameworks and so forth. so in my opinion its fundamental to have good knowledge of OOP if your creating a framework.

The whole concept of frameworks is to simplify a programming structure and the majoy way of implementing that is by using OOP.

RobertPitt