Closed danschmidt5189 closed 8 years ago
Listing Moose first makes it immediately clear that the current package is a Moose class, and also allows you to immediately list the parent class and the roles. Another reason modules like Dancer and Moose are traditionally listed first is because they enable strict
and warnings
. When you open up a perl module file you want to see something that enables strictures at the very top, instead of having to scroll down until you find Moose or Dancer or Test::Modern at the bottom of the import list.
The style guide suggests placing auto-exporting files (like Dancer) first:
Why is that? Why not always load our prereqs first (e.g. Tilt::Core and MooseX::Modern), since they act like pragmas and are, themselves, auto-exporting?
Also the language is a bit vague - the real issue here is that some files forcibly export symbols into the caller's namespace, and for those import order matters. (Because those symbols can be overwritten.)