0% found this document useful (0 votes)
3 views6 pages

Unit 1 Principles of Programming Best

Uploaded by

sp0826w
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)
3 views6 pages

Unit 1 Principles of Programming Best

Uploaded by

sp0826w
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
You are on page 1/ 6

Unit 1 Principles of programming Fonttype: Californian FB

1. Command

A command is a directive given to a computer to perform a specific task. It is usually typed in a


command-line interface (CLI) or console.

 Example: dir (in Windows) lists all files and folders.

2. Instruction

An instruction is a single operation executed by a computer processor. It is the smallest unit of


work in a program and is written in machine code or assembly language.

 Example: MOV A, B (move data from B to A in assembly language)

3. Program

A program is a set of instructions written in a programming language to perform a specific task


or solve a problem when executed by a computer.

 Example: A calculator program to add two numbers.

4. Programmer

A programmer is a person who writes, tests, and maintains programs. Also called a developer or
coder.

 Role: Translates real-world problems into code solutions.

5. Programming

Programming is the process of writing, designing, testing, debugging, and maintaining source
code to create software applications.

 Involves: Algorithms, logic building, syntax usage.


6. Programming Language

A programming language is a formal language comprising instructions that computers can


understand and execute.

 Examples: Python, Java, C++, JavaScript.

Types of programming language

1. Low level language


2. High level language

1) Low-Level Language

A low-level language is a type of programming language that provides little or no abstraction


from a computer's hardware. It is closer to machine code and is designed to be executed
directly by the computer hardware.

Low-level languages are faster and more memory-efficient, but harder to learn and use
compared to high-level languages.

✅Types Low-Level Language

1. Machine Language (Machine Code)

 Written in binary (0s and 1s).


 Directly understood by the computer's CPU.
 Fastest to execute, but very difficult to read, write, and debug.
 Machine-specific: a program written for one processor may not work on another.

Example:

10110000 01100001

(This instruction loads a value into a CPU register.)


2. Assembly Language

 Uses mnemonics (short codes like MOV, ADD, SUB) instead of binary.
 Requires an assembler to convert it into machine language.
 Easier than machine language, but still hardware-dependent.
 Mostly used in embedded systems, drivers, and system-level programming.

Example:

MOV A, 5
ADD A, 2

✅Difference between Machine language and Assembly language

Feature Machine Language Assembly Language

Syntax Binary (0s and 1s) Mnemonics (e.g., MOV, ADD)

Human Readability Very low Moderate

Execution Speed Very high High

Portability Not portable Not portable

Translator Required No (CPU executes directly) Yes (Assembler)

2) High-Level Language

A high-level language is a programming language that is closer to human language and


further from machine code. It allows programmers to write instructions in a more readable,
understandable, and portable way.

High-level languages are designed to be easy to learn and use, focusing more on logic and
problem-solving than on hardware details.

 Requires a compiler or interpreter to translate code into machine language.


 Portable across different hardware platforms.
✅Types of High-Level Language

High-level languages can be categorized into several types based on their design and usage:

1. Procedural Language

 Focuses on step-by-step instructions (procedures or functions).


 Emphasizes code reusability and structured programming.
 Commonly used in system-level and general-purpose programming.

Examples: C, Pascal, BASIC, Fortran

2. Object-Oriented Language (OOP)

 Based on the concept of objects and classes.


 Supports encapsulation, inheritance, and polymorphism.
 Ideal for large, complex applications.

Examples: C++, Java, Python, C#, Swift

3. Functional Language

 Emphasizes mathematical functions and avoids changing state or mutable data.


 Useful for concurrent and parallel programming.

Examples: Haskell, Lisp, Erlang, Scala

4. Scripting Language

 Often interpreted (not compiled).


 Used for automating tasks, web development, and glue code between systems.

Examples: Python, JavaScript, Ruby, PHP, Bash

5. Logic-Based Language
 Based on formal logic (rules and facts).
 Commonly used in AI and problem-solving applications.

Examples: Prolog, Datalog

6. Database Query Language

 Used to interact with databases.


 Focused on data retrieval, insertion, and management.

Example: SQL (Structured Query Language)

✅Difference between low level and high level language

Feature High-Level Language Low-Level Language


Readability Easy to read and write Difficult (binary/assembly)
Portability High (platform-independent) Low (hardware-specific)
Speed Slower than low-level Very fast
Translation Needed Compiler/Interpreter Assembler or None (machine)
Ease of Debugging Easier Harder

Software

Software is a collection of programs, data, and instructions that tell a computer how to
perform specific tasks. Unlike hardware (which is the physical part of a computer), software is
the intangible part – you can't touch it, but it runs everything from your operating system to
apps and games.

✅ Types of Software

Software is broadly categorized into two main types, with subcategories under each:

✅1. System Software

System software helps run the computer hardware and provides a platform for application
software.
✅a) Operating System (OS)
 Manages hardware resources and provides user interface.
 Examples: Windows, Linux, macOS, Android
✅b) Device Drivers
 Allow the OS to communicate with hardware devices.
 Examples: Printer driver, graphics card driver
✅c) Utility Programs
 Perform maintenance tasks.
 Examples: Antivirus, Disk Cleanup, Backup software
2. Application Software
Application software is used by users to perform specific tasks or solve real-world problems.
a) General Purpose Software
 Used for common tasks.
 Examples: MS Word (word processing), Excel (spreadsheets), Chrome (web browser)
✅b) Special Purpose Software
 Designed for a specific task.
 Examples: Payroll software, Railway reservation system, School management software
✅c) Web Applications
 Run in web browsers using the internet.
 Examples: Gmail, Google Docs, Facebook

✅d) Mobile Applications

 Designed for smartphones and tablets.

Software Type Description Examples


Runs the computer and supports Windows, Linux, Device
System Software
hardware Drivers
Application MS Word, Photoshop,
Helps users perform specific tasks
Software WhatsApp
 Examples: WhatsApp, Instagram, Google Maps

You might also like