Jump to content
xisto Community
Sign in to follow this  
iGuest

Serverside Vs Clientside Whats best for you?

Recommended Posts

Just thought I'd post about the differences between a serverside language, and a clientside language. Alot of people get them confused easily :P

 

Clientside:

Scripts are placed inside a <script> tag in the page. Visitors are able to see the scripts in the source code of the page. The scripts are run on your computer.

 

Advantages:

Can do more, e.g. make items move.

Can perform actions without having to reload the page first.

Can be used with HTML tags. (e.g. onLoad, OnMouseOver)

Are used to make rollover buttons, which are an important part of many websites.

Disadvantages:

Scripts are interpreted at the visitors browser, if their browser is out-of-date the website will not display properly

Not secure, anyone can look at the code in the page source

Can slow down old computers

Some browsers disable active content, such as clientside scripts and tell the user they may be harmful

Some common uses:

Button rollover effects

Cursor trails

Form verification

Creating cookies

Serverside:

Scripts are placed inside a <? tag in the page. Visitors are not able to see the scripts. The scripts are run at the server, then the result is sent to your computer.

 

Advantages:

More secure, visitors aren't able to view scripts

All scripts are performed at the server, it will work with any browser

You are able to include external files, to save coding

You can combine it with programs such as MySQL

Disadvantages:

Scripts can only be performed when the page loads/reloads

When moving sites, some code may have to be modified, depending on the configuration and version of PHP

In most languages, variables must be preceeded with a $ sign

All lines must end in a semicolon (:P

Some common uses:

User management

File includes

Database communication

Finding $_GET variables (e.g. index.php?variable=value)

I hope that helped you decide which is the best for you! So you're less :P and more <_< !

Share this post


Link to post
Share on other sites

Another disadvantage to server side scripting: an out of control script (aka infinite loop) will take down your server. If a client side script loses control, the most that can go wrong is a crashed browser, and your server won't get hurt.

Share this post


Link to post
Share on other sites

Nice guide. I'm all for server side too, especially now with ajax you can make very advanced sites that don't even need to reload if it's setup properly - you then also have the advantage of the server doing all the processing so the client just gets the direct html code-HellFire

Share this post


Link to post
Share on other sites

Yeah, the main reason why I use Serverside codes, is because if you had something in JavaScript, it might do one thing in Safari, another in Firefox, and nothing in IE, which is what usually happens... But with serverside it doesn't matter what browser the user has, its what server you have.

Share this post


Link to post
Share on other sites

Clientside scripts are most interesting for doing more fancy stuff (like moving things on your page) or requesting some locale information and using it for formating stuff like dates, etc ...All the rest I prefer to be done server side.However, both ways have another, important advantage/disadvantage.Serverside scripts require you to have some processing power and if you have lots of visitors, lots of scripts and lots of complexity you'll need a lot of processing power. Using clientside scripts to do a lot of pre-processing can seriously reduce the load on your server, reducing the costs.The other thing is also true, using a lot of complex clientside scripts require visitors to have powerfull computers.So you'll need a good mix of client- and serverside scripts :D .

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.