Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Slides and Presentations
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Aerospace and Mechanical Engineering
tlambert
Slides and Presentations
Commits
0e7a9762
Verified
Commit
0e7a9762
authored
3 years ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
add(sw dev1): var naming, comments
parent
4500e48c
Branches
dev
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#6360
passed
3 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
workshops/software_development/sections/documentation.tex
+26
-1
26 additions, 1 deletion
workshops/software_development/sections/documentation.tex
workshops/software_development/sections/naming_conventions.tex
+11
-0
11 additions, 0 deletions
...hops/software_development/sections/naming_conventions.tex
with
37 additions
and
1 deletion
workshops/software_development/sections/documentation.tex
+
26
−
1
View file @
0e7a9762
...
...
@@ -46,8 +46,33 @@
\subsection
{
Comments
}
\label
{
sec:doc:comments
}
\begin{frame}
{
\insertsectionhead
}
\begin{frame}
[fragile]
{
\insertsectionhead
}
\framesubtitle
{
\insertsubsectionhead
}
\begin{itemize}
\item
Add information directly to the code
\begin{itemize}
\item
Explain usage, method, limits, references, justify decision, etc.
\end{itemize}
\item
Comment blocks as function header
\begin{itemize}
\item
In Matlab, used for
\lstmat
{
help
}
and
\lstmat
{
lookfor
}
\begin{lstlisting}
[
language=matlab,
frame=single,
]
function z = sum(x,y)
% SUM Returns the sum of the two inputs
% This function returns the sum of the two input numbers.
% Usage:
% z = SUM(x,y), returns z, the sum of x and y,
% where both x and y are scalars.
\end{lstlisting}
\end{itemize}
\end{itemize}
\end{frame}
...
...
This diff is collapsed.
Click to expand it.
workshops/software_development/sections/naming_conventions.tex
+
11
−
0
View file @
0e7a9762
...
...
@@ -56,6 +56,17 @@
\begin{frame}
{
\insertsectionhead
}
\framesubtitle
{
\insertsubsectionhead
}
Variables are in general in
\lst
{
camelCase
}
or
\lst
{
snake
_
case
}
.
\begin{itemize}
\item
Longer name if large scope (used in all the code)
\item
Shorter name for small scope (indices, iterators)
\item
Avoid confusing names (
\lst
{
point
}
and
\lst
{
points
}
in the same code)
\item
Prefix
\lst
{
n
}
for number (
\lst
{
nBlades
}
),
\lst
{
i,j,k
}
for iterators (
\lst
{
iFiles
}
)
\item
Avoid negative booleans:
\lst
{
isConverged
}
better than
\lst
{
isNotConverged
}
\item
Avoid using 'special' names that would conflict with an built-in
function:
\lst
{
mean
}
,
\lst
{
cd
}
,
\lst
{
sum
}
\end{itemize}
\end{frame}
\subsection
{
Constants
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment