Client-Side vs Server-Side Programming Languages
Introduction
In the previous chapter, we learned about the basics of JavaScript, history and how to use JavaScript with example programs.
In this chapter, we will learn about Client-side vs Server-side Programming Languages and how a client-side programming language works.
Basic Background
![Client side and Server Side](https://www.csharp.com/UploadFile/Tutorial/admin/client-side-vs-server-side-programming-languages20072020094720/Images/Client side and Server Side.jpg)
Server
Client
- The user opens his web browser (client)
- The user starts browsing
- The client forwards this request to the server, for accessing their web page.
- The server then acknowledges the request and replies back to the client program.
- The client then receives the page source and renders it.
- Now the user types into the search bar
- The client then submits data to the server
- The server processes the data and replies back with a related search result
- The client again renders it back for the user's view
- The user gets access to the requested link.
Server-side Programming
Server-side Uses
- It processes the user input
- Displays the requested pages
- Structure of web applications
- Interaction with servers/storages
- Interaction with databases
- Querying the database
- Encoding of data into HTML
- Operations over databases like delete, update.
Server-side Languages Example
- PHP
- ASP.NET (C# OR Visual Basic)
- C++
- Java and JSP
- Python
- Ruby on Rails and so on.
Server-side Example
- // This is a sample C# code.
- using System;
- // namespace
- class ServerSide
- {
- public static void Main()
- {
- System.Console.WriteLine(“Hello C# Corner”);
- // printing a line
- }
- }
Client-side Programming
Similarly to server-side programming, client-side programming is also the name of the entire program that runs on the client.
Or we can say that client-side programming mostly deals with the user interface with which the user interacts in the web. It is mostly a browser, in the user's machine, that runs the code and is mainly done in any scripting language like JavaScript (or we can use Flash instead of JavaScript or VNScript).
Client-side Uses
- Makes interactive web pages
- Make stuff work dynamically
- Interact with temporary storage
- Works as an interface between user and server
- Sends requests to the server
- Retrieval of data from Server
- Interact with local storage
- Provides remote access for client-server program
Client-side Languages Example
- JavaScript
- VBScript
- HTML (Structure)
- CSS (Designing)
- AJAX
- jQuery etc.
(Some other languages also can be used on the basis of the modeling/designing /graphics/animations and for extra functionalities.)
Client-side Example
- // sample HTML code
- <html>
- <head>
- <title>Client Side </title>
- </head>
- <body>
- <h1>
- Hello C# Corner
- </h1>
- </body>
- </html>
Summary
In this chapter, we learned about Client-side vs Server-side Programming Languages and how a client-side programming language works with an example program.
Author
Abhishek Jaiswal
95
19.8k
9.6m