2 ms·
> with most boilerplant gone Boilerplate class variable, boilerplate args variable, both written twice, deliberately cryptic whimsical 'bless' operation that f
by chrisseaton 6y ago
> with most boilerplant gone
Boilerplate class variable, boilerplate args variable, both written twice, deliberately cryptic whimsical 'bless' operation that for some reason needs to be done manually. Come on...
- tyingq 6y agoThe boilerplate class and args aren't mandatory, @_ still exists. I put them in the example to mean that if you wanted to use them, you don't have to pull them out of @_ with boilerplate. As for bless(), it's what makes Perl OO work. Getting rid of it is an option, but to me getting rid of it makes things more cryptic.
- chrisseaton 6y ago> As for bless(), it's what makes Perl OO work. Getting rid of it is an option, but to me getting rid of it makes things more cryptic. Yeah I get it... but it's still boilerplate. Something you have to write out manually each time which you don't need to do in other languages.
- tyingq 6y agoYes, but it is significantly less boilerplate than before. If you get rid of bless(), you would need to add some equivalent to "package" that is OO specific rather than just namespaces, and/or a magical constructor method name. That (to me) is no less whimsical than bless.