8. Coding

Coding assignments can range from simple programs to full-blown applications. It is important to know how to approach such assignments, so that you can complete them to the best of your ability. Some platforms you may be asked to develop for are:

  • Web — websites and web apps for browsers like Chrome or Firefox
  • Mobile — mobile apps for iOS and Android
  • Desktop — desktop applications or programs for Windows, macOS and Linux.

Learning programming languages

If you are starting a coding assignment in a programming language that you are not familiar with, there are tutorials you can take to understand the basics in a few hours:

Get more information on tools for web, software and mobile application development.

Strategies for programming assignments

Universal strategies that can be applied to make your programming assignments easier:

  1. Start early — this gives you more time to think about the task and how you might approach it, but also more time to get help, if needed
  2. Plan your program using pseudocode — pseudocode is a great method for planning what you want to code in way that is easy for people to understand
  3. Prepare the file structure — for simple cases this may be a single file, but for larger assignments it is helpful to create all files within a project and link them appropriately. For example, if you are coding a single-page website:
    • Create the HTML, CSS and JavaScript files
    • Link the CSS and JavaScript files using the appropriate tags in your HTML file.
  4. Use comments — all programming languages allow you to write comments that are lines which are ignored by the program. A great way to use comments is to type out the steps required for coding a piece of functionality. You can then follow these steps to code it line by line
  5. Take a break — if you ever get stuck, it’s probably a good time to take a break. Breaks as short as 5 minutes can be enough to clear your mind
  6. Explain your problems to a rubber duck — Rubber duck debugging is actually a legitimate way of solving programming related problems. It works simply by explaining your problems aloud, which can help you find what’s causing bugs in your code.

Citing code

Students should confirm what is permitted for a specific assignment prior to commencing. Some assignments do not permit the use of external support and all code must be written by the individual. However, if you are allowed to use externally sourced code it must be referenced if it is not your own original work. Failure to reference externally sourced, non-original work can result in misconduct proceedings. An external source is code, including from anywhere on the internet or from a tutorial, taken or used to write your own code.

References should provide clear and accurate information for each source and should identify where they have been used in your work. A single URL is not a complete or accurate reference. URLs should link directly to the work cited, not just to the website it is hosted on. An example format for referencing online sources:

[where used] : [title of asset], [creator of asset]; retrieved from [website title] ([URL]), Last accessed [DD/MM/YYYY}

For code references, the [where used] should map to the position in the code e.g. in the code itself, create a comment to identify where in your code you have used an external source:

For code with no changes or adaptations

In text

(How to comment) retrieved from Unity Answers : how to comment the lines? (http://answers.unity3d.com/answers/221574/view.html target=”_blank” rel=”noopener noreferrer”) Last accessed 11/9/2017

In code

Ensure you are using syntax specifically for the programming language being used.

/*
The code snippet (1. How to comment) below has been sourced from
http://answers.unity3d.com/answers/221574/view.html
The code snippet appears in its original form
*/
CODE HERE
/ / End code snippet (1. How to comment)

For code that you have changed or adapted

You should describe how you adapted it.

In text

(Output Loop) retrieved from Unity Answers : Writing a Loop (http://answers.unity3d.com/answers/221574/view.html target=”_blank” rel=”noopener noreferrer”) Last accessed 9/9/2017

In code

Ensure you are using syntax specifically for the programming language being used.

/*
The code snippet (2. output loop) below has been adapted from
http://answers.unity3d.com/answers/221574/view.html
I have changed variable types to output strings instead of numbers and adjusted the loop functionality
*/
CODE HERE
/ / End code snippet (2. output loop)
Rubber duck debugging – explain your programming problems to a rubber duck.

Licence

Icon for the Creative Commons Attribution-NonCommercial 4.0 International License

Types of Assignments Copyright © 2023 by The University of Queensland is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License, except where otherwise noted.

Share This Book