0% found this document useful (0 votes)
4 views4 pages

Overview of Programming Languages

This document provides an overview of various programming languages, including functional, logic, scripting, and object-oriented programming, highlighting their key concepts, advantages, and design considerations. It also discusses the Unified Modeling Language (UML) for designing classes, inheritance, and polymorphism, as well as the principles of graphical user interface (GUI) programming. The document emphasizes the importance of user interaction and event handling in GUI applications.

Uploaded by

geethanjali5447
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

Overview of Programming Languages

This document provides an overview of various programming languages, including functional, logic, scripting, and object-oriented programming, highlighting their key concepts, advantages, and design considerations. It also discusses the Unified Modeling Language (UML) for designing classes, inheritance, and polymorphism, as well as the principles of graphical user interface (GUI) programming. The document emphasizes the importance of user interaction and event handling in GUI applications.

Uploaded by

geethanjali5447
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Principle of Programming Language

Chapter 2: Programming Language


Introduction, Key Concepts and overview of: Functional Programming Languages, Logic Programming
Language, Scripting Languages. Object-Oriented Programming: Design issues for OOP, Using the Unified
Modeling Language to Design Classes, Inheritance, Polymorphism, GUI Programming Languages: GUI
Applications, Graphical User Interfaces, Designing the User Interface and Event Handler for a GUI
Program
Introduction: A programming language is a set of symbols, grammars and rules with the help of which one is able to
translate algorithms to programs that will be executed by the computer.
The primary classifications of programming languages are: Machine Languages. Assembly Languages. High level
Languages.
High level Languages: High level language is a language that supports the human and the application sides of the
programming.
Machine Languages: Machine level language is a language that supports the machine side of the programming or
does not provide human side of the programming. It consists of (binary) zeros and ones .
Assembly Languages: is a low-level language that helps to communicate directly with computer hardware. It uses
mnemonics to represent the operations that a processor has to do.
Key Concepts and overview of Functional Programming Languages:
Functional programming is designed to handle the symbolic computation and application processing list, and it is
based on mathematical work.
Syntax: function n(….(function 2(function,(data))……)
Example: Lisp(List Processing Language)
Advantages of the Functional Programming Language

o Bugs-Free code: Functional Programming language does not support state, so there is no side effect of the
functional programming; hence we can write the error-free code.
o Efficient Programming Language: Functional Programming language has no mutable state, so there is no state
change issue. We can do the program "Functions" to work parallel to "Instruction". This type of code supports
reusability and testability easily.
o Efficiency- Functional Program contains the Independent Units. Independent units run concurrently. Hence
these functional programs are more efficient.
o Supports Nested Functions- Nested functions are supported by functional programming.
o Lazy Evaluation- Lazy Functional Constructions are also supported by functional programming such as Lazy Lists,
Lazy Maps, etc.

Logic Programming Languages: A logic program is a set of sentences in logical form, representing knowledge about
some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve
problems in the domain.
Syntax: condition(1) -> action(1)
condition(2) -> action(2)
……
……
condition(n) -> action(n)
Example: PROLOG
Advantages of the Logic Programming Language
o This is ideal for expressing algorithms as well as complex ideas .
o This programming is reliable and best for problem-solving tasks.
o This programming [ T yis pmade
e t up
h eof simple
p h o ncodes
e that are easy to read as well as debug.
o They are not dependent on the execution of the program to make it more compressed, flexible, or
number]
understandable.
o It develops rapidly as it uses right and wrong statements, not objects.
[Type the fax number]

[Pick the date]


Principle of Programming Language

Scripting Languages: A scripting language is a programming language that executes tasks within a special run-time
environment by an interpreter instead of a compiler.
Syntax: <?php
//php code
?>
Advantages of the Scripting Programming Language

o Easy to learn and use


o Open source and free
o Portable and cross-platform
o Lighter memory requirement
o Easy to debug
o Browser support

Object-Oriented Programming: Object-oriented programming (OOP) is a style of programming characterized by


the identification of classes of objects closely linked with the methods (functions) with which they are associated
Example:C++,Java.

Design issues for OOP:


• The exclusivity of objects.
• Are subclasses subtypes?
• Type checking and polymorphism.
• Single and multiple inheritance.
• Object allocation and deallocation.
• Dynamic and static binding.
• Nested classes.
• Initialization of objects.
Scripting Language Programming Language
The scripting languages are interpreter-based The programming languages are compiler-based
languages . languages
The scripting languages help in combining the The programming languages help in developing
existing components of an application. anything from scratch.
Scripting languages convert high-level instructions Programming languages help in converting the full
into machine language. program into the machine language (at once)
You don’t need to compile these languages. These languages first need a compilation
These make the coding process simple and fast. These provide full usage of the languages.
Scripting languages don’t create any file types. Programming languages create .exe files

Object Oriented Programming Functional Programming


This programming paradigm is based on the This programming paradigm emphasizes the use
object-oriented concept. Classes are used where of functions where each function performs a
instances of objects are created specific task

Fundamental elements used are objects and Fundamental elements used are variables and
methods functions
Importance is given to data rather than Importance is not given to data but to functions
procedures
It follows imperative programming model It follows a declarative programming model
It uses loops for iteration It uses recursion for iteration
Has three access specifiers namely, Public, Does not have any access specifier
Private and Protected
Principle of Programming Language

Using the Unified Modeling Language to Design Classes, Inheritance and Polymorphism.

UML: Unified Modeling Language, is a standard notation for the modeling of real-world objects as a first step in developing an
object oriented program. It describes one consistent language for specifying, visualizing, constructing and documenting the
artifacts of software systems.

UML to Design Classes

Class: In object-oriented programming (OOP), a class is a blueprint or template for creating objects.
Objects: Objects are instances of classes.

Classes Design in UML: Unified Modeling Language (UML) is a type of static structure diagram that describes the
structure of a system by showing the system's: classes, their attributes, operations (or methods), and the
relationships among objects.

UML to Design Inheritance

Inheritance: inheritance is a mechanism that allows a class to inherit properties and behaviors from another class.

Inheritance Design in UML: To model inheritance on a class diagram, a solid line is drawn from the child class (the class
inheriting the behavior) with a closed, unfilled arrowhead (or triangle) pointing to the super class.

UML to Design Polymorphism


Polymorphism: Polymorphism means “Many forms” The process of representing one forms in multiple forms is
known as polymorphism.

GUI Programming Languages:


Principle of Programming Language

GUI: A graphical user interface (GUI) is is a digital interface in which user interacts with graphical component such as
icons, buttons and menu.
Example: Dabo GUI, Python, Java,
GUI Applications:
Graphical user interfaces (GUIs) are used in many applications
Mobile apps: Kivy is an open-source Python framework for developing cross-platform GUI apps for
mobile devices.
Desktop apps: PySide is a cross-platform toolkit for building GUI applications for desktop, web, and
mobile.
Windows apps: Microsoft Windows Forms (WinForms) is a library for developing rich GUI
applications for Windows.
Image editing: GIMP is a free, open-source raster graphics editor that uses a GUI.
Automotive systems: Newer automobiles use GUIs for navigation systems and multimedia centers.
ATM machines: Automated teller machines (ATMs) use application-specific GUIs.

Graphical User Interfaces


A graphical user interface (GUI) is a visual interface that allows users to interact with a device using graphical
elements and visual indicators:
Purpose
GUIs are used to control and display information on a computer system without the need to understand
technical details.
Elements
GUIs use visual elements like buttons, icons, menus, and windows to show users how to execute commands.
Interaction
Users can interact with GUIs using a pointer, keyboard, or touch screen.
Design
The design of a GUI depends on the input being used. For example, desktop computers use a pointer and
keyboard shortcuts, while tablets and mobile devices use touch.
Examples of informational components
Message boxes, notifications, pop-up windows, progress bars, and tool tips are all examples of informational
components in a GUI.
Designing the User Interface and Event Handler for a GUI Program

To design a user interface (UI) and event handler for a GUI program, you can:
Create widgets: Create instances of the widgets you want to use in the interface.
Define the layout: Decide the location and size of each widget.
Create functions: Create functions that will perform the desired actions on user-generated events.
Use event handlers: Event handlers are constructs that respond to external stimuli with a defined
action. In a GUI environment, events usually signify that the user has made a demand on the system.
Use a layout manager: A layout manager determines how user interface components are arranged
on the display area.
Use event classes: JavaFX provides a wide range of event classes for different types of interactions,
such as ActionEvent, MouseEvent, and KeyEvent.
Register event handlers: Register event handlers on nodes using methods like setOnAction(),
setOnMouseClicked(), and setOnKeyPressed().
Use a WindowListener: Include a WindowListener to handle the close-window button.
Respond to special keys: Use the keyPressed() handler to respond to special keys, such as the arrow
or function keys

You might also like