First things first, what is a program? what is a programming language? How many kinds of programming languages are there? Which one of them is Java? Is this the first thing I should learn if I’m a newbie to programming? Let’s hit all these questions point by point.
What is a program?
As we know, computers can do stuff like play a video, calculate, predict weather and other complex things. But how can they? They must know or must have been told how to do these things, right? When we tell computers what to do and how to do, we tell them in form of instructions and these instructions are called programs. I hope that makes sense to you. Let’s take an easy example: Your mom asked you to make tea, but you don’t know how to do that. So she gives you couple of instructions starting with, take water in a pan, bring it boil, add tea leaf and sugar and so on. So these are set of instructions which were given to you and together a program.
What is a programming language?
Now, let’s say you speak English and your mom gave you these tea making instructions in French. Will you be able to understand these instructions? Hopefully, no! Similarly with machines, we need to give instructions in a language they understand or are at least are able to translate in a language they understand. So to summarize, the language in which we give machines instruction (or write programs) is called a programming language (PL).
P.S: I’ve mentioned machines and not just computers because Java can be used on various platforms and not just computers. Your coffee machine might be running Java.
How many types of programming languages are there?
There are mainly three kinds of programming language:
Machine Language: As the name suggests, this is the most basic language machine understands and are direct executed by the machines without translating them. Machine Language is basically 1s and 0s written in a way to make sense. 1 and 0 is often called binary numbers. Good for us, we seldom write programs in Machine Language..
Assembly Language: Easier than Machine Language but still it isn’t much appealing to humans much. It uses much convenient numbers, abbreviations and symbols but you’ll have to use an assembler to convert your code to machine language.
High-level Language: High-level language uses English like instructions and is easy to learn. The code/instructions obviously need to be compiler using compilers to a machine readable format. And as luck would have it, Java, which we’re going to learn is a high-level language.
We can also classify programming languages as: procedural programming lamguage, functional programming language, Object Oriented programming language, Scripting programming language, Logic programming language. Java is an object-oriented programming language. We will discuss what object oriented means later in the tutorial.
Should learning how to code with Java the first thing I should do if I’m new to programming?
This question is something I often ask myself, I’m not from Computer Science background and I ALMOST learnt programming on my own. Some people out there must suggest to got for data structures (DS), then data algorithms (DA) and then go for a language. I, on the other hand, insist on learning a language, any language first and then jump to structures and algorithms as then only those things will make sense to you and you’ll know where to apply them better! I’m not the brightest one to start a DS or DA tutorial but maybe someday I can 🙂 And anyway DS and DA are taught using a language like C or Java. So let’s get started fellas into our first Java chapter.