Programming Language Basics
What is a Programming Language? “A computer, human-created language used to write instructions for a computer.” “An artificial language that enables people to instruct machines. Computer commands that form procedures by which software programmers design and implement computer software programs.” “A computer tool that allows a programmer to write commands in a format that is more easily understood or remembered by a person, and in such a way that they can be translated into codes that the computer can understand and execute.”
High Level vs. Low Level A high level programming language is one that is easy to learn and similar to English A low level programming language is more difficult to learn but more closely resembles what actually goes on inside a computer
Machine Code At the lowest level, we have machine code which consists of 0’s and 1’s Computers ultimately can only understand machine code Machine code can look something like what you saw in the movie The Matrix
001010100010010001001000100101001010101010100100100010101010010101011101010010101110100010001010010111110100111010100100010010101010110101011101010101100010010101111101100100100011110101011101010010100101010100101010001010100010010001001000100101001010101010100100100010101010010101011101010010101110100010001010010111110100111010100100010010101010110101011101010101100010010101111101100100100011110101011101010010100101010100101010101001111101110101100100111101001000101001101000100000010111010011101111101001001010010010101001010000100100010100
High Level Code On the other hand, high level language code is much easier for us to understand and write Examples of high level programming languages? Java, Visual Basic, C/C++, Turing, Fortran, Pascal
What High Level Code Looks Like in Turing if grade >= 60 then put “You passed!” else put “You failed!” end if
What High Level Code Looks Like in Java if (grade >= 60) { System.out.println(“You passed”); } else System.out.println(“You failed”);
The Compiler A compiler is a program that translates high level program code into low level machine code A compiler usually checks your high level code for syntax errors before translating it
if (grade >= 60) printf (“You passed!”); else printf (“You failed!”); High level code 0010101000100100 0100100010010100 1010101010010010 machine code compile