Programming Languages
PROGRAMMING LANGUAGES
A set of written symbols that instruct the computer to perform certain tasks is known as programming language. Programming languages are invented to solve problems using computers. Modern programming languages are: C, C++, Java, .NET etc. Note that natural languages are English, Hindi, Arabic, Japanese, and Chinese etc. Natural languages are for Humans and programming languages are for computers.
MACHINE LANGUAGE
Also known as Binary language. Note that machine language is nothing but sequence of 1s and 0s. Machine language is the only way to directly communicate with the computer. First programmers write code as sequence of binary numbers. Writing programs in binary or machine language is difficult, boring and error prone.
ASSEMBLY LANGUAGES
Symbols known as MNEMONICS are used to represent instructions. Some examples of mnemonics are: ADD, SUB, MUL and DIV for addition, subtraction, multiplication and division respectively. Note that these commands look like English statements. Main disadvantages of Assembly languages are – machine dependent i.e., IBM computers have different assembly language than computers from Motorola. So, assembly language programs are different for different CPUs (i.e. machines). Writing assembly languages require specific knowledge of computer hardware.
HIGH LEVEL LANGUAGES
HLL instructions look like human language and uses English like statements. Programs written in HLL are known as SOURCE CODE. Here no detail knowledge of computer hardware is required. HLL languages are machine independent. This means that the programs written in HLL can be executed in any machine. Examples of HLL are: C, C++, Pascal, COBOL and FORTRAN etc.
PROBLEM SOLVING USING COMPUTERS
Initially problem is analysed. If required, problem is split into sub-problems. Now solve each sub-problem and combine the solutions of sub-problems. Combining or merging these solutions of sub-problems gives final solution. Flowcharts and Algorithms are used to analyse and represent the solution to a problem. Then these flowcharts or algorithms are converted to PROGRAMMING LANGUAGES. Programming languages use software tools such as COMPILER, INTERPRETERS and ASSEMBLERS etc. to solve a given problem. Note that compiler, interpreter and assemblers are TRANSLATORS, which suppose convert C, C++, Java programs to MACHINE LANGUAGE.
Program is set of instructions. Instruction is a command to computer to do some task. At the top we have software, which is collection of programs. We write programs or software to solve some real-life problems.
We have different approaches (paradigm) to programming like – OOP, Object based programming, and Procedure oriented programming etc.
We use different concepts in different programming languages. For example, OOP uses concepts like class, object, inheritance etc. Procedure oriented programming languages like C uses functions.