I understand that using builder enables subclasses to override attribute defaults easily and roles can require them. This can also be accomplished using default like so:
has 'foo' =>
is => 'rw',
isa => 'Str',
default => sub { $_[0]->_build_foo };
I'm wondering if there are further advantages to using builder I'm not aware of? I've come up with some myself:
builderis declarative so you can introspect thatfoois built by_build_foobuildereliminates a subroutine wrapper making it a bit fasterbuilderallows the use of the helpfullazy_build.
UPDATE To clarify, this isn't about default vs builder in general but default => sub { $_[0]->_build_foo } vs builder => '_build_foo'.