2

I wondered whether there is a known formatting guide that Wolfram employees (have to) use when writing Mathematica code?

As stated in Mathematica style guide? there are many different formatting conventions one can experiment with but I would like to follow a standard set of formatting rules.

Gert
  • 1,530
  • 8
  • 22
  • 3
    You can look at several existing projects, pick a style that fits you, and use it. I'm not sure what you mean by "Wolfram developers". Do you mean employees of WRI? If so, why do you think think that the style used by the company is better than some other consistent style? Why don't you evaluate each style based on your own needs, and make a rational decision about what fits your project best, instead of dogmatically following some perceived authority? – Szabolcs Jan 19 '22 at 13:32
  • 3
    Here are a few links to some mature projects by people who have extensive experience in Mathematica (in no particular order): https://github.com/kubaPod/M2MD https://github.com/WolframResearch/codeinspector/ https://github.com/carlwoll/GraphicsInformation https://github.com/FeynCalc/feyncalc https://github.com/WolframResearch/GitLink Some of these are by WRI employees. My personal preference is reflected by https://github.com/szhorvat/IGraphM (influenced by the WL plugin for IntelliJ) – Szabolcs Jan 19 '22 at 13:36
  • 1
    I am not sure that this question is significantly different from the Mathematica style guide? question you linked. I would argue that this question (and that older one) are probably inappropriate for this site, as any answer will necessarily be opinion-based. – MarcoB Jan 19 '22 at 16:35
  • 2
    I absolutely second Szabolcs tip to make your own choice. The requirements for WRIs internal code style are likely very very different from your own so it not necessarily is a good choice for your code... I would even suggest to have a look at non-mathematica style guides to learn more about what the reasoning behind such decisions is. And last but not least: style guides are most useful when you work in a team, my experience is that its much more important that everyone in the team likes and uses the convention than that it is the best possible. So talk with whoever will read your code... – Albert Retey Jan 19 '22 at 18:37
  • @MarcoB: It is in the sense I'm just asking whether the Wolfram company has its own style and whether this is known. This is not opinion based. Either it has and it is or is not known or it hasn't. – Gert Jan 25 '22 at 12:00
  • @Szabolcs: thank you for the interesting links! I looked through some of them and they are very informative on more aspects than just formatting (like project structure etc). The reason I want to know whether Wolfram has its own rules is because I assumed they probably wrote more Mathematica code that had to work together than anyone else. There must be at least some rules that are interesting. I would most probably not copy their whole style but I do think it would be a valuable resource. Asking for the company style also avoids the question being opinion based. – Gert Jan 25 '22 at 12:04
  • I see now that the use of the term developers is indeed ambiguous. I did mean employees. Sorry for that – Gert Jan 25 '22 at 12:06

0 Answers0