Uploaded by ENGMIK

Programming Assignment Unit 1 - PA 1

advertisement
Programming Assignment 1 – Unit 1
Programming Assignment 1 – Unit 1
University of the People
MSIT 5216-01
AY2023 – T3
Instructor: Dr. Nam Tran Nguyen
February 01, 2023
1
Programming Assignment 1 – Unit 1
Introduction
This first programming assignment will be divided into two parts. First will present
a very typical basic code that most developers execute while learning a new
programming language. The second part will provide answers to some questions related
to the author's experience dealing with programming languages.
Part 1
After downloading and installing the Racket language (Racket, n.d). The print
screen below presents the hello_world program and its output.
Part 2
This second part will provide answers to several different topics related to Racket
and other programming languages that the author of this written assignment previously
used to develop coding.
Have you ever written code similar to what you see in Racket?
Based on Thanoshan, MV. (2019) article, Racket can be categorized as a functional
programming language that is located inside the declarative programming paradigm, the
same as JavaScript which the author of this study already had some contact with while
acting for a short period as a web developer. Although JavaScript is considered a
functional language its syntax looks very different from Racket, so the answer to the
2
Programming Assignment 1 – Unit 1
main question is no, the author never wrote code similar to Racket programming
language.
If not, then how does it differ from other programming experiences you may have
had?
Considering this was the first time the author of this written assignment had contact
with Racket it became clear that, the installation process seems to be quicker and easier
than other languages such as Java which creates a virtual machine environment to run
the programs. Another noticeable thing is the excessive use of round brackets ( ) that
encapsulate different types of commands, meaning that the code might not look so clean
at first glance, but with time it is something easy to get used to.
By hovering the mouse over the print command while using DrRacket Integrated
Development Environment (IDE) a pop-up message appears saying “imported from
racket”, which looks very useful for a developer while writing a huge and complex code
with a lot of references. In Python, for example, their basic IDE does not provide this
type of message.
By hovering the mouse over the racket word another pop-up message appears
saying that “3 bound occurrences”, another handy message for the developer. These
pop-up messages cannot be found in languages such as C, at least while developing
inside simple text editors such as VI or VIM.
3
Programming Assignment 1 – Unit 1
How is the Racket environment different from Python or other programming
languages?
As mentioned above one noticeable difference is the use of round brackets where
the print needs to be inside. Another difference compared to Python is the use of double
quotes and single quotes which do not produce the same result since Racket presents an
error message string:1:20: read-syntax: unexpected `)` when single quotes are used, see
the print screen below.
In Python, the print works both with double quotes and single quotes as shown below.
A simple math equation like 6 + 4 in Racket is different than in Python. In Racket
is like this:
While Python is more intuitive:
4
Programming Assignment 1 – Unit 1
On the other hand, Racket seems to be much simpler than C language, which
requires much more code to produce the output of this equation, see print screen below.
Could Racket be used as a solution to the needs of an organization? Why or
why not?
After the first contact with Racket, it is safe to say that similarly to any other
programming language it has particular pros and cons, listing them:
Pros – According to Racket’s official website it is a multi-purpose programming
language which can be used to develop web applications, mathematics and scientific
simulations, 3D graphs, macros and scripting. It has a Graphical User Interface (GUI)
for multiple operating systems such as Windows, macOS and Linux and it is compatible
with several IDEs like Visual Studio, Emacs, Vim and its own IDE called DrRacket. By
quickly analyzing all these characteristics the first impression is that Racket can be used
in numerous types of organizations to support their projects, but before making any
conclusion, let us look at some disadvantages.
Cons – According to Tiobe's (2023) index which indicates the popularity of
programming languages, Racket is positioned between #51 and #100, meaning it is not
so popular, see Figure 1. As a result of its low popularity, it might be harder to find
support in online forums, find specific libraries available or have a long wait before the
release of a new Racket version.
5
Programming Assignment 1 – Unit 1
Figure 1. Popular programming languages ranking from position #51 to #100.
Sourced from (Tiobe, 2023).
Exploring in more detail the release of new versions, v8.6 was released on
August/10/2022 (Racket blog_1, 2022) while v8.7 was on November/14/2022 (Racket
blog_2, 2022), which means more than three months later. So, language bugs can take a
long time to be fixed. You as a reader might think this topic can be a little controversial,
and the author of this study agrees with you since other popular programming languages
can take more than three months to release their new version, but the reason for that
might be because they are already robust enough to take longer.
Another reason is the lack of Racket software developers. Figure 2 presents a
search on Indeed for Racket developers returning only four jobs compared to 45,067
jobs for Python developers shown in Figure 3. The search parameters like country, state,
experience and others are hidden since they are not so relevant to this written
assignment, but rest assured that if the reader searches on Indeed they will find a similar
result. In short, if the company decides to implement a solution using Racket it will
have a very hard time finding a software developer with this programming language
knowledge.
Figure 2. Indeed search for racket developer jobs.
6
Programming Assignment 1 – Unit 1
Sourced from (Indeed_1, n.d).
Figure 3. Indeed search for python developer jobs.
Sourced from (Indeed_2, n.d).
After analyzing the pros and cons of this programming language, the author of this
study is more inclined to say that Racket is not recommended as a feasible solution for
most organizations’ projects. The lack of software developers, not extensive online
support and version releases may become a problem while developing a project for an
organization.
Conclusion
This first programming assignment had the intention to show the first contact with a
functional programming language called Racket which differs in many points from
Python and other common programming languages such as Java and C. It might be too
soon to conclude if Racket is or is not recommended to develop a software solution for
an organization, but based on first superficial research the author concluded that Racket
may not be the best choice, at least for now.
7
Programming Assignment 1 – Unit 1
References
Indeed_1 (n.d). Racket developer. Retrieved on January 28, 2023, from
https://www.indeed.com/jobs?q=racket+developer&l=&vjk=e1ca72e18a29b280
Indeed_2 (n.d). Racket developer. Retrieved on January 28, 2023, from
https://www.indeed.com/jobs?q=python+developer&l=&vjk=95187f244cde3d10
Racket (n.d). https://racket-lang.org/
Racket blog_1 (2022, August 10). Racket v8.6. https://blog.racketlang.org/2022/08/racket-v8-6.html
Racket blog_2 (2022, November 14). Racket v8.7. https://blog.racketlang.org/2022/11/racket-v8-7.html
Tiobe (2023, January). TIOBE Index for January 2023. Retrieved on January 30, 2023,
from https://www.tiobe.com/tiobe-index
Thanoshan, MV. (2019, November 12). What exactly is a programming paradigm?
freeCodeCamp. https://www.freecodecamp.org/news/what-exactly-is-aprogramming-paradigm
8
Download