How do you compare client-side and server-side programming? Discuss their advantages and disadvantages.
In general, client-side means that the code is executed on the client computer while server-side means that the code is executed on the web server. A client-side program uses functions of the browser and possibly the operating system (which may pose security issues) while server-side programs use the functionality of the web server they are running on.
Client-side scripts are often part of or referenced by an HTML page. The user’s browser is responsible for processing and executing the code while or after loading the web page on the client computer. The most commonly used client-side script language is JavaScript, which is a rather simple programming language that is easy to incorporate into HTML code.
In server-side scripting, the browser requests a page from the web server, and the server creates the page content “on demand”. Most times, the client does not see or receive the actual program code but just a web page that looks like plain HTML. BlackBoard is a good example. The currently open page is a Java Server Page (EDIT: since this is on Wordpress here, it is of course a PHP page) and it has been dynamically created when you clicked on this topic. The content you see is depending on who views it and when it is viewed. The next time you click on it, it will be different. It may just not be marked as a “new post” anymore, someone else may have replied or I may have edited my post.
Both have their advantages and disadvantages. Client-side scripts are good if a programmer does not have full access to the web server. I remember a long time back I had some free web space (Xoom or so) and I was trying to create an email form. I didn’t have full access but was only allowed to use some scripts that were included - what a pain. The successful implementation of client-side scripts also depends a lot on the browser. Even though most browsers display plain old HTML pages in a similar way, there can be a huge difference in the way code is executed. In addition, we have the different operating systems, the OS settings and the browser and there are a lot of possible combinations that may cause unexpected results.
Server-side scripting is independent of the browser and OS (though slight changes in layout can always happen), and it is easier to predict what the user will see. It does require more from the web server though. Not only do you need certain programs and functions on the server, you also have to consider the server load. If you have a lot of simultaneous users accessing a server-side script, the server has to be able to process all those requests. Server-side scripting is also more secure, since the program code is not transmitted to the user but only the result.
comments
Leave a Reply