You know I been working with php for quite some time now and I still don't use OOP which don't take me wrong I do ,but I only use it for maybe things such as paginations and similar items such as that, but most of my code is procedural.. so my question is how often do you guys use OOP I've talked to some guys thats been working with PHP since the beginning of time and some of them hardly even use it.
Not near as much as I should, I guess. But after all these years procedural just comes naturally to me. Though I am improving lately
I personally believe it should always be used if you plan to re-use your code. It is always a little more efforts, but the benefits will be worth it. Procedural can be a good solution for small programs or websites without a lot of dynamic content. This has always been a good debate, but look at the biggest Frameworks, CMS, CRM most of them are using OOP as their programming paradigm.
True... I just feel more comfortable working with my own code which don't take me wrong I use other peoples code, but I've never really got into using Frameworks I mainly just use all my won classes such as my pagination, e-mail class, admin class, and etc.
It really depends on the type of work you do. I tend to use OOP when it is required to scrape external data, such as backlinks (i.e. $yahooBacklinks = $Class::YahooBacklinks('domain.com') ), as its a clean way of modifying specific code. It also allows for easy extension.
I only use it when working with other code that uses OOP. when writing my own code. I don't use it. ;\
I prefer coding functions than objects, but in a team environment, classes must be used because it is a requirement.
A website like that is small, and classes won't be needed. In a team environment (5 or more people), project is big, classes will be needed to manage the framework.
Damn how large of a project would you be working on that needs 5 people? When you say framework are you referring to numerous classes or something like zendframework such as MVC and etc?
The only time that I don't use OOP is when I am just throwing in quick tests to verify something or making a simple helper function. If you don't use OOP, you're either only working on small projects or missing out on its value. Even when working with just one other, it is very useful (hell, it's very useful when flying solo), but it's practically necessary when you maintain several apps with a team of developers.
Any PHP script that takes more than an hour to complete which is pretty much every time. When you start dealing with large projects you can really appreciate how much OOP makes things easier to manage.
My more serious programming projects are almost purely done in object orientated programming. There are a few things that aren't done in such a way such as the sites entry point (eg. index.php) as well as things like the config and global files (base info needed for the site to work), a basic function library and the language sources and templates. The templates are of course done in php using php itself as the parser rather than smarty or something a like. Rebuilding it that way from the previous way significantly increased the page render times. The way that it's coded with all the oop makes it so easy to add features with minimal editing and alot of code is reused so the files tend to be smaller (basing on my projects observations). MVC style works really well, i've tried it on occasions and I really like using that pattern.
I love OOP but seems like PHP is not going to the direction of 'high level' programming, type hinting, variable types etc', Lately I'm thinking about abandoning PHP for ASP.net (c# syntax of course) becouse of this.
I stick with whatever conventions already exist in what I'm working on. Most of my work consists of adding functionality & improving performance. When I'm done, I want the owner to say "works great !" and their programmer(s) to say "what did you do ?"