Introduction to Computer Programming
Table of Contents
Page Content
Introduction
Large speeds of operations and large capacity of storage are some of the most important characteristics of computers. However in order to be useful in everyday life, computers need to be instructed on what to do and how to do it.
Computer programming [1, 2] is about instructing computers to do things the way you want them to do it. A computer program is a set of basic instructions, written using a specific programming language, that the computer follows in order to achieve a well defined task . A programmer is a professional person who writes, tests and debugs sets of computer instructions, called computer programs. These programs are developed using any of the programming languages.
A computer is a set of electronic circuits that use two electric levels: 1 and 0. Of course the instructions given to the computer, in order to execute certain tasks, need to follows certain rules just like the languages human use. The languages used to write computer programs are called programming languages which are then translated into a machine language using the two levels 1 and 0 that the computer understands. A programming language that is closer to a machine language is called low level language. Any programming language that is machine independent and uses natural language items that makes it easy to use is called a high level language.
There are several programming languages that may be used depending on the function of the program to develop: games, animations, robotics, numerical computations, graphing, interactive educational software, etc.
Examples of computer languages
-
Java [4] is a popular high-level, general-purpose programming language that is known for its object-oriented features, platform independence, and strong security. It allows for modular and reusable code, and includes a wide range of standard libraries and frameworks. Java can be used for developing enterprise applications, web applications, mobile applications, and more.
- Python [6] is a high-level programming language that can be used for a wide range of applications, and it is particularly popular in the fields of animation and game development. This is due in part to the fact that Python is easy to learn and use, making it accessible to a wide range of developers. Python also includes a number of libraries and frameworks that are specifically designed for animation and game development, such as Pygame, Panda3D, and Blender. Additionally, Python's scripting capabilities make it a popular choice for automating tasks and creating custom tools in the animation and game development pipeline.
- C language [3] is a high-performance, low-level programming language that is commonly used for system programming, embedded systems, and other applications that require direct access to hardware. Its low-level nature allows for greater control over memory management and system resources, making it a popular choice for writing operating systems, device drivers, and other low-level software. While C may require more effort and expertise to write and maintain compared to higher-level languages, it offers unparalleled performance and control. Its popularity and longevity have also led to a large community of developers and a wide range of libraries and tools available for use.
- C++ is a high-level programming language that builds upon the foundation of the C language, adding support for object-oriented programming (OOP) concepts such as classes and inheritance. C++ is commonly used for developing complex software applications such as operating systems, game engines, and database management systems. Its OOP features allow for the creation of reusable and extensible code, making it easier to maintain large codebases over time. Additionally, C++ includes a wide range of libraries and frameworks that can be used to simplify common tasks and accelerate development. Its performance and versatility have made it a popular choice for many industries and applications.
- C# is a high-level, modern programming language. It is an object-oriented language that includes a number of features designed to simplify and speed up the development process, such as automatic memory management and type safety. C# is commonly used for developing desktop applications, web applications, and games, and it includes a wide range of libraries and frameworks that can be used to simplify common tasks and accelerate development. Its strong community support, large ecosystem, and close integration with Microsoft's development tools make it a popular choice for many developers.
- Ruby is a high-level programming language that is known for its simplicity and productivity. It was specifically designed for web development and includes a number of features that make it well-suited for building dynamic, server-side web applications. With its expressive syntax and strong focus on developer productivity, Ruby has become a popular choice for many web developers.
-
JavaScript [5] is a high-level programming language that is widely used for developing dynamic and interactive websites. It allows developers to create responsive user interfaces, handle user input, and dynamically update web pages without the need for reloading. In addition to web development, JavaScript is also commonly used for game development, server-side programming, and building desktop and mobile applications. Its popularity has led to the development of a vast ecosystem of libraries and frameworks, including popular tools such as React, Angular, and Vue.js. With its versatility and wide range of applications, JavaScript has become one of the most widely used programming languages in the world.
Example: Java Language Programming
When using Java language for example, a simple text editor may be used to write a computer program. The following is a Java computer program saved in a text file called FirstExample.java.
--------------------------------------------------------------
class FirstExample {public static void main(String[ ] args){
System.out.println("This is my first program !");
}
}
----------------------------------------------------------------
The above program needs to be translated into a language the computer understands and is therefore translated using a compiler using the commands javac as follows.
javac FirstExample.java
which produces a file of the form FirstExample.class. When FirstExample.class is run using the command java as follows
java FirstExample.class
it produces the output
This is my first program !
Object Oriented Programming
Object-oriented programming (OOP) is a programming paradigm that revolves around the creation of classes, which define the properties and behaviors of objects. Programmers then model objects that are instances of these classes, which have descriptive properties and can perform actions through methods.
One of the key advantages of OOP is that class definitions can be reused in other programs, making it easier to write and maintain code. In addition, the concept of classes allows for the definition of any new type of data that has not been previously defined, making OOP a flexible and versatile approach to programming.
To summarize, OOP is a powerful programming paradigm that is based on the creation of classes and objects. By defining the properties and behaviors of objects, programmers can model complex systems and build reusable code that can be used across multiple programs. OOP's versatility and flexibility make it a popular approach to programming for many developers.
References
[1] Programming for the Absolute Beginner 1st Edition - Jerry Lee Ford Jr. - ISBN-13: 978-1598633740
[2] Programming: Computer Programming for Beginners: Learn the Basics of Java, SQL & C++ - 2. Edition (Coding, C Programming, Java Programming, SQL Programming, JavaScript, Python, PHP) - Joseph Connor
[3] C Programming Absolute Beginner's Guide (3rd Edition) 3rd Edition - Greg Perry and Dean Miller - ISBN-13: 978-0789751980
[4] Java: A Beginner's Guide, Sixth Edition 6th Edition - Herbert Schildt - ISBN-13: 978-0071809252
[5] JavaScript and JQuery: Interactive Front-End Web Development 1st Edition - Jon Duckett - ISBN-13: 978-1118531648
[6] Learning Python: Powerful Object-Oriented Programming Paperback – By Mark Lutz (Author) - July 6, 2013