Reputation: 2492
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)
Upvotes: 8
Views: 1030
Reputation: 11047
Knowledge in OOP is very much useful for any programmer.If you have basic knowledge in OOP then go ahead with framework.You will understand OOP concepts in that journey. When I started in framework I have basic Idea about OOP. As I make progress in framework I understood OOP concepts more in practical...
Upvotes: 0
Reputation: 8473
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.
Upvotes: 5
Reputation: 57268
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.
Upvotes: 1
Reputation: 56595
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...
Upvotes: 0
Reputation: 18588
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.
Upvotes: 1
Reputation: 35542
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.
Upvotes: 1