A program is a sequence of instruction codes. It is executed according to the sequence of instructions. In the realm of software development, programs are developed to provide certain degree of automation for an application. The ability of the application software to solve problems lies heavily on the logic of the program which I will describe as the “reasoning provider” of a program or application. Logic gives an application the ability to reason. The more advanced the logic, the greater the reasoning power of the application and the more the degree of automation. There is no ready-made logic for solving all problems. The development of the correct logic is a function of the IQ and experience of the programmer which determine his ability to meet the challenges of developing the right logic. However, tools like program flowchart and UML could assist in developing the algorithm and by extension, the logic of a program.
Tasks like signing up and signing in on the web can be used to demonstrate the artificial reasoning by a program or script. When you sign up and submit your profile, if the username and/or password have been used by someone else, the script would deny you signing up. How did the program know that the username and/or password exist? It is through the reasoning power of the program given by the logic which ensures that the script searches first for the existence of the username and/or password and then prevents the submission of data into the database upon finding that the username and/or password exist. The same thing goes for signing in into an account. It is through the reasoning power (logic) of the program that the script is able to know whether the username and/or password exist in the database. If the logic is wrong or inadequate, you might find a situation where a user can sign in successfully with a non-existent username or password.
We have seen what logic is all about. It is processed back-end and so site visitor does not see it and he needs not see it but he needs to see some results of logic processing such as login and sign up denial and the reason why. To this end, provision is made in scripts for outputting to the browser custom messages that are quite explanatory to the visitor. Dynamic messages like this and things like text, images, animations, forms, and what have you that enable visitor interact with a web site and browse are what you call presentation. You can create presentation using scripts and static HTML tags. Each scripting language has its own built-in function for creating presentation. For instance-
With these functions when used in web pages, you can create forms, tables, custom messages which visitors can interact directly with. The appropriate HTML tags are put inside the bracket according to the specific syntax and create presentation the way a static HTML web page would. In dynamic web pages, server-side scripts containing logic and these presentation creating functions can be interspersed with static HTML tags like in PHP, JSP, and ASP where you separate the server-side portion from the static HTML portion using special symbols like
Separation of logic and presentation is the key to highly maintainable software. The idea is simple- if the designers intend to change the presentation of the site, no logic should be modified, and if the editors change the content, no change should be reflected in the logic of an application. An effective way of separating logic from presentation is by the use of Server-Side Includes (SSIs) in dynamic web pages. SSIs allow you to insert the content of one file in another web page. By so doing, you can incorporate a single file in multiple web pages or multiple files in a single web page.