Releasing NAP::policy to the world

We published an article on this site, over two years ago, describing our policy / pragma module. Today we are releasing it to the world, in its own public GitHub repository.

I’m not going to detail what the module does, you can read the old article and the source code for that.

The reason that the entire NAP-policy distribution exists is that we wanted to encourage our developers to follow our best practices, without having to think about them.

Need a class? package My::Class {use NAP::policy 'class';...}.

Need a set of exception classes? package My::Exception {use NAP::policy 'simple_exception';...}.

Want to log structured data? use NAP::Logging::JSON;$logger->info(logmsg some => 'data').

Want to create a new application? nap-new-app

Every time our developers don’t have to think about the best way to perform a common task, we win; their energies are better spent working on the actual problem. That does not completely explain why we want the world to see it, though.

Many of the choices we’ve made (Moose, Data::Printer, Perl::Critic policies, Dist::Zilla, RPM) are rather specific to our way of doing things, and are probably not applicable to other environments. On the other hand, maybe they are. Maybe you think that our opinions match your way of working; if there’s enough of you, we may just push NAP::policy to CPAN!

Another reason to publish this is to show the world how we work. We can’t really show you all of our applications, but we can provide hints. NAP-policy embodies what we consider good coding choices and style, and all code written at NET-A-PORTER in the last three years complies with the policy.

We plan to release two of our in-house frameworks soon, one for messaging, and one for non-blocking web APIs. Those should give an idea of how we structure our modern applications and services. More importantly, maybe they can be the start of a conversation with others who have solved similar problems in different ways, so we can learn from each other.

That is what Free Software is all about, after all.

Print Friendly

Leave a Reply