You are on page 1of 9

Activity 2.

Syntax is the form of its expressions, statements and programming units.


Semantics is the meaning of these expressions, statements and
programming units.
The difference between them is Syntax is the grammatical form of the
programs while Semantics is the meaning pf the programs. Syntax refers to
the structure of a program written in a programming language. On the other
hand, semantics describes the relationship between the sense of the program
and the computational model. The significance of syntax and semantics are
they they provide a language’s which is the language definitions are the other
language designers, implementers and programmers (the users of the
language). Syntax in computer programming means the rules that control the
structure of the symbols, punctuation, and words of a programming language.
Without syntax, the meaning or semantics of a language is nearly impossible
to understand because semantic is the study of meaning or what they are
intended to be in the syntax.
….
Syntax refers to the rules that define the structure of a language. Syntax in
computer programming means the rules that control the structure of the
symbols, punctuation, and words of a programming language. Without syntax,
the meaning or semantics of a language is nearly impossible to understand
Axiomatic semantics, dealt with in Chapter 11, has become an important
component of software development by means of proofs of correctness for
algorithms
Syntax also enables learners to construct sentences that show recursion which
is important in the construction of grammatically correct sentences
Semantics is important because ‘
Semantics is the study of the meaning of words. Many words have very similar
meanings and it is important to be able to distinguish subtle differences
between them. For example, 'anger' and 'rage' are similar in meaning
(synonyms) but 'rage' implies a stronger human reaction to a situation than
'anger.
Activity 2.2
Write an essay discussing the applications of JavaScript, and explain what
makes it called a dynamic computer programming language?

JavaScript is the widely used programming language, all over the world.
JavaScript originally called LiveScript at Netscape. JavaScript is a lightweight
language that is open-source and allows cross-platform. It doesn’t require
compilation and is interpreted with object-oriented capabilities. Also, it works
with various other programming languages.
There are various applications of JavaScript, and I can tell few of them.
One application of JavaScript that is really important is the Client side
validation, this is to verify any user input before submitting it to the server
and JavaScript plays an important role in validating those inputs at front-end
itself. Another one application is Manipulating HTML Pages which helps in
adding and deleting any HTML tag very easily using JavaScript and modify
your HTML to change its look and feel based on different devices and
requirements. JavaScript helps in manipulating HTML page on the fly. Next is
User Notifications where you can use JavaScript to raise dynamic pop-ups on
the web-pages to give different types of notifications to your website visitors.
The other one is Back-end Data Loading where JavaScript provides Ajax
library which helps in loading back-end data while you are doing some other
processing. This really gives an amazing experience to your website visitors.
JavaScript needed also in and applicable in Modern Uses like Web, Mobile
and Desktop Applications, for Game Development , Scientific Applications,
Internet of Things (IoT) Devices and so on.
JavaScript programming called a dynamic computer programming
language because everything and all variables are dynamic. All dynamic
means in this context is that the script is performed on the client's computer
rather than on the server. However, dynamic most commonly refers to scripts
that control, access, or manipulate HTML elements on the page which
JavaScript have.
Activity 2.3
Write an essay discussing the programming language Ruby and explain what
makes it called “a programmer’s best friend”?

Ruby is an interpreted, high-level, general-purpose programming


language. Ruby is a dynamic, open source programming language with a focus
on simplicity and productivity. It has an elegant syntax that is natural to read
and easy to write. Ruby was developed in Japan. Ruby has similar syntax to
that of many programming languages like C and Java, so it is easy for Java
and C programmers to learn. It supports mostly all the platforms like
Windows, Mac, Linux. Ruby has similar syntax to that of many programming
languages like C and Java, so it is easy for Java and C programmers to learn. It
supports mostly all the platforms like Windows, Mac, Linux.
Ruby called a programmer’s best friend because Ruby was designed to be
more enjoyable to code with than other languages available at the time. Ruby
is very easy and expressive. Ruby is just a more simpler and cleaner language
than others.
Activity 2.4
What are the important characteristics of Python and discuss your
understanding on each.

It supports functional and structured programming methods as well as OOP


 This basically means that Python recognizes the concept of class and
object encapsulation thus allowing programs to be efficient in the long
run.

It can be used as a scripting language or can be compiled to byte-code for


building large applications.
 This means Python also can write scripts and translates source codes or
compiles source code to a set of instructions for a virtual machine.

It provides very high-level dynamic data types and supports dynamic type
checking
 What this basically means is that the type of a variable is decided at the
run time and not in advance. Due to the presence of this feature, we do not
need to specify the type of the variable during coding, thus saving time
and increasing efficiency.

It supports automatic garbage collection.


 Whenever an object is not being used in the code, it gets destroyed
automatically. Garbage collection means traversing the object graph,
marking any objects that are reached, and freeing ones that were never
reached.

It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.
 Python runs code line by line like C,C++ Java. It makes easy to debug the
code. For example, you can write code in C or C++ and compile with your
python code.
Activity 2.5
Discuss how does Java differ from JavaScript?

Java applications are run in a virtual machine or web browser while


JavaScript is run on a web browser.
JAVA is a compiled language and JavaScript is a script language. What this
generally implies is that JAVA is not going to be changing how it's code works
at runtime (although, that's not precisely impossible), and JavaScript is likely
to.
Java is strongly typed language and variable must be declare first to use in
program. In Java the type of a variable is checked at compile-time and
Javascript is weakly typed language.
Java is a Standalone language. Javascript is contained within a web page and
integrates with its HTML content. Java is class-based. JavaScript is dynamic.
Java requires a large amount of memory. JavaScript does not require that
amount of memory.

Activity 2.6
Choose one of the high-level key objectives as a programming
language of Clojure and explain.

It is a functional programming language.


A major goal of this is to minimize side effects, which is accomplished by
isolating them from the rest of the software code. Separating side effects from
the rest of your logic can make a program easier to maintain, test, debug,
extend and refactor. This program is based on mathematical functions. The
concepts of having a functional programming like immutability and pure
function which these concepts are advantages to build side-effect-free
functions, so it is easier to maintain systems with some other benefits.

Activity 2.7
Explain why is Haskell called a “lazy language”?
Haskell is a lazy language. This means that the evaluation of expressions is
delayed until their values are actually needed.
Lazy evaluation is a method to evaluate a Haskell program, it means that
expressions are not evaluated when they are bound to variables, but their
evaluation is deferred until their results are needed by other computations.
For lazy evaluation to work, data required for a computation must be
accessible and meaningful at the time of evaluation. This necessitates that all
computational actions must be devoid of side effects, which is a condition
guaranteed by pure functional programming languages like Haskell. Lazy
evaluation is the most heavily used method of executing Haskell programs.
Activity 2.8
Why is Scala called statically typed language?

Scala called statically typed language because Scala is the type of language
where the type of variables is known at the compile time or perform type
checking at compile time. Scala does not expect you to provide redundant type
information. Scala is a statically typed language, so there are always defined
sets of types, and anything that doesn’t fall inside that set is classified as an
invalid type and an appropriate error is thrown at compile time.
The outcome in Scala is much cleaner and well-organized language which
finally easy to use and productive.

You might also like