in reply to Re^4: How do I go from PROCEDURAL to object oriented programming?
in thread How do I go from procedural to object oriented programming?
"Lady_Aleena is writing code to run under CGI ..."
I was wondering what you were on about there. My code is not meant to replace what the OP already has. This code is meant to demonstrate just one of the many ways you can translate the original code into objects. You don't have to use Moose. The OP doesn't have to use Moose. CGI was never mentioned and the only reason i chose to use Moose is because i am familiar and comfortable with it and i have no problem writing scalable applications with it. To borrow a quote: "In other words, I saw no good reason to expose novices to the core mechanism of object orientation."
Additionally, rather than merely dismissing a technology you should offer at least two replacements. You could have mentioned Moo or Mouse, or Class::Tiny or Role::Tiny ... but you offered no alternatives. You didn't even discuss using "the core mechanism," AKA:
package Object; sub new { bless {}, shift } 1;
One of the key components in great software design is loose coupling -- if you think about, you are practicing tight coupling by adhering to some artificial requirement that the OP has to use CGI. That is 20th century technology and we are indeed living in the 21st century. Care to join us?
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: How do I go from procedural to object oriented programming?
by Anonymous Monk on Apr 22, 2015 at 23:23 UTC | |
by Anonymous Monk on Apr 22, 2015 at 23:31 UTC | |
by Anonymous Monk on Apr 22, 2015 at 23:41 UTC | |
by Anonymous Monk on Apr 22, 2015 at 23:44 UTC | |
by Anonymous Monk on Apr 23, 2015 at 00:58 UTC | |
|