4 ms·
I'm not necessarily a fan of the OO in those either :) I try to use OO sparingly when possible, and in Perl that generally just means I've been using a hash an
by hnick 7y ago
I'm not necessarily a fan of the OO in those either :)
I try to use OO sparingly when possible, and in Perl that generally just means I've been using a hash and decide it'd be more convenient that it keep some functions to itself rather than pass it around to other functions.
I will say in Perl's defense, the bare implementation really made me appreciate what OO actually is under the hood. I felt like I understood it much better, especially since it takes a mixed approach (rather than 'everything must be an object, including Program.cs' which I never really enjoyed).
- Grinnz 7y agoIt does make it very clear that it is just a data structure (state) associated with a class (behavior).
- tyingq 7y agoIt's also pretty neat that you can bless any type as an object. People use the hash most often for obvious reasons, but you can use a scalar/string, array, etc, if you wish.