coding-stylemodelica

Modelica style guide


For many programming languages there are style guides available, e.g. PEP8 for Python, this Matlab style guide or the style guides by Google. For Modelica I found the conventions described in the Users Guide, but is there something more comprehensive available? And, ideally, a tool that helps with the re-formatting, indentation etc.?


Solution

  • The guidelines in the Modelica User's Guide are the only ones I am aware of. The topic has been discussed several times at the design meetings and I've written one paper that discussed the topic but didn't really propose concrete guidelines.

    Part of the issue is that while the Modelica Association might have their guidelines (as your've seen), they don't represent any particular business or industries guidelines which might be different. In other words, I could envision having many different guidelines floating around that are tailored to specific types of models or specific industry conventions. But the Modelica ones are the only ones I am specifically aware of (although it would not surprise me if large organizations using did have their own formal style guidelines).