I'm trying to understand this concept better. Is the whole point of server side programming is to allow us to communicate with others? Whether it is to get new ideas or to get data that can't be stored locally on the client because it would be way too much information?
-
They aren't really for comparison, as they're two completely different aspects. – Jul 14 '15 at 01:48
-
Why do people mark down my questions? This is a question that I genuinely wanted to understand, if you're going to markdown my question then give me an answer at least instead of doing nothing – Jack Ryan Jul 14 '15 at 01:55
-
FWIW, to closers: while I might agree that this question could be broad and basic, I don't think it is unclear, and I strongly disagree that it is opinion-based. – Amadan Jul 14 '15 at 02:08
2 Answers
There are several typical software architectures:
- Non-networked application (does not communicate, client-only)
- Server-client application (has typically one or more central servers, and multiple clients that contact the server(s))
- Peer-to-peer application (only has clients that communicate with each other).
Here, client is typically the part of the application that is executing on the user's computer, which the user is interacting with. Server is defined as the part of the application that user is not interacting directly, and is not on his computer but somewhere else. This separation can be for any of a number of reasons: data size, data security, data availability, or simply coordination.
For example, when you go to Google on your web browser, the web browser is a client. Google is the server. Your computer does not know where everything on the Web is; but Google has a pretty good idea.
For another example, if you play MMORPGs like World of Warcraft, your game is the client, and Blizzard's computers are the server; you tell the server what you are doing, and the server tells you the results, just like a pen-and-paper gamemaster. Without the server, you couldn't know what everyone else is doing.
Or, if you want to consult the atomic clock at the U.S. Naval Observatory, again, you are the client, the clock is the server; you contact it because, obviously, you don't know the correct time, and it does.
Now, for example, you might say that server might not be needed in some cases. For example, in the MMORPG case, couldn't the players contact each other directly? The first problem is discoverability: how would they find each other on the Internet? There has to be some central location to tell everyone everyone else's address. But if that is all the server did, you would have to contact all of the online players (and there are a lot of them) to ask them where they are, and if they are on the same map ask them the same question very very often; your internet connection would not be able to do it. There is also security to consider: a server makes sure (or should make sure) that you are not teleporting around on the map by changing the game's code and telling other player bogus values. For example, if client was responsible for remembering how much gold a player has, it would be trivial to become very rich very quickly: just lie about it to others.

- 191,408
- 23
- 240
- 301
-
THANK YOU VERY MUCH, this is exactly what I needed, especially "This separation can be for any of a number of reasons: data size, data security, data availability, or simply coordination.", thanks for giving me an answer, I ask questions on here all the time because I learn by myself and it's so frustrating when my posts are always downvoted. I do read and try to look up as much as I can but when I can't find it and ask a question, I just get slapped with criticism, it's really hard but thank you. – Jack Ryan Jul 14 '15 at 01:59
-
Well, the issue is likely that Stack Overflow is not a normal forum. It is a repository for objective programming knowledge. Thus, if a question is judged to not be of interest to anyone else, or asking for subjective opinions, or fails on one of several other criteria, it might be downvoted and/or closed. Try getting familiar with Stack Overflow scope at [Tour](http://stackoverflow.com/tour) and [Help/Asking](http://stackoverflow.com/help/asking) to see what is on-topic here, and how to best write your question to ensure high-quality answers. – Amadan Jul 14 '15 at 02:04
When you go to a website on the internet, your browser is the interpreter that reads HTML/CSS/JavaScript. To read these, your browser must first download the code, then interpret it, then display it to you. Since your web-browser downloads the code, it is really easy for you to see it. (as seen below).
This is great for small projects like blogs, informational websites, project-pages, etc. But say you worked really hard on a big project, and you don't want people to see your code. In client-side programming, the webbrowser reads code, and displays it. If you right click and save a static (HTML, CSS, JavaScript only) website, you'll be able to view it even if you shut off your internet. In server side programming, your web-browser can't read the code because the code will not be the usual HTML/CSS/JavaScript. Since your web-browser can't read the code, it looks to the server (which is a giant computer in a data center far, far away). The server does everything for the web browser, and just returns results. The web browser has the results, but doesn't know how the server processed them, so it displays the results, but doesn't display the code behind it.
This is great because for one, all your code logic is happening privately, which is essential for security and privacy. And, it's happening really fast. Since the server is some huge computer that is much much faster than yours, all your logic for your website is processed really quickly. Also, you get to communicate with databases, and store data, whereas in client-side programming, everything is happening on your machine and your machine only. Basically your code gets the ability to remember.
In essence, you would use client-side programming for information, styling, and small projects. Client-side is usually referred to as front-end development because it's what the user see's (the front). Back-end development (server-side) is the background logic, and is everything that happens behind the scenes, which the user doesn't, and shouldn't see. If you were making some big website, and you had user accounts in it, you can't just store their user/pass in a javascript variable because a) everyone would be able to see the code, and thus, the user info and b) their user/pass would be gone as soon as they closed the page. Server-side communication opens a bunch of more doors for us.

- 189
- 1
- 15