What is the best file-extension to use for a package?

The documentation uses an “.m” file for its example:

But the Mathematica File → New → Package command yields a “.wl” file.

What is a new user supposed to make of the discrepancy? Which one is right, and which one is wrong? Where has Wolfram hidden clear instructions for how to produce a code-library?

Joe,

Both work. Use .wl it’s the newer standard. I can send you better instructions with an example when I get to my computer

Thanks again.

Neither is right or wrong. .m is slightly more compatible as it works in older versions and there are a few rare situations where it seems to be required (e.g. PacletInfo.m). You are very unlikely to come across these situations.

While .wl is newer, using .m will have no disadvantages at this point.

You will notice that all files in Mathematica’s installation directory still use .m as of 11.1.

If you look at packages published by people at Wolfram, you will find that some use .m and some use .wl. Generally, it is a good idea to use these packages (such as GitLink) as a model.