note
stevieb
<p>I'm totally on board with what [choroba] said.</p>
<p>If state needs to be shared between methods or even modules/classes, and/or you want to store an object of a different class in an object so you can make calls on it through the main object (eg. <c>$computer_obj->video_card_obj->display();</c>, OOP works (my [metamod://RPi::WiringPi] is a good example of that example, almost literally).</p>
<p>If no state needs kept, no magic between objects needs to happen, and your subroutine naming conventions won't likely clash with already-imported functions, procedural is the way to go (eg. [metamod://Bit::Manip]).</p>
<p>Other times, I've provided both a functional and object oriented interface within the same module for the same subroutines (eg: [metamod://WiringPi::API]).</p>
<p>Personally, the vast majority of the code I write keeps state, so I'd go as far as to guess that 90%+ of the 55 CPAN distributions I've published are OOP.</p>
11138156
11138156