The Computer programming expertise can get you your dream job with top notch technology company as a software developer with excellent financial rewards . The computer programming skills can put your career on the fast track.
A computer program is a set of statements written in a computer programming language which directs the computer hardware to perform specific tasks .
A computer program can be written in any programming language depending upon the purpose and type of the software being developed .
In this tutorial , we will learn what is a computer program , how program works , program compilation and other important topics related to the computer programming.
Programming Interview Questions
While learning computer programming , the students generally have many questions in their mind . Some of the most common questions related programming include :
What Is Computer Programming ?
Let us first understand what is a Computer System . A Computer system can also be defined as programmable electronics device that can be programmed to accept some inputs in terms of data , then process this data as per the program instructions and provide the Output in the desired format that can be used for some meaningful work .
The Computer System first must be programmed to perform a specific job on the computer . Further , the Computer is a digital electronic machine .
That means , the computer can understand and execute instructions on in binary which consist of only two numbers that is 0 and 1 .
The binary code is also referred as machine code or machine language .
What Is Computer Program ?
A computer program is a group of instructions written using a computer programming language ( Such as C , C++ , Java , Python ) .
The computer programs are written to perform a specific task . For example , A computer Program ( Software ) to play music in your computer OR to play game and so on.
Each computer program usually consist of number of program statements . Each program statement performs a part of the job . The programmer must write the program statements as the programming language syntax .
Each programming language has its own syntax ( Set Of Rules ) which clearly defines the manner in which the computer program statements can be constructed.
The programmer can choose any programming language of his choice depending upon the type of the software application to be developed .
Computer Program Compilation
And therefore, the computer programs written in any high level programming language must be first converted into machine code in binary .
This conversion process is referred as program compilation. Each programming language has its own compiler which converts the program code into executable program ( Machine code in Binary ) . The converter program is referred as compiler .
How Computer Program Is Executed ?
The program execution starts when the user gives the command to the operating system to run any program.
The operating system then initiates the program execution by allocating the necessary resources such as memory and the processor time.
The CPU operates on the data as per the program instruction and the processed data ( Result ) is then either sent to a output device such as display monitor Or could be stored into any permanent storage ( Secondary Storage ) device such as hard disk for future use .
Types Of Programming Languages
The programming languages are generally classified as high and low level language . The higher level programming languages are more human readable and the lower level programming languages are machine readable. However, the computer system can execute only low level programs in machine code in Binary.
The computer programming languages are classified on the basis of ease of readability of the language , program execution speed and the level of abstraction in the programming language.
The computer programs are generally written in higher level programming languages such as Java , C++ , Python which provides a high degree of abstraction and mask the complexity of the low level programming language such as assembly language .
Levels Of Programming Languages
The high level programming languages are more human readable whereas the low level programming languages provide least abstraction.
And therefore, it is relatively far more difficult to read and write the program in low level language such as assembly language .
The program execution speed is higher for the programs written in low level language whereas the programs written in high level language have relatively lower execution speed .
Compiled Vs Interpreted Programming Language
Depending upon the type of programming language , A computer program can either be compiled or interpreted during its execution .Compiler and Interpreter are two different ways to execute a program code .
The computer program can be either written in a programming language or scripting language.
During the compilation process , A compiler takes the entire program code and converts it into object code which is typically stored in a file. The object code contains library references which is replaced by actual binary code by the linker .
The binary code after linking the object code can be directly executed by the computer system. Examples of compiled programming languages are C and C++
Whereas an Interpreter directly executes instructions line by line written either in a programming language or scripting language without any prior converting them to an object code or machine code.
The Python is an examples of interpreted language. Similarly , the java program is first compiled to an intermediate byte code , which is then executed by the Java Virtual Machine ( JVM ).
Software , Software Package , Software Application
The application programs are developed to provide solution to specific user problem . The application programs are also referred as application software or simply an application.
The application programs provide an interface to the user for using the computer system for specific purpose .
For example , the user might work on the accounting software for accounting jobs . The most commonly used application software are Microsoft Word , Excel and PowerPoint .
The Application software provide a very user friendly graphical interface to get the specific job done for which that application software has been designed.
System Software , System Program
The System Software is a collection of programs provide interface to interact with computer hardware. The system programs are designed to operate , control and extend the processing capabilities of the computer system itself .
The system software programs are usually designed and developed by the computer manufacturer to communicate with specific hardware components connected to the computer system such as device driver software necessary to connect that hardware to the computer system.
An Operating System is an essential component for all computer systems .The operating system provide an interface to the user to communicate with the system hardware.
The operating system ( OS ) is the most commonly used example of system software. The Operating System manages all the application programs and the hardware components attached to the computer system.
The operating system makes use of some system software called as utility software which allows the user to manage the computer system.
There are many different utility programs for different purpose and they may vary across operating systems. These utility software can be accessed by the user via a special menu or control panel in the operating system .
A Computer program is a set of instructions written by a programmer in a computer programming language .
Each computer system has a CPU ( Processor ) which is the brain of the system . The CPU is responsible to decode and execute the program.
The CPU is the main component which performs arithmetic calculations and logical operations .
However , The CPU can understand and execute program instructions only in machine code which is binary representation consisting of 0 ( zero ) and 1 ( one ).
All computer programs must be first converted ( either compiled or interpreted ) to machine code before it can be executed by the computer .
A Program compilation is a process in which a human readable program code written in any programming language ( such as C , C ++ , Java , Python ) is converted into a machine readable code in binary ( using only 0’s and 1’s ).
This program conversion to binary code is done by using a special program called either compiler OR Interpreter depending upon the type of the programming language .
The compiler only converts the program source code in to the Object code ( Binary Code ) . The object code cannot be directly executed by the operating system .
The Object code file needs to be further processed by another program called “Linker” which is built in to the compiler .
The compiler may produce number of object code files for a single program source code file . The object code consist of machine code instructions in binary which is equivalent of corresponding high level program instructions in program source file .
And therefore , linking is needed to link all object code files and other files together to create an “Executable” file .
The programmer can use these user defined functions and standard function libraries by simply including these files in the beginning of the program header section .
Since the standard library code is in the object code form which is a pre-compiled format and can be directly included in the linking stage by the linker while creating an executable file ( sourcefile.exe ) during the program compilation process .
During final stage of compilation process , whenever the linker finds a reference to a library routine in the object file, it reads the library files ,then finds that routine and replaces the programmer’s reference with the actual code for the routine from the library file.
After it has replaced all the references with actual code from the library files , the linker then creates an executable binary file which can be executed by the operating system ( OS ).
Classification On Organization Of Program Code
The programming languages can also differ on the basis on organizing the program code and manner in which data is handled in the program . The programming paradigm defines a particular style of writing and organizing the program code .
In procedural programming , the problem is bifurcated in to number of small problems known as procedures ( Also alternately referred as functions Or methods ) .
Each of these procedures provide solution to part of the problem . These procedures can be called many times depending upon the algorithm of the program to solve a particular problem .
The procedural programming languages are generally the first preferred choice for students to learn the computer programming . Some of the most popular procedural languages include C , Fortran , Pascal and Basic.
A procedural program is written as a list of instructions, directing the computer hardware to step-by-step to perform desired operation.
As the name suggest , in this approach , a group of program statements is written to solve one task and declared as a procedure .
The program consist of the main function or program block, subroutines, functions, procedures , header files , includes / modules , libraries. During the program execution , the a procedure may be invoked number of times.
Limitations Of Procedural Programming
In procedural programming the data ( program variables ) are mostly global and accessible to all the functions . For a large programs it is very difficult to keep the track of the changes in the data being operated upon by many functions simultaneously .
Such changes in the data can adversely affect the functionality of other functions . Similarly , when the new data is added all the functions operating on that data also need to be modified accordingly .
The most serious limitation of the procedural programming is the tendency for large procedural-based programs to turn into “spaghetti-code” since the dada access is not controlled and might get accidently changed by other functions.
The Spaghetti code is functionally useless program code . It is very difficult to debug the spaghetti program code .
And therefore, programmer should follow the standard best coding practices to avoid program resulting in to such badly tangled Spaghetti code .
The Structured programming ( sometimes known as modular programming ) is a subset of procedural programming that enforces a logical structure on the program being written to make it more efficient and easier to understand and modify.
Structured programs makes extensive use of the program control structures such as sequence , decision / selection and repetitions like loops .
The Structured programming is a programming paradigm that helps to improve the clarity, quality, and development time of a computer program by making extensive use of procedures, block structures and looping structures like for loop , do while loop and while loop.
Object Oriented Programming
The Object Oriented Programming ( OOP ) is an approach to software application development where all application components are treated as objects. An object is a component of a program that has its own data and methods.
An object knows how to perform certain actions and how to interact with other elements of the program. Objects are the basic units of object Oriented programming .
In Object Oriented Programming ( OOP ) , a Class is simply a description of an object and the Class defines the datatype for an object .
A class is a design time entity used to define the object. Whereas an object is a runtime entity created during the program execution .
A class is the blueprint , or a plan , or a template, that describes the details of an object. A class is the blueprint from which the individual objects are created.
A Class is composed of three things :
1. Class Name , 2. Attributes , 3. Operations.
Advantages Of Object Oriented Programming
The Programs once developed and operational continues to be in use for a considerable period of time even if the support is discontinued .Such code is referred as Legacy code.
The legacy code needs to be supported , either to be improved upon ( for a new version of an exist piece of software ) or made to work with newer computers and software.
How To Learn Programming ?
A career in computer programming can be very rewarding and completely worth the time , efforts and patience which you need to invest while learning the computer programming.
Some people initially find learning computer programming a bit scary and tedious. However , once you learn your the first language than learning the second programming will be much easier.
With the help of best learning practices, you can easily learn the computer programming without much difficulty. If you follow the right learning strategy then you can learn any programming language without any problem .
Now , Let us discuss this learning strategy in detail .
- Be Professionally Qualified .
- First Learn the Fundamentals Of Computer Science And Programming
- Learn Both Theory And Practical
- Learn the Best Programming Practices.
- Start With Simple Programming Language
- Work On the Project
How to learn Computer Programming ?
Learn To Code
The computer programming is still continues to be the most favored choice for many students. The financial rewards and career opportunities for a computer science professional are very good .
And therefore , career in CS is completely worth the efforts and patience which you need to invest , while the learning programming .
There is a huge shortage of qualified professionals in every field of computer science . An opportunity in computer science can put your career on the fast track .
Although , some people might initially find , Learning computer programming a bit challenging and difficult . But every programmer has to go through this learning curve and learn to overcome these challenges .
If you have the right learning strategy in place and follow the best learning practices, you can easily learn the computer programming without much difficulty.
Computer Programming - FAQ
A processor ( CPU ) is an integrated circuit ( IC ). The processor consist of millions of IC chips and each IC chip consist of millions of tiny component called transistor. The Transistor is madeup of silicon which is a semiconductor material .
The processor ( CPU ) controls all the activities of the computer system. And therefore it is referred as brain of the computer system. There are two main computer processor manufacturers Intel and Advanced Micro Devices ( AMD ). These two companies produce most of the processors used in desktop, laptops and notebooks.
A Central Processing Unit ( CPU ) performs millions tasks per second to execute a computer program by performing the basic arithmetic, logical, control and input / output ( I / O ) operations as specified by the program instructions.
A CPU is placed on the motherboard in a processor socket with locking liver mechanism in order to fix the processor chip properly into the processor socket . The processor socket contains a IC socket in which the processor chip is firmly mounted . A heatsink is mounted on the top of the processor chip which protects the processor from excessive heat generated.
The CPU performs some of the most important functions in a computer System and these functions include :
- To Perform Arithmetic Calculation Operations.
- To Perform Logical Operations.
- To Control Functions Of Other Hardware Components.
- To Fetch the Data And Program Instructions From Main Memory.
- To Decode the Program Instructions.
- To Operate On Data As per Program Instructions.
- To Store Data After Processing.
- To Continuously Execute Instruction Cycle / Machine Cycle.
There are two main types of CPU based on the Instruction Set Architecture :
- CISC - Complex Instruction Set Computing .
- RISC. - Reduced Instruction Set Computing .
- Most desktop or laptop computers use CISC ( Complex Instruction Set Computing ) architecture made by Intel or AMD.
- Whereas Smartphones and tablets use RISC ( Reduced Instruction Set Computing ) by ARM architecture.
- Click On The Image To Expand.
Join The Best Seller
Computer Science Online Course
This is the most comprehensive and unique Computer Science And Programming Fundamentals course Online which will give you in depth understanding of most important fundamental concepts in computer science And Programming .