The Art of Programming
To be able to write meaningful computer programs called applications, it takes appreciating and developing a level of skills in the Art Of Programming.
So what does it really take to write such programs; what it takes is understanding how programs are written are constructed with, basic building blocks i.e the items (program items) that go into a program and, an understanding of typical program block structures that go into program definitions.
This article is aimed at appreciating that programming art that goes with readers at all levels (a beginner or novice to advanced). These are fundamentals of programming. So this subject stands independent of any programming language and the Application program in question. Although we will have to choose a specific programming language for illustrations and examples, for which, in our case we shall choose Javascript. But you can rest assured to carry this knowledge into any programming language you work with or choose in future.
To start with let's get to some definitions:
Data: A value that is of value. It is a value that represents any fact around us, or object attribute in a problem domain we are addressing.
Such as age, name of a person.
Datatype: The type of data or value in question. e.g. 10, a number, is seen as number type, similarly 'John', a name of person seen as string type.
Variable:>A program item that stores data or value.
Program: A series of instructions that represent and perform a task or an application.
Any meaningful instruction given in a language is made up of parts of speech in some order or combination, as defined by and in conformity with the grammar rules of the language, that makes meaningful communication possible and thereby the instruction to be carried out successfully. In other words, it is words that is arranged in some structures such that it communicates or conveys intended meaning. That said inevitably we have to choose one or the other language for illustration purposes. To accomplish our endeavour to this end, we shall consider the most popular programming language Javascript for examples and illustrations.
By the way writing instructions in a specific chosen language is called coding.
So coding is nothing but writing program instructions in a specific language of implementation.
In that regard, coding in Javascript simply means writing program instructions in Javascript language syntax.
So let's now jump into some coding work; just simply glance or read through the following code script in Javascript.
< script >
name = "John";
alert("Hi " + name);
age = 10;
alert(name + " is " + x + " years old");
< /script >
Because Javascript was first designed for and fits into the scheme of web page programming. To execute the above script code, we shall first write the above code in a text editor such as notepad or we can be doing it in Visual Studio Code a popular editor, then save it as an html file on your local disk. Now, open it in a web browser such as Google Chrome or Microsoft Edge..any Web Browser you use is fine..
You should well be able to appreciate the output or result shown in an 'alert pop-up box'.
In the above Javascript code snippet, there are couple of things to know, that is, age is a variable, name is a variable. So implicitly we should decipher this fact when we see the code that the values supplied to these variables can be different or changing depending on a person's data in question. Hence appropriately they are called variables.
Now this brings us to a point where we are well able to appreciate variables, how to work with them in the sense, how to declare a variable, how to use varables having declared them, how define them by assigning a value; and what is meant by scope of a variable.
Author - Sridhar Chenoor
The author is a web application programmer mostly data driven applications with industry experience of over 14 years using Microsoft tools and technologies as Visual Studio, ASP.NET and also having experience in PHP and Python programming languages