Programming Guidelines

These programming guidelines will help you tremendously as you submit your assignments. Remember that all assignments are submitted as a Formal Engineering Report and should follow the guidelines for this type of report.

You do NOT need to write formal programs. Python in this class is used as a computing tool and the features of computer programming (if/then, looping, conditionals, variables, etc…) are all powerful tools to help you solve problems. Leave programming to professional programmers and focus on writing code that solves problems and can be reused by you at a later date.

I have created multiple videos using multiple tools and methods for using Python and solving problems. YOU will be using the Anaconda Distribution and the Spyder editor in this class. In reality, you can write code with any text editor (like notepad) and run it on any Python Interpreter. But, the tools we will use are much easier to use (kind of, Visual Studio Code is also pretty awesome) so I recommend using them.

Input and Data

When solving problems, it will sometimes make sense to have the user (you) input values. This makes sense for situations where you need to run the program multiple times with different inputs. This is often easier than changing variable values in the code. At other times it makes sense to hard code values of variables. Choose what works best for you.

Documenting Code

You will very likely use the code you write in this class again. As such, I strongly recommend documenting the code. These comments are notes to yourself to help you figure out how to use the code when you use it again. In some cases, you will use code you wrote earlier in the class in later assignments. That documentation may come in real handy.

Submitting Code

You are going to be solving engineering problems in this class using Python and programming. The purpose of the assignments is to SOLVE THE PROBLEM. Writing code is part of the methods used to solve the problem. In your engineering report, if you write that the purpose of the assignment is to WRITE A PROGRAM, I will immediately stop grading and give it back to you. Also, the code goes in the Appendices. Unless there is some special code that belongs in the methodology, it should not be there. The methodology is the equations and methods you are using to solve the problem. The code is an expression of the methods used.

These guidelines will help you to write better reports and better use this powerful tool for solving engineering problems.