Why do PHP developers differentiate OO code from non-OO code?

Sway

Ruby and Python are married.
Dec 19, 2010
194
76
I never understood this. Could someone please explain this to me? The question might not make much sense but when something written in PHP gets released, it usually gets identified as being written using OOP.

@Kryptos @Markshall @eckostylez @LeJian
 
Last edited:

Sway

Ruby and Python are married.
Dec 19, 2010
194
76
Yes but it seems to be specific to the PHP community to identify that their code was written using OOP or not using OOP. This does not really happen between Python and Ruby developers, and I'm pretty sure it doesn't happen with any other language, at least to my knowledge.

My only theory on this is that using OOP when writing PHP isn't a usual thing to do. But that doesn't make sense, because PHP is used by tech-giants like Facebook and is a fully-developed language.
 

iCranavvo

nope! not really!
Oct 27, 2011
33
14
PHP has a lot of noob developers and once a noob developer learns OOP and incorporates it into their projects they think their code is now strong, structured and flawless when this, sometimes, isn't the case. It's become somewhat an acceptance to code in OOP, which is kinda' daft considering not many people are taught WHEN it should be used or taught how to use OOP correctly (not just in PHP).

It's not that I am against OOP code but it's not something to brag about. All that matters if the point of the script is met.
 

RastaLulz

fight teh power
Staff member
May 3, 2010
3,934
3,933
PHP has a lot of noob developers and once a noob developer learns OOP and incorporates it into their projects they think their code is now strong, structured and flawless when this, sometimes, isn't the case. It's become somewhat an acceptance to code in OOP, which is kinda' daft considering not many people are taught WHEN it should be used or taught how to use OOP correctly (not just in PHP).

It's not that I am against OOP code but it's not something to brag about. All that matters if the point of the script is met.
You must be one of those "noob developers". You should always use OOP, there is no when factor, unless it's a few lines of code, and not an actual project. Generally if you do use OOP, your code is structured, that's sort of the point; it eliminates redundant code. As for it being flawless, that's not an OOP or non-OOP thing, but rather a factor of the programmers competence.

OOP isn't something to brag about per se, but it's surely something that should be noted in a projects details. Sure you can accomplish a projects goal without using OOP methods, but at the end of the day, it's going to be sloppy, lots of redundant code, and most likely slower.
 

Ecko

23:37 [autobots] -!- eckostylez [[email protected]]
Nov 25, 2012
1,398
962
and most likely slower.
procedural has almost always been faster

oop is structured, which is why it is heavily favored. when working with other developers, this organization helps immensely.

php is a multi paradigm programming language, so the only thing that really matters is efficiency and organization. php is also an interpreted language, so arguments for oop are weak when you consider console oop programming with compiled code. with php, data is meant to be stored in databases, whereas majority of compiled code uses objects to store data.

a lot of people who claim to do oop don't even do it properly. when you have procedural code in objects and classes, you are not utilizing oop.
 

iCranavvo

nope! not really!
Oct 27, 2011
33
14
You should always use OOP

Okay, let me just create an object and a function just to print text out even though echo(); simplifies this process completely... OOP is used pointlessly sometimes, and the more PHP based projects I see the more you see over complicated messes.

You should only utilize OOP when it is needed otherwise it's just pointless. And this is where the aspect of "noob developers" comes in, when they first learn how to make classes they do it with no point- just for the novelty.

To be honest, it's just Habbo forums which idolize OOP to the max as if it's something to be proud of.
 

ying

goddess
Jul 4, 2010
82
19
Okay, let me just create an object and a function just to print text out even though echo(); simplifies this process completely... OOP is used pointlessly sometimes, and the more PHP based projects I see the more you see over complicated messes.

You should only utilize OOP when it is needed otherwise it's just pointless. And this is where the aspect of "noob developers" comes in, when they first learn how to make classes they do it with no point- just for the novelty.

To be honest, it's just Habbo forums which idolize OOP to the max as if it's something to be proud of.
I agree this guy hit the hammer on the needle imo.... OOP is 8/10 un-needed people use it because they do not want to be criticized by others for having ''unclean'' code.. No matter what you say i.e OOP makes page load faster, thats ridiculous it probably makes it load faster by like 3 milliseconds.. not a big change, apart from that if the code does what its supposed to do, and its noob friendly, it doesnt matter if you use OOP or not, if its clean it sjust a perk, but thats my view on it, anyway going off topic here lawl -
 

Users who are viewing this thread

Top