What is the difference between client-side and server-side programming?
I have this code:
Why does this not write "bar" into my text file, but alerts "42"?
- asked 7 years ago
- Sandy Hook
Web development is all about communication. In this case, communication between two (2) parties, over the HTTP protocol:
- The Server - This party is responsible for serving pages.
- The Client - This party requests pages from the Server, and displays them to the user. In most cases, the client is a web browser.
- The User - The user uses the Client in order to surf the web, fill in forms, watch videos online, etc.
Each side's programming, refers to code which runs at the specific machine, the server's or the client's.
- The User opens his web browser (the Client).
- The User browses to http://google.com.
- The Client (on the behalf of the User), sends a request to http://google.com (the Server), for their home page.
- The Server then acknowledges the request, and replies the client with some meta-data (calledheaders), followed by the page's source.
- The Client then receives the page's source, and renders it into a human viewable website.
- The User types answerspoint into the search bar, and presses Enter
- The Client submits that data to the Server.
- The Server processes that data, and replies with a page matching the search results.
- The Client, once again, renders that page for the User to view.
Server-side programming, is the general name for the kinds of programs which are run on the Server.
- Process user input.
- Display pages.
- Structure web applications.
- Interact with permanent storage (SQL, files).
- ASP.Net in C#, C++, or Visual Basic.
- Nearly any language (C++, C#, Java). These were not designed specifically for the task, but are now often used for application-level web services.
Much like the server-side, Client-side programming is the name for all of the programs which are run on the Client.
- Make interactive webpages.
- Make stuff happen dynamically on the web page.
- Interact with temporary storage, and local storage (Cookies, localStorage).
- Send requests to the server, and retrieve data from it.
- Provide a remote service for client-side applications, such as software registration, content delivery, or remote multi-player gaming.
- Any language running on a client device that interacts with a remote service is a client-side language.
*HTML and CSS aren't really "programming languages" per-se. They are markup syntax by which the Client renders the page for the User.
- answered 7 years ago
- Gul Hafiz
Its main tasks are:
- validating input (Validation must be done in the server. A redundant validation in the client could be used to avoid server calls when speed is very critical.)
- manipulating UI elements
- applying styles
- some calculations are done when you don't want the page to refresh so often
The person in charge of front end programming must know:
- basic graphic design
- maybe Flash
- UI design
- information design, etc.
Server side programming has to do with generating dynamic content. It runs on servers. Many of these servers are "headless". Most web pages are not static, they search a database in order to show the user updated personalized information. This sides interacts with the back end, like say, the database.
This programming can be done in a lot of languages:
- Java and jsp
- Ruby on Rails, etc.
This code has to do with:
- Querying the database
- Encode the data into html
- Insert and update information onto the database
- Business rules and calculations
The person in charge of server side programming must know:
- some of the languages mentioned above
- linux/unix shell scripting
- business rules, etc.
- answered 7 years ago
- G John