CS 315
Homework Assignment 1
Assigned: November 20, 2026
Due: November 29, 2026, 23:55
List data type in Go, Javascript, Julia, Python, and Ruby
In computer science, a list or sequence is an abstract
data type that represents a finite, ordered collection of values.
The same value may occur more than once. Lists were a central feature
of Lisp, an early functional programming language. Many programming
languages provide list types, and some offer dedicated syntax for
creating lists and working with their elements.
In programming tasks, you may end up maintaining a list of objects.
In this homework assignment, assume that you have to maintain a list of strings;
e.g., names of people, cities, etc, in five different programming languages.
The programming languages are Go (Golang), Javascript, Julia, Python, and Ruby.
You will investigate how the following operations can be done in these programming languages:
- Create an empty list.
- Initialize a list with some values.
- Check whether the list is empty.
- Add a new element to the list.
- Check whether a specified value occurs in the list.
- Remove the first occurrence of a specified value from the list.
- For a nonempty list, obtain its head (the first element) and its tail (the remaining elements).
- Print all elements in the list.
You may use online compilers/interpreters.
For each language, prepare a single source file that demonstrates and tests all eight operations in the order listed above.
Write your own examples.
Be careful to avoid plagiarism!
Organize all of your experiments and their results and put them into a report. The report should include Parts A, B, and C, as explained below:
Part A - Operations in each language (45 points)
For each language and each operation, give the sample code segments and the results of their execution.
You should explain what your example does, and the output, if generated.
Part B - Evaluation (10 points)
Evaluate the five languages in terms of the readability and writability of their list operations.
Explain which language you consider best for these operations and why.
Part C - Learning strategy (10 points)
Describe the materials and tools you used and the experiments you performed.
Include the URLs of any online compilers or interpreters you used.
If general discussions about the languages helped you learn the material, describe them.
Complete the assignment independently.
Part D- Sample Codes (35 points)
Each program must run without errors in the environment specified in your report.
Include the JavaScript code in the submitted HTML file so that the program runs in a browser.
Submission:
Submission
Upload a single .zip or .rar archive to Moodle
before the due date. The archive must contain the following:
- Report (65 points). Submit Parts A, B, and C in a
single file named
ID_lastname_name_report.pdf.
- Source files (35 points). Submit the following five
files in a folder named
Codes. Each file is worth 7 points.
- Go -
ID_lastname_name.go
- JavaScript -
ID_lastname_name.html
- Julia -
ID_lastname_name.jl
- Python -
ID_lastname_name.py
- Ruby -
ID_lastname_name.rb
Important Notes:
- Late submissions will be accepted, with 10 points (out of 100) deduction for each extra day.
- You may use the tutorials available on the Internet as a reference
but do not derive your example from the contents of the tutorials.
If you do so, your programs may be similar to others in the class,
which causes a disciplinary investigation.
- Collaboration on the homework is not allowed.