README.md 5.06 KB
Newer Older
Praetorius, Simon's avatar
Praetorius, Simon committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Purpose of this Document
In the module the exercises and projects will be submitted online into a version
control system [Git](https://git-scm.com/) hosted at the MatNat [GitLab](https://gitlab.mn.tu-dresden.de)
platform, which is a web-based Git repository manager similar to [GitHub](https://github.com) 
and [Bitbucket](https://bitbucket.org).

Handing in solutions to exercises and projects digitally on such a platform is a 
good way of learning and training collaborative coding, which is commonplace in 
Scientific Computing research groups.

In order to allow fast correction and evaluation of submitted solutions, we require
a predefined structure of the repositories and coding styles to be follwed. Not
following these rules for repositories may result in your solution not being graded.
You will then have to reformat it and submit again. Not following the style guidelines
may result in point deduction, with the amount of points depending on the impact your
style could have on actual collaborative projects.

# Your Repository on GitLab
## Account
In the first tutorial we will create an account on the local GitLab platform, 
using the ZIH-Login (s...-number) for the account user name.
This ensures that you will get credit for your submissions.

## Project Name
Please form groups of up to three members and exchange contact details so you can find
each other on GitLab. One of you should create a **private** (!) project, and invite the rest
of the group. The name of your project is `scprog-Name1Name2Name3`, where Name1
is the last name of the first student, Name2 that of the second student, and so on. These
names should be sorted alphabetically. If your lineup changes for any reason during the
course of the semester, please create a new project that reflects this and inform your
tutors.

## Directory Structure
Your repository should consist of two levels of directories, one for the exercise sheets and
one for the individual exercises. This results in a tree structure like this:

```
sheet1
Praetorius, Simon's avatar
Praetorius, Simon committed
39
40
41
42
43
44
45
46
47
48
 +-- exercise1
 |    +-- main.cc
 |    +-- solution.txt
 |    \-- <header and source files>
 |
 +-- exercise2
 |    \-- <files as above>
 |
 \-- (...)
 
Praetorius, Simon's avatar
Praetorius, Simon committed
49
sheet2
Praetorius, Simon's avatar
Praetorius, Simon committed
50
51
52
53
54
 +-- exercise1
 +-- exercise2
 \-- (...)
 
(...)
Praetorius, Simon's avatar
Praetorius, Simon committed
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
scratch
```

You are free to name and structure your C++ files in any way you like, but there
should always be a file named `main.cc` that is a sample application of your implemented
classes. Often the content is given in the exercise, if it isn’t you are free to choose
sensible test cases yourselves. Make sure that this file `main.cc` can be compiled with
the command given in the lecture, or alternatively provide a [MakeFile](http://www.c-howto.de/tutorial/makefiles/) 
that builds the exercise.

The file `solution.txt` is meant for the output of your `main.cc` and for answering
questions that appear in the exercises. If an exercise is of theoretical nature and doesn’t
include actual coding, this is the only file you have to submit. In the case 
optionally a LaTeX file `solution.tex` can be submitted.

The directory `scratch` is meant as an area where you can put temporary files, solution
attempts and other things that aren’t actual submissions. Any file put there will be
ignored by the tutors, and can neither increase nor decrease the number of points you
receive.

## Access to the Repository
Praetorius, Simon's avatar
Praetorius, Simon committed
76
Please give your tutor @spraetor write access to your project so that your submissions can be
Praetorius, Simon's avatar
Praetorius, Simon committed
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
graded. You also need to give read access to the repository to all tutors if there is
more than one, regardless of the group you are in. This allows for flexible handling of
unforeseen situations.

# Style Guidelines
All programs you submit should follow basic programming rules like the following:

- **Formatting**
  - Put each instruction on a separate line (two lines if it is very large)
  - Use spaces to separate variable names, functions and operators
  - Indent your lines to visually mark different lines belonging to different scopes
- **Variable names**
  - The name should reflect the purpose of the variable
  - Variable names start with a lowercase letter, types with an uppercase letter
  - The rest of the name format for identifiers is up to you
  - Simple counting ints and similar variables are exempt
- **Comments**
  - Comments allow others to understand your intentions
  - Tutors can only give you points if they understand what you were trying to do
  - *Guideline:* one comment per class, per function, per algorithm subtask, per tricky or "exotic" source line
  - Don’t comment to much either, this may visually drown the actual code or diverge from what is actually coded (!)
  - Leave out trivial comments ("This is the constructor")
- **Language constructs**
  - You may use any construct you want, even if it has not yet been introduced in the lecture
  - Avoid constructs that have been superseded by better alternatives in the lecture
  - Declare variables and references as const where it is possible
  - Separate interface and implementation by correctly using public and private
  - Use exceptions instead of asserts / aborts and smart pointers instead of raw pointers once the lecture has introduced them