Update Coding guidelines authored by Jakob Gabriel's avatar Jakob Gabriel
......@@ -52,8 +52,7 @@
- Don't usue tabs in documentations. Tabs are displayed incorrectly in the documentation.
- If you use functions with a lot of input arguments, arrange your code clearly over multiple lines with tab. Use `...` notation for linebreaks. As orientation you should use the vertical line in the matlab editor.
- Use structs to structure related variables in your workspace, for instance
<pre><code>time = struct('start', 0, 'end', 7, 'stepSize', 1e-3, 'vector', 0:1e-3:7);</code></pre> or
<pre><code>option = struct('save', false, 'plot', true', 'simulate', true);</code></pre>
<pre><code>time = struct('start', 0, 'end', 7, 'stepSize', 1e-3, 'vector', 0:1e-3:7);</code></pre> or <pre><code>option = struct('save', false, 'plot', true', 'simulate', true);</code></pre>
- Use `inputParser()` if you want to allow optional inputs. Hint, `misc.defaultParser()` does the same as `inputParser()` but with better default settings.
- Organize your programs in package-folders to avoid ridiculously long file names or file name conflicts. See documentation [Packages Create Namespaces](https://ch.mathworks.com/help/matlab/matlab_oop/scoping-classes-with-packages.html).
- Write a comment after `end` commands, that indicates to which starting command the end is belonging.
......
......