Programming Languages(1)(2)(2)
Programming Languages(1)(2)(2)
Programming language
• a medium through which programmer may give instructions to a computer
A programming language
• must support certain control constructs and data types needed to implement algorithms
High-level programming languages that are more user-friendly are hence invented.
C
Most programs used in modern computers
• interpretation
• compilation
Interpretation approach
- immediately translates and executes the statement before processing the next one
Compilation approach
• uses a program called compiler
• reads and translates the entire high-level language program
(source) code into its equivalent machine-language instructions in an
executable file
• the resulting machine-language instructions can then be
executed directly on the computer when the program is launched
• examples: C and C++
• example: Java
Interpreter
Compiler
• very portable across different
computing platforms • program runs very fast AFTER
compilation
• produces results almost
immediately • smaller in code size after compilation
• easy to debug • must compile the entire program
before execution
• program executes more slowly
• needs to be re-compiled if to be used
• useful for implementing dynamic, on different computing platforms
interactive features, such as
those used on web pages • used in large and sophisticated
software applications when speed is
of the utmost importance
C
C language THE
• originally developed to help implement the Unix operating system
• allow for direct access of, and manipulation of, the underlying computer’s
hardware PROGRAMMING
LANGUAGE
It is a compiled language
• the program code (i.e. source code) needs to be Examples of applications
compiled first, before it can be executed
• embedded systems development
Most suitable for applications • operating systems
• direct access to the computer’s hardware implementations
• fast real-time response • device drivers that control the
hardware inside the computer
C++ language
• an extension to the C language
• with additional support for Object-Oriented Programming (OOP)
In OOP
Examples of
• programs are designed based on objects that contain attributes
Applications
and behaviors
• programming is then focused on how the objects interact with • Video games
one another • Graphic User
- without the need to know the internal code detail of the object Interface (GUI)
based applications
C++ is a compiled language
• Latest operating
• used for applications that need high performance and are based systems design and
on object oriented software design principles implementation
Python language
• a relatively easy-to-learn programming language
• targeted for general purpose programming for applications that do
not need direct access to the computer’s hardware Examples of
Applications
It is an interpreted language
• Data science
• program code is hence portable across different computing platforms
• Web developments
Python interpreter converts and executes the Python program
statement one-by-one to the corresponding machine instructions
• provides instant feedback to the user at runtime
• very helpful for learning to program
Java language
• highly portable, general purpose language with Object-Oriented (OO)
methodological support
} PROGRAMMING }
LANGUAGE
Webpage: a text document transferred over the internet and be displayed in a web browser,
such as Chrome, Safari, Firefox, and Internet Explorer (IE)
A web browser reads the webpage and composes it into visible or audible page(s).
The content of a webpage is commonly described by using the language HTML (Hypertext Markup
Language)
A webpage can be made to appear dynamic and interactive by adding scripts in language, such as
JavaScript.
MATLAB • commonly used for developing science and engineering computation applications
language • an interpreted language used primarily for numerical computing
• supports many functions and libraries, such as matrix manipulation, plotting, and
visualization of data
Examples of types of computation:
• audio, video, and image related signal processing
• control systems
Programming Classifications
Language Compiled language: Interpreted language:
C, C++ Python, JavaScript, R
Two ways of
translations Combination of both: Each language
Java provides different
Interpreter Compiler features that are
suitable for
translates and executes first translates the entire program’s statements into the different
each program’s statements corresponding machine instructions, before the requirements
one-by-one during run time computer is used to execute the machine instructions