PROGRAMMINg


WHAT IS  PROGRAMMING ?
A programming is a series of instructions that directs a computer to perform task.

PROGRAMMING LANGUAGE ?
programming language is a formal language, which comprises a set of instructions used to produce various kinds of output. Programming languages are used to create programs that implement specific algorithms.

TYPES OF PROGRAMMING LANGUAGE?

1)HIGH-LEVEL LANGUAGE 
high-level language (HLL) is a programming language such as CFORTRAN, or Pascal that enables a programmer to write programsthat are more or less independent of a particular type of computer. Such languages are considered high-level because they are closer to human languages and further from machine languages.
In contrast, assembly languages are considered low-level because they are very close to machine languages.
High Level Language

Advantages of High-Level Languages

The main advantage of high-level languages over low-level languages is that they are easier to read, write, and maintain. Ultimately, programs written in a high-level language must be translated into machine language by a compiler or interpreter.
The first high-level programming languages were designed in the 1950s. Now there are dozens of different languages, including Ada, Algol, BASICCOBOL, C, C++, FORTRAN, LISP, Pascal, and Prolog.
2)LOW-LEVEL LANGUAGE
Low-level languages have the advantage that the programmer is able to tune the code to be smaller or more efficient, and that more system-dependent features are sometimes available. Their use is often a necessity when writing DeviceDrivers or EmbeddedSoftware. They have the disadvantage that they are often unportable, and usually harder to program in, both in the sense that the programmer has to pay more attention to fine details, and in the sense that it takes more LinesOfCode to achieve the same result. As a concrete example, data types in a low level language might represent 8, 16 or 32 bit wide integers, whereas a high level language might feature human-friendly Currency and Date types. Low level languages are always static, and never have garbage collection.

The classic and uncontroversial example of a low level language is AssemblyLanguage. Assembly is a mnemonic-based low-level language replacing binary machine-code instructions, which are very hard to remember, write down, or correct, with short codes (mnemonics) chosen to remind the programmer of the instructions they represent. For example, the binary-code instruction that means ‘store the contents of the accumulator’ may be represented with the mnemonic STA (st/ore a/ccumulator)

A low level language may be defined by the presence of hardware orientated features as well as the absence of high level constructs. Assembler is considered low level, although it usually include a macro facility, that allows single lines of code to expand into multiple machine code instructions.




Introduction to Java programming

JAVA was developed by Sun Microsystems Inc in 1991, later acquired by Oracle Corporation. It was developed by James Gosling and Patrick Naughton. It is a simple programming language.  Writing, compiling and debugging a program is easy in java.  It helps to create modular programs and reusable code.

Java terminology

Before we start learning Java, lets get familiar with common java terms.
Java Virtual Machine (JVM)
This is generally referred as JVM. Before, we discuss about JVM lets see the phases of program execution. Phases are as follows: we write the program, then we compile the program and at last we run the program.
1) Writing of the program is of course done by java programmer like you and me.
2) Compilation of program is done by javac compiler, javac is the primary java compiler included in java development kit (JDK). It takes java program as input and generates java bytecode as output.
3) In third phase, JVM executes the bytecode generated by compiler. This is called program run phase.

So, now that we understood that the primary function of JVM is to execute the bytecode produced by compiler. Each operating system has different JVM, however the output they produce after execution of bytecode is same across all operating systems. That is why we call java as platform independent language.
bytecode
As discussed above, javac compiler of JDK compiles the java source code into bytecode so that it can be executed by JVM. The bytecode is saved in a .class file by compiler.

Java Development Kit(JDK)
While explaining JVM and bytecode, I have used the term JDK. Let’s discuss about it. As the name suggests this is complete java development kit that includes JRE (Java Runtime Environment), compilers and various tools like JavaDoc, Java debugger etc.
In order to create, compile and run Java program you would need JDK installed on your computer.

Java Runtime Environment(JRE)
JRE is a part of JDK which means that JDK includes JRE. When you have JRE installed on your system, you can run a java program however you won’t be able to compile it. JRE includes JVM, browser plugins and applets support. When you only need to run a java program on your computer, you would only need JRE.

These are the basic java terms that confuses beginners in java. For complete java glossary refer this link:

Main Features of JAVA

Java is a platform independent language

Compiler(javac) converts source code (.java file) to the byte code(.class file). As mentioned above, JVM executes the bytecode produced by compiler. This byte code can run on any platform such as Windows, Linux, Mac OS etc. Which means a program that is compiled on windows can run on Linux and vice-versa. Each operating system has different JVM, however the output they produce after execution of bytecode is same across all operating systems. That is why we call java as platform independent language.

Java is an Object Oriented language

Object oriented programming is a way of organizing programs as collection of objects, each of which represents an instance of a class.
4 main concepts of Object Oriented programming are:
  1. Abstraction
  2. Encapsulation
  3. Inheritance
  4. Polymorphism

Simple

Java is considered as one of simple language because it does not have complex features like Operator overloading, Multiple inheritance, pointers and Explicit memory allocation.

Robust Language

Robust means reliable. Java programming language is developed in a way that puts a lot of emphasis on early checking for possible errors, that’s why java compiler is able to detect errors that are not easy to detect in other programming languages. The main features of java that makes it robust are garbage collection, Exception Handling and memory allocation.

Secure

We don’t have pointers and we cannot access out of bound arrays (you get ArrayIndexOutOfBoundsException if you try to do so) in java. That’s why several security flaws like stack corruption or buffer overflow is impossible to exploit in Java.

Java is distributed

Using java programming language we can create distributed applications. RMI(Remote Method Invocation) and EJB(Enterprise Java Beans) are used for creating distributed applications in java. In simple words: The java programs can be distributed on more than one systems that are connected to each other using internet connection. Objects on one JVM (java virtual machine) can execute procedures on a remote JVM.

Multithreading

Java supports multithreading. Multithreading is a Java feature that allows concurrent execution of two or more parts of a program for maximum utilisation of CPU.

Portable

As discussed above, java code that is written on one machine can run on another machine. The platform independent byte code can be carried to any platform for execution that makes java code portable.
POINT OF VIEW:
In my point of view, computer programming  are mandatory for many majors. However, the high rate of failures shows that students have difficulties in assimilating the topics. The objective of this research is to understand these difficulties. Analyzing diaries filled out by students and interviews with instructors, we identified difficulties related to language and understanding and some strategies used to mitigate them. The analysis and understanding of the difficulties may support the creation of teaching strategies and tools to facilitate the teaching and learning of computer programming.

Comments