Programming is the process of creating a set of instructions that a computer can follow to perform specific tasks or solve problems.
It involves writing code in a language the computer can understand and execute. In simple terms, programming is how humans communicate with computers to make them perform desired actions.
Computer programming is the process of writing instructions that a computer can understand and execute.
These instructions are written in a programming language and tell the computer what to do, step by step, to complete a task or solve a problem.
Real life example:
Imagine you are making ugali. You need to follow a series of steps in a specific order to make it successful.
The instructions for making ugali would be like programming:
Step 1: Boil water in a pot.
Step 2: Gradually add maize flour (cornmeal) while stirring.
Step 3: Continue stirring until the mixture thickens.
Step 4: Cook until the mixture is firm and no longer sticky.
These steps must be followed precisely, just like writing code in a program. If you skip a step or get the order wrong, you might end up with a different result (such as, watery ugali or burnt flour). Similarly, in programming, if you do not follow the correct syntax or sequence of instructions, the program will not run as expected, and you will get errors or incorrect results.
Reasons for learning programming
From smartphones and smart home devices to websites and business systems, programming is the foundation of most modern technologies. Learning to program helps you understand and shape the digital world around you.
Creativity and problem-solving: Coding allows you to create apps, games, and software solutions.
High-demand careers: Programming skills are in high demands across almost every industry or organization, open job opportunities in many industries, including technology, healthcare, education, entertainment, finance and many others.
Tasks automation: Programming can help in automating repetitive tasks to improve efficiency and accuracy. For example, programming can save time of manual effort in various activities such as data processing, file management, and many others.
Cross-industry Skills: A person that learn how to program, can work in a variety of fields, including web development, mobile app development, artificial intelligence, machine learning, game development, data science, and more.
Importance of programming
Development of Daily Technology: Programming helps in developing technologies used every day. Example: Mobile money systems like M-Pesa, Tigo Pesa, and Airtel Money in Tanzania rely on programming to allow people to send and receive money easily.
Solving Real-Life Problems: Programming is useful for solving real-life challenges in society. Example: Systems used by TANESCO for billing and tracking electricity usage are built using programming to reduce errors and improve service delivery.
Opportunities: Learning programming opens doors to good careers and self-employment. Example: Many Tanzanian youths work as software developers, website designers, orappdevelopers, creating apps for local businesses and schools.
Understanding How Computers Work: Programming helps people understand how computers and technology operate. Example: Students in Tanzanian colleges like DIT and UDSM learn programming to understand how systems such as student registration portals function.
Increasing Efficiency in Industries: Programming makes work faster and easier in different industries. Example: Banks in Tanzania, such as NMB and CRDB, use programmed systems for ATM services and online banking.
Reducing Errors and Improving Accuracy: Programming reduces human errors by automating tasks. Example: NECTA examination results processing uses computer programs to ensure accurate marking and results management.
Supporting Development in Advanced Fields: Programming supports progress in areas like artificial intelligence, healthcare, and data analysis. Example: Hospitals in Tanzania use electronic health record systems to store and analyze patient information.
Enabling Global Communication: Programming makes global communication possible through the
Internet and social media. Example: Tanzanians use WhatsApp, Facebook, and Zoom to communicate locally and internationally for business and education.
Creating and Customizing Software: Programming allows people to create and adjust software for specific needs. Example: Local developers create school management systems for Tanzanian primary and secondary schools.
Supporting Science and Education: Programming is important in scientific research and education. Example: Tanzanian universities use online learning platforms and research software developed through programming.
Role of programming languages
Programming languages are essential tools in software development, enabling developers to create, modify, and maintain software applications.
The roles of programming languages in software development include:
Allowing developers to write step-by-step commands that instruct computers to perform specific tasks efficiently.
Enabling the creation of various types of software, including web applications, mobile apps, desktop programs, operating systems, and enterprise solutions.
Automating repetitive processes increases productivity and efficiency in healthcare, finance, and manufacturing industries.
Aiding in software security by preventing vulnerabilities, mitigating cyber threats, and ensuring system stability and data privacy.
Enabling developers to write high-performance code that optimises software efficiency, reduces processing time, and improves responsiveness.
Understanding Computers and Programming: From Hardware to Code
A computer functions because of a combination of hardware and software. Hardware carries out the tasks, while software provides instructions to follow. Together, they allow the computer to perform different functions and respond to user commands.
Hardware (the physical part)
Hardware is the part of a computer you can see and touch. The main parts of the hardware are:
CPU (Central Processing Unit) – This is the computer’s brain that follows instructions in programs.
RAM (Main Memory) – This stores data that the computer uses currently. It is fast but temporary.
Storage (Hard Drive or SSD) – This saves data for later use, such as photos or schoolwork.
Input devices – This helps you give commands to the computer, like a keyboard or mouse.
Output devices – This shows results, like a monitor or printer.
Software (the invisible part)
Software is a collection of instructions or programs that direct a computer's hardware to perform specific tasks. It includes the programs and apps that run on the computer. There are two main types:
System software – Helps the computer run, like Windows or macOS.
Application software – Lets you do tasks like typing, drawing, or browsing the Internet.
There are also tools like virus scanners and backup programs that help keep the computer safe and fast.
How computers store data
Computers use binary, which is just 0s and 1s, to store everything—words, pictures, music, and more.
A “bit” is a single 0 or 1.
A “byte” is 8 bits, and can store one small piece of information, like a letter.
For example:
The letter “A” is stored as 01000001
The number “157” is stored as 10011101
Bigger numbers need more bytes. Computers can combine bytes to store large values like 65,535 or even more.
Storing text, numbers, and media
Texts use systems like ASCII and Unicode to convert letters into binary.
Images are made of tiny dots called pixels, each stored as numbers (iii) Sound is saved in small pieces (samples), also stored as numbers.
How a program works
When you run a program, it consists of many small instructions that the computer must follow. These instructions are executed by the CPU (Central Processing Unit), which is often referred to as the 'brain' of the computer.
How the CPU follows instructions The CPU does simple things like:
Reading from memory
Doing calculation
Moving data
Comparing numbers
By doing many small steps very fast, it can complete large tasks.
How programs are written
Computers only understand machine language, which is a long list of 0s and 1s.
Writing in machine language is hard, so we use assembly language, which uses easy words like:
ADD (add numbers)
MOV (move data)
A program called an assembler changes assembly language into machine language so the CPU can understand it.
Where programs are stored
Programs are saved on hard drives. When you open them, they are copied to RAM. The CPU then fetches and executes instructions directly from RAM during processing.
Generally, programming is done by following a few simple steps. The basic process of programming includes:
Writing a list of instructions (this is called a program).
Saving the program on the computer.
Running the program, which loads it into the computer's memory (RAM).
The CPU reads and follows the instructions to perform the task.
Important terms in programming
Understanding the basic terms used in programming is essential for anyone learning to code. These terms form the foundation of how programs are written, understood, and executed. Some of the most important programming terms include:
Compiler
A compiler is a special software program that translates code written in a high-level programming language (such as C, Java, or C++) into machine language (binary code) that a computer's CPU can understand and execute.
It processes the entire source code at once, converting it into object code or an executable file. This allows the program to run directly on the computer hardware without needing the source code during execution.
Compared to interpreters, compilers typically require less time during execution, as the code is already fully compiled.
The compilation process generally involves several stages, including compiling, linking with system libraries, and executing the program. Common examples of compilers include Dev-C++, Borland C++, and Visual C++.
To make a computer execute your program, you need a compiler.
The importance of using a compiler includes:
Translating source code into machine language – Computers cannot understand English-like C code, so the compiler converts it into binary (machine code).
Checking for errors – The compiler detects and reports mistakes in your code, helping you correct them before running the program.
Creating an executable file – After compilation, the compiler generates a file that the computer can run directly.
below is the table of Example of compilers for different programming languages
Programming Language
Compilers
To Download Full Notes Click Here

No comments:
Post a Comment