Week 1 - Topic 1: Introduction to the unit and
Ruby
What is in this lesson?
Unit Overview
Assessment and Submission
Getting Started
Tasks for Week 1
What to do in the �rst week?
Aims of the unit
This unit of study aims to introduce students to structured programming and design.
Source: wikipedia
That means to teach you how to design and write code professionally in a structured/functional
framework.
Directly Relevant languages (eg: C, Go, Lisp etc):
But indirectly also all Object Oriented languages, as the design principles largely carry across from
Structured programming to Object Oriented programming (OO).
More on these two approaches later.
Unit Assessment
Each week there are tasks you do both in tutorials and outside tutorials.
These tasks often build up your skills so you can put together more complex code with good design
and coding practices.
Assessment overviews are on Canvas:
COS10009-COS60006 Portfolio Process and Assessment Criteria(1).pdf
MarkingRubricSummary(4)-1.pdf
Task speci�cations are obtained and submitted through Ed - see the Portfolio module.
Lets have a quick look at these ….
Peer mentoring program
Ruby - the main Programming Language used for the unit
Ruby is an interpreted, object oriented language which we will be using in a mostly structured way.
A fairly popular language due to Ruby On Rails (which both Doubt�re and Canvas are written in).
It is a dynamically typed language (as opposed to statically typed) – we learn more about what that
means later.
Popular Sites that use Ruby
Kickstarter
AirBnB
GitHub
Shopify
Hulu
Canvas
Where does Ruby �t?
Source: https://www.fullstackacademy.com/blog/nine-best-programming-languages-to-learn
Popularity of Ruby
Source: https://insights.stackover�ow.com/survey/2019:
Ruby behind the Scenes
According to Cascade Business News (Nov, 18, 2019):
'The healthcare industry is using Ruby to build advanced electronic health records (EHRs). This type of
software is the backbone of the modern healthcare industry. Every single patient’s appointment,
diagnosis, prescription, and test is recorded in this system. This information is stored on outside servers
and can be shared with other healthcare providers at the patient’s discretion.
This type of electronic system removed a huge burden from patients, who previously had to carry around
a single copy of their medical records to every new doctor.'
also:
'Medical technology companies and Ruby development services are using the language to build cutting-
edge software as a medical device (SaMD).
SaMDs are any type of software that is used for medical reasons but is not part of a medical device itself.
This includes mobile applications, image processing software, and tools that download diagnostic
information onto computers'.
Why Ruby?
Leaving aside the popularity of Ruby, we are primarily concerned with using a language that is going
to help you learn, keep you motivated and get you productive quickly whilst allowing for a wide
range of di�erent projects.
We are not speci�cally learning Object Oriented programming at this stage, so a language that
supports structured programming is desirable.
Ruby is Object Oriented but we will be using it in a mostly structured/procedural way.
Ruby runs from the DOS window or the Terminal (Mac, OSX, Linux).
About Ruby (and Rails - which is built on Ruby)
An error occurred.
Try watching this video on www.youtube.com, or enable JavaScript if it is disabled in your
browser.
This talks through motivations for writing Rails and using Ruby.
Watch this for about 5 to 10 minutes if you have time. One slide is below:
Using the DOS and Terminal Windows
Windows: Go to Start->run type ‘cmd’, this will open the DOS window.
Basic DOS commands are:
cd: change directory
pwd: path to current directory
dir: list �les in directory
See the following youtube (also on Canvas):
An error occurred.
Try watching this video on www.youtube.com, or enable JavaScript if it is
disabled in your browser.
If you are using Mac OS or Linux, see the following video:
An error occurred.
Try watching this video on www.youtube.com, or enable JavaScript if it is
disabled in your browser.
Also see: Basic Unix Commands
Using the terminal
Try out the terminal commands below in the terminal window on the bottom right:
type 'pwd' and press enter
type 'ls - l' and press enter
type 'touch my�le' and press enter
type 'ls - l' and press enter again
What do you see?
Getting Started - installing Ruby
Windows
For Windows use the Ruby-installer here.
Select all the options in the installer when it runs.
Mac-OS
For Mac-OS build the code from source:
Install x-code (developer tools) - this is free from the Apple App Store -
Run the following command from the terminal window: 'xcode-select --install' (if you get an
xcrun error - use the following command: 'sudo xcode-select -switch /')
Install homebrew (if you do not have it already)
Run homebrew install for ruby in the Terminal: brew install ruby
Install Homebrew as suggested at the top of the guide, then after installing rvm (follow the rvm install
instructions) type the following:
brew install sdl2
Test Ruby
These instructions and links are also on Canvas – see the Software section.
Test your install: In Windows open a DOS prompt (windows->run "cmd") in Mac-OS run a terminal
window.
type: ruby -v
This should tell you what version of Ruby you are running.
Install GOSU
In the Terminal (or DOS command window) type:
gem install gosu
Find the Ruby folder and then the sub-folder with the examples in it, run some of the examples from
the terminal or prompt. You may want to create a folder in your documents called Ruby-code and put
it in there.
A Gosu tutorial is available here: https://onecore.net/gosu-ruby-2d-game-development.htm.
The API is here: http://www.rubydoc.info/github/gosu/gosu/
Getting Started: Trying Ruby online
https://www.tutorialspoint.com/execute_ruby_online.php
Use the API (Application Programmer Interface) documentation:
https://ruby-doc.org/
Or try Ruby below:
type puts("Hello Everyone!") then click Run.
Run RUBY
1 puts("Hello everyone!")
Unit Assessment
This unit uses a Portfolio assessment strategy. This means:
You can attempt a task and get feedback before submitting again
There are no tests
All the tasks can be submitted in the last two weeks
You need to complete all the tasks up to, and including, the grade level you are aiming for.