# CSCI 103 Spring 2018: Introduction to Programming

## Programming Assignment Warnings

One reason these are important is that we print out your code for grading. If you fail to adhere to these rules, it won't print out the way you intended, and it can be hard to read or test your code.

### file is indented with a mix of tabs and spaces

This means that your code might print with indentation other than what you intended.

Normally you shouldn't be getting this message unless you are not using the course VM or changed gedit's settings. Feel free to ask for help from the instructor figuring this out.

To fix the problem for a single file:

1. Open gedit on the file causing the warning
2. Press ctrl-H to open the Replace tool
3. In "Search for:" type \t
4. In "Replace with:" type 3 spaces
5. Press Replace All and Close
6. Save the file

Also you can change your editor to help solve this in the future, even having it insert spaces rather than actual tab characters even when you press the TAB key:

• Gedit
gsettings set org.gnome.gedit.preferences.editor auto-indent true
gsettings set org.gnome.gedit.preferences.editor auto-save true
gsettings set org.gnome.gedit.preferences.editor bracket-matching true
gsettings set org.gnome.gedit.preferences.editor display-line-numbers true
gsettings set org.gnome.gedit.preferences.editor display-right-margin true
gsettings set org.gnome.gedit.preferences.editor insert-spaces true
gsettings set org.gnome.gedit.preferences.editor auto-save-interval 10
gsettings set org.gnome.gedit.preferences.editor right-margin-position 75
gsettings set org.gnome.gedit.preferences.editor tabs-size 3

• Sublime Settings

### found a line longer than 80 characters

If your lines are more than 80 characters long, they'll "wrap around" when we print them and be hard to read. You should fix this, even if it's just comments.

Note that C++ ignores whitespace, and a "new line" is just whitespace. So you can change

int x = some + incredibly * long - line (with, many, things[on][it]); // long!

to

// we'll break the line in two
int x = some + incredibly * long
- line (with, many, things[on][it]);