Integrative Programming and Technologies 1
Integrative Programming and Technologies 1
PROGRAMMING AND
TECHNOLOGIES 1
PC223
INTEGRATIVE PROGRAMMING CAN REFER TO
TWO DIFFERENT THINGS:
1. Integrating software components:
Compiled languages
1. Compilation: Compiled languages are translated into machine code before they can
be run. This translation is done by a program called a compiler. The compiler reads the
source code of the program and translates it into machine code that is specific to the
target machine.
2. Advantages: Compiled programs tend to be faster and more efficient than
interpreted programs because they do not need to be translated every time they are
run. They also have more direct access to the hardware, which can give them better
performance.
3. Disadvantages: Compiled programs are not as portable as interpreted programs.
This means that they cannot be run on just any machine without being recompiled.
Additionally, the compilation process can be time-consuming.
4. Examples: C, C++, Java, Fortran
TWO DIFFERENT APPROACHES TO
PROGRAMMING LANGUAGES
They differ in how they are translated into machine code, which is the language that
computers understand.
Interpreted languages
1. Interpretation: Interpreted languages are translated into machine code on the fly,
line by line, as the program is being run. This translation is done by a program called
an interpreter.
2. Advantages: Interpreted languages are more portable than compiled languages
because they do not need to be compiled for a specific machine. They are also easier
to learn and use because they do not require a separate compilation step.
3. Disadvantages: Interpreted programs tend to be slower and less efficient than
compiled programs because they need to be translated every time they are run. They
also have less direct access to the hardware, which can limit their performance.
4. Examples: Python, Ruby, JavaScript, PHP
APPLICATION VERSUS SCRIPTING
LANGUAGES
Application Languages:
Web Development:
General-Purpose Scripting:
Emerging Languages:
• Interactive Elements:
From clickable buttons and menus to animated graphics and real-time
updates, JavaScript adds responsiveness and user engagement to
websites.
• Data Manipulation:
It can collect and process user input, handle complex calculations, and
store and retrieve data locally or on servers.
• Game Development:
JavaScript is also used to create engaging web-based games, often in
combination with HTML5 canvas and WebGL.
• Mobile Apps:
Frameworks like React Native allow developers to build mobile apps using
JavaScript, saving time and resources.
WHAT IT DOES:
• Ubiquitous:
With nearly 99% of websites using JavaScript, it's essential for anyone
involved in web development to understand it.
• Versatile:
Its diverse applications go beyond websites, making it a valuable skill for
various digital projects.
• Accessible:
Compared to other languages, JavaScript has a relatively gentle learning
curve, making it a good starting point for programming beginners.
EXAMPLE
Page that has a button. Once the button is clicked it shows the date and time
<!DOCTYPE html>
<html>
<body>
<button type="button"
onclick="document.getElementById('demo').innerHTML = Date()">
Click me to display Date and Time.</button>
</body>
</html>
EXAMPLE
Description of the JavaScript code
• getElementById()
a method used to retrieve an HTML element from the document by its
unique ID. It is part of the Document Object Model (DOM) API, which
provides a structured representation of the HTML document and allows
JavaScript to interact with the elements on the page.
• innerHTML
property is used to get or set the HTML content (including any nested
HTML elements) of an element.
• Date()
is an object is used to work with dates and times. It provides methods for
creating, getting, and setting dates, as well as for performing various
operations related to dates and times.
EXAMPLE
Description of the JavaScript code
• onclick="document.getElementById('demo').innerHTML = Date()”
This part of the code executes JavaScript when the button is clicked.
• onclick
is an attribute tells the browser to run the specified JavaScript code
when the click event occurs.
EXAMPLE
Description of the JavaScript code
JavaScript Logic:
• document.getElementById('demo').innerHTML = Date()
o document.getElementById('demo’)
finds an element with the ID "demo" within the HTML document.
o .innerHTML = ...
modifies the inner content (text) of that element.
o Date()
is a built-in JavaScript function that returns the current date and time.
EXAMPLE
Description of the JavaScript code
Text Element: