Log in

View Full Version : Php oop



Schmoopy
02-06-2009, 05:03 PM
Hi, I've learnt a lot from this site and many others about PHP and although I know a bit of PHP I'm no where near a real programmer, but I'm just wondering, do I need to be fully competent at procedural programming before I delve into OOP? Or is it more like 2 paths, with OOP being easier and more efficient in the long run, while procedural programming is there for smaller projects?

To summarise, is it better to be completely fluent in the procedural programming side of PHP before moving into OO or does it not matter?

P.S - If anyone works developing sites with PHP for a company are you expected to know OOP or does it depend on what size the project is?

Twey
02-06-2009, 10:16 PM
OO is also procedural/imperative at its core. There's nothing stopping you learning both at the same time.

I suspect that any serious company would expect a potential employee to be experienced in (i.e. have a good grasp of all aspects of) the language of development.

Nile
02-06-2009, 10:34 PM
Yup. I think you could learn both. Using classes is another way to program. You can program old and dirty - or clean and new(not really though..).
Here's a tutorial about it that I learn from. (http://www.way2web.net/site/coding/understanding-object-orientated-php)

techietim
02-06-2009, 11:02 PM
Woah, I wrote that tutorial, but I do not recommend you learn from it. It is very outdated and was written when I just started to touch on object oriented programming.

Hopefully someone will post a link to a better tutorial.

Twey
02-07-2009, 12:15 AM
Two things to note: 1) OO is only one way of tackling these problems, and it isn't automatically the best; and 2) any company that seriously cares about clean code probably isn't going to be using PHP anyway.

Schmoopy
02-07-2009, 12:26 AM
What would they use instead?

Twey
02-07-2009, 01:58 AM
Java and C# are big in the industry at the moment, but there are also notable instances of Ruby, Python, and some Common Lisp.

mburt
02-07-2009, 03:48 AM
I think it's pretty common to see open source frameworks to be used now-a-days like Ruby on Rails, as well. That would be OO coding I guess, except the majority of the coding is already completed for you.

Twey
02-07-2009, 05:31 AM
Java and C# mandate OO, so any framework used will be OO-centric. Some Ruby, Python, and Lisp frameworks are OO-centric too, but others take a different approach (mostly functional or reflective).