Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Visual Basic Lesson 1 - Introduction to computer programming

Course: Visual Basic 6.0 programming


Course Description:
This course is designed to give students a comprehensive understanding of Visual Basic 6.0, a
legacy programming language and development. Students will learn the fundamentals of Visual
Basic 6.0 programming. Through hands-on projects and exercises, students will gain proficiency
in creating Windows applications using Visual Basic 6.0. The course will highlight specific
examples of successful applications of Visual Basic 6.0 in different industries, inspiring students'
projects.
Course objectives:
• To help students gain a foundational understanding of programming concepts and
principles, focusing on applying them to Visual Basic 6.0.
• To enable students to learn how to create Windows applications using Visual Basic 6.0,
including Graphical User Interface (GUI) design and event-driven programming.
• To enable students to acquire the skills to design user-friendly and visually appealing
interfaces in Visual Basic 6.0 for various applications.
• To enable students to develop the ability to effectively work with data, including data
input, manipulation, storage and retrieval, using Visual Basic 6.0.
• To help students gain hands-on experience building applications relevant to real-world
scenarios and industries.
Course learning outcomes:
• Demonstrate proficiency in Visual Basic 6.0 and apply fundamental programming
concepts and principles.
• Develop Windows applications from scratch using Visual Basic 6.0, including designing
user interfaces and implementing event-driven functionality.
• Design and create user interfaces that are intuitive, visually appealing and optimised for a
positive user experience.
• Effectively work with data within Visual Basic 6.0 applications, including input
validation, storage, retrieval and presentation.
• Build practical desktop applications, such as calculators, student management systems,
inventory management systems, human resources management systems, transport

1 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

management systems, and game applications, demonstrating the ability to apply


programming skills to real-world scenarios.
• Utilize Visual Basic 6.0 skills in various industries and domains, especially in scenarios
where legacy applications still play a critical role.
Note:
• By achieving these objectives and learning outcomes, students will acquire proficiency in
Visual Basic 6.0 and be well-prepared to develop practical applications that can be used
in their professional careers across various industries.
• Visual Basic 6.0 is a classic programming language still widely used today, especially in
the development of legacy applications.
Lesson 1.0: Introduction to computer programming
Lesson Overview
This lesson provides a comprehensive introduction to the world of computer programming. It
covers fundamental concepts, terminology, and tools used in programming. Students will explore
the importance of programming in various fields and gain an understanding of different
programming languages and their applications.
Lesson objectives:
• Introduce students to the fundamental concepts and principles of computer programming.
• Highlight the significance of computer programming in modern society, technology, and
various industries, emphasising its role in problem-solving and innovation.
• Showcase the diverse applications of computer programming across fields such as
software development, data analysis, scientific research, and automation.
• Familiarize students with the responsibilities and skill sets of programmers, including
designing, coding, and testing software.
• Explain the role of translators, including compilers, interpreters, and assemblers, in
converting human-readable code into machine-executable instructions.
• Introduce students to linker and loader functions in the compilation and execution process
of computer programs.
• Provide an overview of different programming languages, their characteristics, and their
suitability for specific tasks.

2 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

Lesson learning outcomes:


By the end of this lesson, the student will be able to:
• Understand the concept of computer programming and how it helps automate tasks and
solve problems.
• Recognize the importance of computer programming in different fields, such as software
development and scientific research, and its contribution to technological advancements.
• Identify the real-world applications of computer programming and how it is used in
different domains.
• Describe the responsibilities and skills required of programmers in different computing-
related tasks.
• Differentiate between compilers, interpreters, and assemblers and understand their roles
in converting code to executable programs.
• Explain the functions of linkers and loaders in the compilation and execution process of
programs.
• Compare and contrast different programming languages and determine which is best
suited for specific programming tasks.
Note: By achieving these objectives and learning outcomes, students will have a solid foundation
in computer programming concepts and practices, preparing them for further studies or practical
application of programming skills in various professional fields.

3 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

Lesson Outline
1.0 Introduction to Computer Programming
1.1 What is computer programming?
1.2 Why is computer programming necessary?
1.3 Application of Computer Programming
1.4 Programmers
1.5 Source code
1.6 Object code
1.7 Machine language
1.8 Translators
1.8.1 Compilers
1.8.2 Interpreters
1.8.3 Assemblers
1.9 Bugs and Debugging
1.10 Linker and Loaders
1.11 Computer programming languages
References
• Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein (2009)
Introduction to Computer Science
• Mark Lutz (2013) The Hitchhiker's Guide to Python
• Brian Kernighan and Dennis Ritchie (1988) C Programming Language
• David Flanagan (2011) JavaScript: The Definitive Guide.
• Herbert Schildt (2017) Java: The Complete Reference.

4 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

Computer programming
Computer programming is giving or writing instructions for a computer to follow. These
instructions are called a program or software. A program is a set of instructions given to a
computer to enable it to perform or accomplish a task. Some examples of computer programs or
software include:
• Websites
• Mobile apps
• Video games
• Desktop software applications
• Embedded systems (e.g., the software that controls a car's engine or a washing machine)
Note: Computers are only as good as the instructions they are given. With software, computers
would be helpful. Software tells a computer what to do and how to do it.
Why is computer programming necessary?
The following are some of the reasons why computer programming is an important
• It allows us to create new and innovative products and services: Software powers
everything from websites and apps to self-driving cars and medical devices. Learning to
program can create new products and services that solve problems and improve our lives.
• It helps us automate tasks and make our lives easier: Software can automate various
functions, from sending emails to managing inventory. By learning to program, we can
automate repetitive or time-consuming tasks, freeing up our time for more important
things.
• It gives us a better understanding of how computers work: Learning to program
teaches us about the underlying principles of computing, such as algorithms, data
structures, and operating systems. This knowledge can help us to use computers more
effectively and troubleshoot problems when they occur.
• It is a valuable skill for the job market: The demand for skilled programmers is high
and expected to grow in the coming years. Learning to program can give you a
competitive advantage in the job market and open new career opportunities.
• Computer programming can help us develop problem-solving, creativity, and logical
thinking skills. It can also be a fun and rewarding hobby.

5 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

Application of computer programming


The following are some specific examples of how computer programming is used in different
fields:
• Software development: Programmers create the software applications we use daily, such
as word processors, web browsers, and mobile apps.
• Web development toolset: Programmers create and maintain the websites and web
applications we use to access information and services online.
• Data science: Programmers use programming languages to develop tools and algorithms
for analysing and visualising data.
• Artificial intelligence: Programmers use programming languages to develop AI systems
that can learn and perform tasks autonomously.
• Medicine: Computer programming is used to develop medical imaging software,
electronic health records systems, and AI systems that can diagnose diseases and
recommend treatments.
• Finance: Computer programming is used to develop trading software, risk management
systems, and fraud detection systems.
• Manufacturing: Computer programming is used to develop industrial control systems,
robotics, and computer-aided design (CAD) software.
• Transportation: Computer programming is used to develop traffic control systems,
navigation systems, and self-driving car technology.
• Education: Computer programming is used to develop educational software, e-learning
platforms, and AI systems to personalise student learning. Developing programming
curricula: Programming languages are also used to create programming curricula for
students of all ages.
• Science and Engineering: Computer programming is used to develop tools and
algorithms for modelling and simulating complex systems, such as the climate and the
human brain.
• Arts and entertainment: Computer programming creates video games, computer-
generated imagery (CGI), and special effects for movies and TV shows.
• Journalism and media: Computer programming is used to develop news aggregation
algorithms, social media platforms, and data visualisation tools.

6 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

Programmers
Programmers are the people who write code. They use their programming skills to create
software applications, websites, and other digital products. Programmers must understand
computer science concepts like algorithms, data structures, and operating systems. They also
need to be able to write code in one or more programming languages.
Source code
Source code is the code that is written in a programming language (source language). It is the
code that is read by a programmer or a compiler. Source code is typically written in a text editor
or IDE (Integrated Development Environment).
Object code
Object code is the machine language code a compiler or interpreter with the .obj extension
generates. It is the code that is executed by the computer. Object code is typically stored in a
file with the .exe extension.
Machine language
Machine language is the language that computers understand. It is a series of 0s and 1s.
Machine language is the lowest-level programming language. It is the only language that
computers can directly execute.
Translators
Translators are programs that convert source code into object code.
Types of translators
There are three main types of translators, including
Compilers
A compiler is a programming language translator that translates (converts) an entire source code
into object code all at once before it is executed.
Functions of a compiler
A compiler performs the following functions during source code compilation;
• Convert a source code written using high-level programming.
• Generates executable (.exe) object code file.
• Detects errors during translation and gives suggestions on how to correct them.
• Links the subroutines used in program instructions

7 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

Advantages of using a compiler


• Produces faster and more efficient programs
• Produces more portable programs
• Produces more secure programs.
• Produces an executable file; the program can run without the source code.
Disadvantages of using a compiler
• Can be slower to compile large programs
• Can be more difficult to debug programs
Interpreter
An interpreter is a programming language translator that translates (converts) an entire source
code into object code line by line before it is executed.
Advantages of using interpreters
• Faster to develop and debug programs
• Creates more interactive programs
Disadvantages of using interpreters
• Produces slower programs
• Produces less portable programs
• Produces less secure programs
Comparison of difference between a compiler and interpreter
Criterion Compiler Interpreter
Translation Translates the entire source code into Translates the whole source code into
object code before it is executed. object code line by line before completion.
Speed Faster Slower
Portability More portable Less portable
Security More secure Less secure
Debugging More difficult to debug Easier to debug
Space Occupies large memory to store It occupies less memory because it does
complied executable (exe) object not store executable object code.
code.
Object code Produce and store object code after Produce but do not store object code after
compilation. interpretation.

8 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

Differences between an interpreted and a compiled program


Complied program Interpreted program
Fast Slow
Occupies more space Occupies less space
There is a low likelihood of errors as There is a high likelihood of errors as they are only
most are arrested at the compiling stage. encountered when the line is translated.
Comparison /differences between a compiled and an Interpreted program
Criterion Compiled program Interpreted program
Translation Translated into machine code Translated into machine code one line at
before execution a time during execution
Speed Faster Slower

Efficiency More efficient Less efficient


Portability Less portable More portable
Development time Longer development time Shorter development time
Debugging More difficult to debug Easier to debug
Which type of program is better?
The best type of program to use depends on the specific needs of the application. For example, a
compiled language is usually the best choice if performance is critical. However, if portability or
development time is more important, an interpreted language may be a better option. The
following are some general guidelines:
• Use a compiled language for applications where performance is critical, such as operating
systems, video games, and high-performance computing applications.
• Use an interpreted language for applications where portability or development time is
more critical, such as web applications, scripting languages, and prototyping tools.
• It is also possible to use both compiled and interpreted languages in the same application.
For example, a web application written in Python may use a compiled library for tasks
such as image processing or database access.
Assemblers
An assembler is a programming language translator who translating source code written in
assembly language into object code. Assembly language is a low-level programming language
that is similar to machine language.
Advantages of using an assembler
• Produces faster and more efficient programs
• Has more control over hardware resources

9 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

Disadvantages of using an assembler


• It is more challenging to learn and use
Note: The best translator type depends on the program's specific needs. If speed and efficiency
are the top priorities, then a compiler should be used. If interactivity and ease of debugging are
more critical, then an interpreter should be used. Assemblers are typically used for programs that
need to be very fast and efficient, such as operating systems and device drivers.
Bugs and debugging
Bugs are errors in code. They can cause programs to crash, produce incorrect results, or behave
unexpectedly. Debugging is the process of finding and fixing bugs in code. Different debugging
techniques exist, such as using print statements, setting breakpoints, and stepping through
code line by line.
Linkers and Loaders
Linkers and loaders are utility programs that play a significant role in the program execution.
The source code of a program passes through the compiler, assembler, linker, and loader in the
respective order before execution, as shown in the following diagram:

The diagram above shows the following steps:


1. The compiler or assembler compiles or assembles the program's source code to create
object files.
2. The linker combines the object files and other necessary files, such as header files and
libraries, to create an executable file.
3. The loader loads the executable file into memory and prepares it for execution.
4. The processor executes the program.

10 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

Example
When you compile a visual basic program, the compiler generates object files. The linker then
combines the object files and other necessary files to create an executable file. The executable
file can then be loaded into memory and executed by the processor.
Linker
A linker is a utility program that mainly combines object files, the output of the compiler or
assembler, into a single executable file loaded in memory.
Loader
A loader is a utility program that loads the executable file into memory and prepares it for
execution. The loader also performs dynamic linking, loading shared libraries into memory at
runtime. Shared libraries are libraries that are shared by multiple programs. They are loaded
into memory only once and can be used by any program that needs them. This saves memory and
improves performance.
Comparison /differences between a linker and a loader
Criterion Linker Loader
Definition A linker is a utility program that A loader is a utility program that loads the
combines object files and other executable file into memory and prepares
necessary files, such as header files and it for execution.
libraries, to create an executable file.
Input Object files, header files, and libraries. Executable files and shared libraries
Output Executable file. Executable file loaded in memory.
Purpose To create an executable file that the To load the executable file into memory
processor can execute. and prepare it for execution.
When used During the development process. At runtime.

Which is more important?


Both linkers and loaders are essential for program execution. The object files could not be
combined into a single executable file without a linker. Without a loader, the executable file
could not be loaded into memory and prepared for execution. Thus, Linkers and loaders are
essential tools for program execution. They work together to ensure that programs can be loaded
into memory and executed correctly.

11 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

Computer programming languages


A programming language is a formal language that is used to write programs. Programming
languages are defined by a set of rules that describe how to write code. This set of rules is known
as syntax, while code is the instructions that tell a computer what to do.
Syntax includes the rules for using keywords, punctuation, and whitespace. If the syntax of a
program is incorrect, the compiler will generate an error, and the program will not compile.
Programming languages are similar to natural ones, containing symbols and syntax.
However, programming languages are much more precise than natural languages. This is
because programming languages must be able to be interpreted by a computer, which is a
machine. Any program, regardless of the programming language it is written, consists of a
sequence of instructions carried out in a particular order.
These instructions perform specific tasks, such as printing a message to the screen, calculating a
value, or drawing a shape. Some popular programming languages include Python, Java, C/C++,
JavaScript, C#, Kotlin, PHP etc.
Classifications or levels of computer programming languages
Programming languages can be classified into different levels based on their closeness to the
machine language that is understood by the computer. The languages are broadly classified into
two main categories, as shown in the following diagram:

Low-level languages
Low-level languages are the closest to machine language. They are challenging to learn and use
but provide the most control over the computer's hardware.

12 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

Categories of low-level languages


There are two types of lower-level languages, namely
• Machine language
• Assembly Language
Machine language
Machine language is the lowest-level programming language. It is the only language that
computers can directly understand. Machine language is typically written in a series of 0s and 1s.
Machine language is used for a variety of tasks, including:
• Writing device drivers: Device drivers are programs that allow a computer to
communicate with hardware devices such as printers, scanners, and network cards.
Machine language is often used to write device drivers because it provides the most
control over hardware resources.
• Optimizing the performance of critical code: Critical code needs to be as fast and
efficient as possible, such as the code that runs video games or real-time operating
systems. Machine language is often used to optimise the performance of critical code.
• Developing embedded systems: Embedded systems are computer systems embedded in
other devices, such as cars, appliances, and medical devices. Machine language is often
used to develop embedded systems because it provides the most control over hardware
resources.
• Writing malware: Malware is malicious software designed to damage or turn off
computers. Machine language is often used to write malware because it is difficult to
detect by antivirus software.
Assembly language
Assembly language is a slightly higher-level language than machine language. It uses mnemonic
codes and abbreviations to represent machine language instructions. This makes assembly
language easier to read and write than machine language. Assembly language is used for a
variety of tasks, including:
• Writing compilers and interpreters: Compilers and interpreters are programs that
translate high-level languages into machine language. Assembly language is often used to
write compilers and interpreters because it provides the most control over the translation
process.

13 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

• Writing operating systems: Operating systems manage computer hardware and


software resources. Assembly language is often used to write operating systems because
it provides the most control over hardware resources.
• Writing device drivers
• Optimizing the performance of critical code
• Developing embedded systems
• Writing malware
Advantages of low-level languages
• They develop fast and efficient programs
• They have more control over hardware resources
Disadvantages of low-level languages
• They are challenging to learn and use
• They develop less portable programs
• They are more error-prone
Note: Machine and assembly languages must still be simplified to learn and use. They require a
deep understanding of computer architecture and machine code.
High-level languages
High-level languages: High-level languages are further away from machine language. They are
easier to learn and use than low-level languages but provide less computer hardware control.
Some examples of high-level languages include Python, Java, C/C++, JavaScript, C#, PHP etc.
Advantages of high-level languages:
• They are easier to learn and use
• They are more portable programs
• They are less error-prone
Disadvantages of high-level languages
• Slower and less efficient programs
• Less control over hardware resources

14 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

Generations of computer programming languages


Programming languages can also be classified into generations based on their historical
development.
First generation languages (1GL)
First-generation programming languages (1GL) are machine languages. Machine language is the
lowest-level programming language. It is the only language that computers can directly
understand. Machine language is typically written in a series of 0s and 1s.
Advantages
• They are swift and efficient
• They have more control over hardware resources
Disadvantages
• They are challenging to learn and use
• They are less portable
• They are more error-prone
• They are specific to the computer architecture for which they are designed.
Second generation languages (2GL)
Second-generation languages (2GL) are assembly languages. They are easier to learn and use
than 1GL languages but are still specific to a particular computer architecture.
Advantages
• They are easier to learn and use than 1GL
• They are more portable
• They are less error-prone
Disadvantages:
• They are still challenging to learn and use
• They are less portable than higher-generation languages
• They are not as fast and efficient as 1GL
Third-generation languages (3GL):
Third-generation languages (3GL) are high-level languages. They are easier to learn and use than
1GL and 2GL languages, and they are more portable. Some examples of third-generation
languages include Ada, BASIC, COBOL, C, C++, Fortran, Java, JavaScript, Lisp, Pascal, Perl,
PHP, Python, Ruby, etc.

15 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

Note: 3GLs are the most popular type of programming language today. They are easier to learn
and use than lower-generation languages, such as machine and assembly. 3GLs are also more
portable and can be used to develop programs running on different computers. 3GLs are used to
create a wide variety of applications, including:
• Web applications
• Desktop applications
• Mobile applications
• Video games
• Operating systems
• Scientific computing applications
• Embedded systems.
The following are some specific examples of how 3GLs are used in the real world:
• Python is used to develop web applications like Google Search and YouTube.
• Java is used to develop mobile applications, such as Android apps.
• C++ is used to develop video games, such as Call of Duty and Fortnite.
• C is used to develop operating systems like Linux and macOS.
• Fortran is used to develop scientific computing applications like weather forecasting and
climate modelling.
Advantages
• They are the easiest to learn and use
• They are more portable
• They are less error-prone
Disadvantages
• They are not as fast and efficient as lower-generation languages
• They have less control over hardware resources
Fourth generation languages (4GL)
Fourth-generation languages (4GL) are very high-level languages. 4GLs are designed to be
easier to use than third-generation languages (3GLs). They often use natural language-like
syntax and provide graphical user interfaces (GUIs) to help users develop and maintain

16 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

applications. Some examples of four-generation languages include ABAP, FOCUS, FoxPro,


MATLAB, SQL, Visual Basic, etc.
Note: 4GLs are often used for database programming, web development, and report generation
tasks. The following are some specific examples of how 4GLs are used in the real world:
• SQL is used to query and manipulate databases. It is the standard language for database
programming.
• Visual Basic is used to develop desktop applications and web applications.
• MATLAB is used for scientific computing, such as data analysis and signal processing.
Note: 4GLs can be a powerful tool for developing applications quickly and easily. However,
they are often less flexible than 3GLs and may only be suitable for some applications.
Fifth generation languages (5GL)
Fifth-generation languages (5GL) are still under development but are designed to be even more
natural and intuitive than 4GL languages. Some examples of fifth-generation languages include
Alice, Mercury, Prolog, etc.
Note:
• 5GLs often use artificial intelligence (AI) techniques to help users develop and maintain
applications. For example, some 5GLs can automatically generate code based on natural
language descriptions.
• 5GLs are an exciting new area of research, and they have the potential to make software
development more accessible to a broader range of people.
The following are some specific examples of how 4GLs are used in the real world:
• Alice is being used to develop educational software and games.
• Mercury is being used to develop web applications and mobile apps.
• Prolog is being used to develop artificial intelligence applications and natural language
processing systems
Note: 5GLs have the potential to revolutionise the way that software is developed. However,
they are still in their early stages of development, and they have yet to be widely used.
Advantages
• They are the most natural and intuitive to use
• They can be used to develop complex applications quickly and easily

17 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

Disadvantages
• They are still under development
• They are not as widely used as lower-generation languages
Which age of language should you choose?
The best generation of language to choose depends on your specific needs and goals. If you need
to develop a speedy and efficient program, or if you need to have much control over the
hardware resources, then you may need to use a lower-generation language. However, if you are
new to programming or need to develop a program quickly and easily, you should use a higher-
generation language.
Note: Most modern programming tasks can be accomplished using a high-level language.
However, some jobs still require using a lower-level language, such as writing device drivers or
optimising the performance of critical code.
Uses of some popular programming languages
Programming languages are used to create a wide variety of products and services, including:
• Websites and web applications: Programming languages such as HTML, CSS, and
JavaScript are used to create the structure, appearance, and interactivity of websites.
Back-end web development languages such as Python, Java, and PHP are used to process
data and generate dynamic content.
• Mobile apps: Programming languages such as Java, Kotlin, and Swift are used to create
native mobile apps for Android and iOS devices. Cross-platform development languages
such as Flutter and React Native can be used to develop mobile apps that run on both
platforms.
• Desktop software applications: Programming languages such as C++, C#, Java, and
Python are used to create desktop software applications for Windows, macOS, and Linux.
These applications can include anything from productivity suites to video games.
• Video games: Programming languages such as C++, C#, Unity Script, and Unreal
Engine are used to create video games.
• Embedded Programming languages such as C and C++ are used to create embedded
systems, which are computer systems embedded in other devices, such as cars,
appliances, and medical devices.

18 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

• Data science applications: Programming languages like Python and R are used to clean,
analyse, and visualise data. These languages are also used to build machine-learning
models and artificial intelligence applications.
• Artificial intelligence applications: Programming languages such as Python and
TensorFlow are used to develop artificial intelligence applications such as chatbots,
image recognition systems, and natural language processing systems.
• Scientific computing applications: Programming languages such as MATLAB and
Python perform scientific computations such as numerical analysis and mathematical
modelling.
• Financial engineering applications: Programming languages like C++ and Python are
used to develop financial models and trading systems.
Healthcare
Programming languages are used in a variety of ways in healthcare, including:
• Developing medical devices: Programming languages such as C and C++ are used to
develop pacemakers, MRI machines, and insulin pumps.
• Analyzing medical data: Programming languages like Python and R are used to analyse
medical data, identify trends and patterns, and develop new diagnostic tools and
treatment plans.
• Creating electronic health records (EHRs): Programming languages such as Java and
C# are used to develop EHRs, digital versions of a patient's medical records.
• Developing telehealth applications: Programming languages such as JavaScript and
Python are used to develop telehealth applications, which allow patients to consult with
healthcare providers remotely.
Education
Programming languages are also used in a variety of ways in education, including:
• Developing educational software: Programming languages such as Java and JavaScript
are used to create educational software to help students learn various subjects, such as
math, science, and language arts.
• Creating online learning platforms: Programming languages such as Python and Ruby
on Rails are used to develop online learning platforms, which allow students to take
courses and learn at their own pace.

19 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

Manufacturing
Programming languages are also used in a variety of ways in manufacturing, including:
• Developing industrial control systems: Programming languages such as C and C++ are
used to develop industrial control systems, which are computer systems that control
machines and production lines.
• Designing and manufacturing products: Programming languages such as CAD/CAM
software are used to design and manufacture products.
• Analyzing manufacturing data: Programming languages such as Python and R are used
to analyse manufacturing data to identify improvement areas and optimise production
processes.
Factors to consider when choosing a programming language
When choosing a programming language, there are several factors to consider, such as:
• The purpose of the program you are developing: What kind of program do you want
to write? Is it a web application, a mobile app, a desktop application, a video game, or
something else? Different programming languages are better suited for different types of
programs. For example, if you want to write a web application, consider using a language
like Python, JavaScript, or PHP. If you write a mobile app, consider using a language like
Java, Kotlin, or Swift.
• The platform you want to target: Where do you want your program to run? On a
desktop computer? On a mobile device? On a web browser? On a server? Some
programming languages are platform-specific, while others are cross-platform. For
example, Java is a cross-platform language, meaning that Java programs can run on any
platform with a Java Virtual Machine (JVM).
• Your skills and experience: How much programming experience do you have? What
programming languages do you already know? If you are new to programming, you
might want to choose a language that is relatively easy to learn, such as Python or
JavaScript. If you are an experienced programmer, you might have more flexibility in
your choice of language.
• The availability of resources and support for the language: How popular are you
considering the language? Are there many resources available for learning and using the
language? Can a large community of users and developers support you if you have

20 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

problems? It is essential to choose a language with a strong community and many


resources available.
• Performance: How important is performance for your program? Some programming
languages are faster than others. If performance is critical for your program, you might
want to choose a language known for being quick, such as C or C++.
• Scalability: How large and complex is your program going to be? Some programming
languages are better suited for large and complex programs than others. If scalability is
essential for your program, you might want to choose a language known for being
scalable, such as Java or Python.
• Security: How important is security for your program? Some programming languages
have better security features than others. If security is essential for your program, you
might choose a language with solid security features, such as Rust or Go.
• Employability: If you plan to use your programming skills to get a job, you might want
to consider the employability of the language you are learning. Some programming
languages are more in demand in the job market than others. For example, Java, Python,
and JavaScript are all highly in-demand programming languages.
• personal preference: Ultimately, the best programming language for you is the one you
enjoy most. There is no right or wrong answer when choosing a programming language.
Experiment with different languages and see what you like best.
• Future-proofing: How important is it to you that the language you choose will be
relevant in the future? Some programming languages are more mature and stable than
others. If you plan to develop a long-term project, you might want to choose a well-
established language with a strong community.
Note:
• If you are new to programming, starting with a high-level language, such as Python or
Java, is generally recommended. These languages are easier to learn and use than low-
level languages, and many resources and support are available. Once you understand the
basics of programming, you can learn more specialised languages, such as C/C++ or
JavaScript.
• There is no perfect programming language. Every language has its strengths and
weaknesses. Ultimately, the best programming language for you is the one that best

21 Complied by Mr. P.K Munene


Visual Basic Lesson 1 - Introduction to computer programming

meets your needs and requirements. Consider all the factors above and choose the
language you think suits you.
Computer programming is a powerful tool for creating various products and services, from
websites and mobile apps to video games and scientific simulations. It is a foundational skill
essential for many fields, including software development, web development, data science, and
artificial intelligence. Computer programming is also valuable, as it opens up many career
opportunities in the tech industry. As technology continues to evolve, the importance of
computer programming will only grow.
References
• Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein (2009)
Introduction to Computer Science
• Mark Lutz (2013) The Hitchhiker's Guide to Python
• Brian Kernighan and Dennis Ritchie (1988) C Programming Language
• David Flanagan (2011) JavaScript: The Definitive Guide.
• Herbert Schildt (2017) Java: The Complete Reference.

22 Complied by Mr. P.K Munene

You might also like