Thursday, February 7, 2013

Web development primer

Hello friends,

This is an on demand article about web development. I will cover some basic terms, concepts and ideas related to web development. This article will help those who are planning to jump start into learning web development. The concepts I explained are from a beginner point of view. In the end I will conclude by showing a simple HTML file.

How does HTTP work?
HTTP is the protocol of the internet. HTTP stands for HyperText Transfer Protocol. For the time being, just keep in mind that whatever data transfer occurs through the web follows the HTTP protocol.
HTTP works on request and response. Your browser requests something, the server on the other side sends back the page you requested. Consider an example,
you enter google.com into your browser. Your browser will send a request to the Google's server requesting their homepage. Google's server will send back their homepage in response which will be displayed on your screen. Very simple.
Similar thing is repeated whenever you follow a link or navigate from one webpage to another.

 HTML-
HTML stands for HyperText Markup Language. It is the language in which webpages are written. Whenever a server sends you a webpage, It is essentially sending the webpage in plain text i.e. the contents of the webpage which is nothing but HTML code. Your browser then interprets this HTML code and constructs the webpage on screen according to HTML tags specified. As you maybe aware, HTML files end in ".htm" or ".html" extension. Webpages are just HTML files stored on the web server.

Web Server and Web Application-
Now lets take a closer look at what happens on server's side. Web servers are just like normal computers with higher processing powers. Just like your computer, an OS runs on web servers.  And web server is ultimately an application software that runs over the OS. Popular web server softwares are microsoft IIS and Apache HTTPD. Once the server's hardware receives the request, it is passed to the Operating System which runs it. The OS in turn passes this request to the web server software. The web server software is always running and is listening for requests. On receiving, the server picks up the requested webpage from its directory, processes it and sends to the user. Generally in any directory present on the web server, "index.htm" or "index.php" is the default page if the page name is not specified.
Web application is simply a set of related webpages on the server and maybe connected to a database in the background where they can store the data. Examples of web applications are online shopping websites and user forums.

Client Side Scripting and Server Side Scripting-
Websites have grown more dynamic with time and simple HTML is never enough for the functionality they provide. There are some scripts which can be embedded into HTML pages. These are client side scripts and server side scripts.
Client side scripts are executed inside the user's browser while it is interpreting the HTML code. They are used to add functionality to the user's end. Examples are JavaScript and VB Script.
In the above section, I said that the web server processes the page before sending it to the user. This means that the server itself executes the server side scripts which maybe present in the page. Again, the server side scripts are used for added functionality such as database interaction, command execution and getting user's info. Examples are PHP and ASP.

Sample HTML Program-
<html>
<head>
 <title>Sample</title>
</head>
<body>
 <h1>This is sample text.</h1>
 <br>
 <script language=JavaScript>
  document.write("<h1>This is another sample text</h1>");
 </script>
</body>
</html>

Copy the above code in notepad file and save it as sample.htm or sample.html. Then run it through your web browser, (preferably firefox or chrome). It should show two lines of text. The first line is inserted through html and second one is generated through javascript present in the page.

Resources-
There are many websites where you can learn HTML or other languages for free. The best one according to me is 
http://www.w3schools.com
Also many books focusing on a specific language and platform are also available.

Thanks for reading :)

2 comments:

  1. This is very different from other blog that I've read this day. I now finally found out the updates and advantages. Thanks!

    ReplyDelete
  2. This is very interesting, You are an excessively professional blogger. I've joined your rss feed and sit up for in the hunt for more of your fantastic post. Additionally, I have shared your website in my social networks
    Download Free Movie Online, Surely Good Sources

    ReplyDelete